943,777 Members | Top Members by Rank

Ad:
  • Python Discussion Thread
  • Unsolved
  • Views: 1009
  • Python RSS
Jul 5th, 2009
0

How do I pass user ID and password?

Expand Post »
Hey guys,

I want to make a Python program which I will use to automate certain tasks like opening TweetDeck and Skype everytime I boot up my laptop.

The problem is, I know how to open the programs(using subprocess.call), but I don't know how to pass the user ID and password. Can anybody help me?

Thanks a lot!
Similar Threads
Reputation Points: 2
Solved Threads: 30
Posting Whiz in Training
sravan953 is offline Offline
242 posts
since May 2009
Jul 5th, 2009
0

Re: How do I pass user ID and password?

A simple thing to do would be to have skype remember your login information and connect every time it starts up. You could then launch it from whereever you chose - startup (msconfig) or using ur own script.

If you dont want to do that but want to know how to actually pass the username and password i suggest you try exploring the command line options for skype. As far as i recall, there aren't any options to pass login info. Try looking up a book (try flazx.com) called "skype hacks"

Another approach could be the use of win32com libraries in python. These libraries provide a way for programs to interact with GUI widgets in other programs that are running (eg. you could actually write a program to click the ok button of some dialog box on the screen). I don't know how these libraries will work with the widgets skype uses.

I have just one question.. why would u wanna go through all that trouble for a simple task like this
Reputation Points: 10
Solved Threads: 0
Newbie Poster
asim.mittal is offline Offline
2 posts
since Jul 2009
Jul 5th, 2009
0

Re: How do I pass user ID and password?

I just thought I would start off with the basics, and then implement some where else, like in make programs for my friends which starts Thunderbird on boot up, or TweetDeck on boot up, or heck, both!

And thanks for the link and mentioning Win32 module, I will surely look into it.
Reputation Points: 2
Solved Threads: 30
Posting Whiz in Training
sravan953 is offline Offline
242 posts
since May 2009
Jul 6th, 2009
0

Re: How do I pass user ID and password?

Also, how can I make a program to open on startup(any other way than dragging and dropping the program in the Startup group in the Start menu?)
Reputation Points: 2
Solved Threads: 30
Posting Whiz in Training
sravan953 is offline Offline
242 posts
since May 2009
Jul 9th, 2009
0

Re: How do I pass user ID and password?

Anybody? Please reply! Please please!
Reputation Points: 2
Solved Threads: 30
Posting Whiz in Training
sravan953 is offline Offline
242 posts
since May 2009
Jul 10th, 2009
0

Re: How do I pass user ID and password?

Don't keep bumping on your thread.
No one is free enough to help you if you don't show effort.
I have see many thread started by you stating "How do I do this" without any efforts.

Learn to ask question the smart way : Read this page http://www.catb.org/~esr/faqs/smart-questions.html

Also, read the guidelines mentioned on this thread http://www.daniweb.com/forums/thread202628.html
Reputation Points: 1486
Solved Threads: 140
Practically a Posting Shark
siddhant3s is offline Offline
816 posts
since Oct 2007
Jul 10th, 2009
0

Re: How do I pass user ID and password?

Try looking into MS Windows' services. You could set your program as a service and then have it run automatically on start-up. You may need to look into running Python scripts as services; here's an example.
Reputation Points: 186
Solved Threads: 77
Posting Pro in Training
shadwickman is offline Offline
495 posts
since Jul 2007
Jul 11th, 2009
0

Re: How do I pass user ID and password?

Click to Expand / Collapse  Quote originally posted by siddhant3s ...
Don't keep bumping on your thread.
No one is free enough to help you if you don't show effort.
I have see many thread started by you stating "How do I do this" without any efforts.

Learn to ask question the smart way : Read this page http://www.catb.org/~esr/faqs/smart-questions.html

Also, read the guidelines mentioned on this thread http://www.daniweb.com/forums/thread202628.html
Since you are a very experienced poster, I am showing some respect.

And, if you don't have a solution to my question, please don't clutter my thread by posting unnecessary replies!
Reputation Points: 2
Solved Threads: 30
Posting Whiz in Training
sravan953 is offline Offline
242 posts
since May 2009
Jul 13th, 2009
0

Re: How do I pass user ID and password?

python Syntax (Toggle Plain Text)
  1. import platform, shutil
  2.  
  3. a = platform.release() # retrieves Windows release version
  4.  
  5. def vistamove():
  6. src = "your.file" # The name and directory of your file
  7. dst = "C:\\ProgramData\\Microsoft\\Windows\\Start Menu\\Programs\\Startup" # Where you want it to go
  8. shutil.move(src, dst) # Perform the moving action
  9.  
  10. def xpmove():
  11. src = "your.file"
  12. dst = "C:\\Documents and Settings\\All Users\\Start Menu\\Programs\\Startup"
  13. shutil.move(src, dst)
  14.  
  15. if a == "Vista":
  16. vistamove()
  17. elif a == "XP":
  18. xpmove()

This code checks the Windows release (XP or Vista only), and then copies the file to the All Users startup. If you want it for only specific users, just change it as necessary. Hope this helped.

This is done because the startup folder is placed in different areas on each OS.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
BatteredT is offline Offline
1 posts
since Jul 2009
Jul 14th, 2009
0

Re: How do I pass user ID and password?

Dude, you're asking a complicated question. (Also saw that you mentioned threading in another thread)

Not to discourage you, but taking on large projects that you don't fully understand usually end badly, because the code you spend so much time on turns out to be badly written and impossible to maintain or make changes. My advice: Plot out the bigger project, figure out the concepts you have to learn and write separate projects around those concepts. Then you can apply what you've learned towards the larger project.

Also: Begging for replies and asking people not to post is a bit contradictory, no?
Last edited by zachabesh; Jul 14th, 2009 at 9:32 pm.
Reputation Points: 16
Solved Threads: 17
Junior Poster
zachabesh is offline Offline
106 posts
since Jun 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Python Forum Timeline: subprocess.call problem
Next Thread in Python Forum Timeline: How to find a file from a directory by Python?





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC