By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
439,932 Members | 1,944 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 439,932 IT Pros & Developers. It's quick & easy.

Pass variables to system command

P: 2
Hi!, im new here (obviously) but also to python and/or programming.
I am looking for information on how to use variables through start>run on windows.
My script, that works, is as follows

Expand|Select|Wrap|Line Numbers
  1. import glob, os
  2. filetype = raw_input("File type ['*.*, *.txt']:")
  3. directory = raw_input("Directory ['C:\Windows']:")
  4. out = open("list.txt", "w")
  5. files = glob.glob(os.path.join(directory, filetype))
  6. for filename in files:
  7.     out.write(filename + '\n')
  8.  
but as i said before, i want to be able run the program when i am not at the computer, by using a task schedular for example, where the variables will need to be stated in the command.
Thanks for any help :D
Sep 10 '05 #1
Share this Question
Share on Google+
1 Reply


P: 2
Is this possible?
Sep 23 '05 #2

Post your reply

Sign in to post your reply or Sign up for a free account.