Search Results

Search found 29 results on 2 pages for 'shadyabhi'.

Page 2/2 | < Previous Page | 1 2 

  • Fetch Subject & sender in IMAP

    - by shadyabhi
    After the following code:- import imaplib conn = imaplib.IMAP4("mail.daiict.ac.in") conn.login("200801076","mypass") # OUT: ('OK', ['Logged in.']) conn.select() # OUT: ('OK', ['166']) Now, how do I fetch the sender and subject of mails in the inbox?

    Read the article

  • Is this the right way of handling command line arguments?

    - by shadyabhi
    ask_username = True ask_password = True ask_message = True ask_number = True def Usage(): print '\t-h, --help: View help' print '\t-u, --username: Username' print '\t-p, --password: Password' print '\t-n, --number: numbber to send the sms' print '\t-m, --message: Message to send' sys.exit(1) opts, args = getopt(sys.argv[1:], 'u:p:m:n:h',["username=","password=","message=","number=","help"]) print opts, args for o,v in opts: if o in ("-h", "--help"): Usage() elif o in ("-u", "--username"): username = v ask_username = False elif o in ("-p", "--password"): passwd = v ask_password = False elif o in ("-m", "--message"): message = v ask_message = False elif o in ("-n", "--number"): number = v ask_number = False #Credentials taken here if ask_username: username = raw_input("Enter USERNAME: ") if ask_password: passwd = getpass() if ask_message: message = raw_input("Enter Message: ") if ask_number: number = raw_input("Enter Mobile number: ") I dont think it is, because I am using 4 objects just for checking if command line argument was provided... Guide me with the best way of doing it..

    Read the article

< Previous Page | 1 2