#!/usr/bin/env python from main parsing function import userClass import smtplib from email.MIMEMultipart import MIMEMultipart from email.MIMEText import MIMEText userObj = userClass() def main(): menu(mainMenuDisp()) def mainMenuDisp(): print "****Welcome to Episode Watch****\n" print "Menu: " print "1. View Episodes" print "2. Log In" print "3. Save Shows" print "4. Check for New Episodes" print "5. Set Automated Checking Features" print "6. Start Automated Checking" print "7. Quit" print "\n" valid = 0 while not valid: try: option = input("Enter 1-7: ") valid = 1 except: print "\nInvalid Choice" valid = 0 print '' return option def menu(x): options = {1 : userObj.dispAllEpis, 2 : userObj.logIn, 3 : userObj.saveShows, 4 : userObj.checkEpis, 5 : userObj.setAuto, 6 : userObj.startAuto, 7 : quit} options[x]() # Loop back to mainMenu main() def testEmail(): gmail_user = "thatotherguy23@gmail.com" gmail_pwd = "oyster23" to = "almostunfriendly@gmail.com" text = "This is an email" msg = MIMEMultipart() msg['From'] = gmail_user msg['To'] = to msg['Subject'] = "subject" msg.attach(MIMEText(text)) mailServer = smtplib.SMTP("smtp.gmail.com", 587) mailServer.starttls() mailServer.login(gmail_user, gmail_pwd) mailServer.sendmail(gmail_user, to, msg.as_string()) mailServer.quit() if __name__ == "__main__": main()
Run
Reset
Share
Import
Link
Embed
Language▼
English
中文
Python Fiddle
Python Cloud IDE
Follow @python_fiddle
Browser Version Not Supported
Due to Python Fiddle's reliance on advanced JavaScript techniques, older browsers might have problems running it correctly. Please download the latest version of your favourite browser.
Chrome 10+
Firefox 4+
Safari 5+
IE 10+
Let me try anyway!
url:
Go
Python Snippet
Stackoverflow Question