passing python variables into shell commands as argv

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Giao
    New Member
    • Aug 2006
    • 1

    passing python variables into shell commands as argv

    Hi, I'd like to do the following things in python script

    x = "file1"
    y = "file2"

    shell's commands x y

    Is any one out there tell me how it get done.

    Thanks
    GIAO
  • dpal
    New Member
    • Aug 2006
    • 6

    #2
    I think I am understanding you correctly...
    you want to use 2 command line arguments in your script?
    If so you will need to:

    import sys
    #assign arbuments to variables foo and bar
    foo = sys.argv[1]
    bar = sys.argv[2]

    Comment

    Working...