Pass variables to system command

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • likewtfster
    New Member
    • Sep 2005
    • 2

    #1

    Pass variables to system command

    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

    Code:
    import glob, os
    filetype = raw_input("File type ['*.*, *.txt']:")
    directory = raw_input("Directory ['C:\Windows']:")
    out = open("list.txt", "w")
    files = glob.glob(os.path.join(directory, filetype))
    for filename in files:
    	out.write(filename + '\n')
    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
  • likewtfster
    New Member
    • Sep 2005
    • 2

    #2
    Is this possible?

    Comment

    Working...