Python Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesPython Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old July 9th, 2012, 11:07 AM
pylover pylover is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2012
Posts: 1 pylover User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 2 m 56 sec
Reputation Power: 0
New to python

Hi all,

I'm looking to create a py script which basically automates all of my day to day habits such as after I login update my av, check for updates for my firewall open thunderbird and check for new emails.

But first I would like a way to authenticate the name for security purposes. is this possible with an if statement?

Is all of this possible and if so could someone give me an idea on how to start it.

Thanks in advance and this is what I have so far. not very much

Code:
import os

greet = input("What is your name? ") # wait for user input
if "Glynn":
    print ("Hello " + greet) # print name & greeting

level1 = input("What would you like to do? ") # more user input

if "Check Email":
    import subprocess
    subprocess.call(['C:\\Program Files\\Mozilla Thunderbird\\thunderbird.exe'])

Last edited by pylover : July 9th, 2012 at 11:48 AM. Reason: Finished part of the code now onto elif statements :)

Reply With Quote
  #2  
Old July 9th, 2012, 12:42 PM
hostwindsEvanM hostwindsEvanM is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2012
Posts: 55 hostwindsEvanM User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 h 30 m 18 sec
Reputation Power: 1
This is an awesome starting project. Though, forgive me if I am wrong, but wouldnt it be easier to simply click the Thunderbird icon as opposed to opening this, typing it in, etc? Sounds like de-automation to me!
Perhaps write it to check for new emails by its self and a few others things in one click. Thats luxury!

Reply With Quote
  #3  
Old July 9th, 2012, 12:52 PM
lynuxlover lynuxlover is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2012
Posts: 6 lynuxlover User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 8 m 48 sec
Reputation Power: 0
I never thought of it like that this is just my starting project put everything I learn into a script which I can always come back to but what you said does sound pretty good wish I had thought of that, I might try that later.

and now i'm stuck on if statements trying to create a menu with a list e.g

print"""menu
1) Check Emails
2) Update AV
3) Browse the web"""

if 1 .... can't seem to get the syntax right.

Reply With Quote
  #4  
Old July 9th, 2012, 01:30 PM
b49P23TIvg's Avatar
b49P23TIvg b49P23TIvg is offline
Contributing User
Dev Shed Loyal (3000 - 3499 posts)
 
Join Date: Aug 2011
Posts: 3,458 b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level) 
Time spent in forums: 1 Month 2 Weeks 4 Days 6 h 26 m 43 sec
Reputation Power: 403
Code:
greet = input("What is your name? ") # wait for user input

if "Glynn" == greet:   #### See the test?????
    print ("Hello " + greet) # print name & greeting

level1 = input("What would you like to do? ") # more user input

if '1' == level1: # Check Email  ####  See the test?
    import subprocess
    subprocess.call(['C:\\Program Files\\Mozilla Thunderbird\\thunderbird.exe'])
__________________
[code]Code tags[/code] are essential for python code!

Reply With Quote
  #5  
Old July 9th, 2012, 01:39 PM
lynuxlover lynuxlover is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2012
Posts: 6 lynuxlover User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 8 m 48 sec
Reputation Power: 0
thank you b49P23TIvg, for this snippet it looks alot cleaner than mine. hopefully one day mine might be as clean.

Reply With Quote
  #6  
Old July 9th, 2012, 01:59 PM
b49P23TIvg's Avatar
b49P23TIvg b49P23TIvg is offline
Contributing User
Dev Shed Loyal (3000 - 3499 posts)
 
Join Date: Aug 2011
Posts: 3,458 b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level) 
Time spent in forums: 1 Month 2 Weeks 4 Days 6 h 26 m 43 sec
Reputation Power: 403
huh?

It's the same as your snippet except that
"a non-empty string is always true"
"a" == b # truth depends upon the value of b

Reply With Quote
  #7  
Old July 9th, 2012, 02:14 PM
lynuxlover lynuxlover is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2012
Posts: 6 lynuxlover User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 8 m 48 sec
Reputation Power: 0
Right well it looks like i'll have to understand python a little more.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPython Programming > New to python

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap