title: Hide login credentials in Python script
body: <p>I am using Python 2.7.3 and successfully passing my login credentials to an SMTP server to send me a text or email when an event trigger takes place. However, now I would like to store the SMTP server login and password in a separate file so that multiple scripts could use that information or so that I can share my script without having to remove my credentials each time.</p>
  
  <p>I am using the great <a href="http://alextrle.blogspot.com/2011/05/how-to-send-sms-message-with-python.html" rel="noreferrer">tutorial from Alex Le on sending an SMS via Python</a>. But now I want to take the following segment and put it into another file that can be called by multiple scripts. This could be either just the username/password pair or the whole section.</p>
  
  <pre><code>server = smtplib.SMTP( "smtp.gmail.com", 587 )
  server.starttls()
  server.login( '&lt;gmail_address&gt;', '&lt;gmail_password&gt;' )
  </code></pre>
  
  <p>I would consider myself a pretty basic Python programmer. I don't mind doing some research, but I think I need help on what terms I should be looking for.</p>