Skip to content

Instantly share code, notes, and snippets.

View 123Phil's full-sized avatar

Phillip Stewart 123Phil

  • Southern California
View GitHub Profile
@123Phil
123Phil / stock.py
Created November 21, 2013 05:33
those functions weren't necessary... this is probably all you want
stock = raw_input("What is the stock name? ")
buy_price = raw_input("What did you buy the stock at? ")
current_price = raw_input("What is the stock's current price? ")
stock_number = raw_input("How many stocks did you buy? ")
tax = raw_input("Did you buy this stock over a year ago? ")
change = float(current_price) - float(buy_price)
profit_before_tax = float(change) * float(stock_number)
if tax.upper() == 'NO' or tax.upper() == 'N':
@123Phil
123Phil / mail.py
Created February 24, 2013 20:37
Simple python text mailer
import smtplib
username = 'gmail_username'
password = 'gmail_password'
fromaddr = 'gmail_username@gmail.com'
toaddrs = '10digit_phone_number@txt.att.net'
msg = 'Message to be sent'
server = smtplib.SMTP('smtp.gmail.com:587')