1

I'm facing some difficulties while trying to execute (from my Linux machine) a python script, which takes arguments from CLI in order to run properly. The script located on my Windows machine, and I'm trying to do this by using winexe.

./winexe -A localConfig //MyServer 'cmd.exe /c "cd C:/scriptDirectory & python MyPythonScript --user sami --day sunday --age 5"

What happens is that when I execute the command above, MyPythonScript is running but completely ignore the arguments that I'm passing via the CLI. Any suggestions?

Here is part of the code that accepts the arguments:

argsLen = len(sys.argv)
if argsLen > 1:
    user = sys.argv[2]
    day = sys.argv[4]
    age = sys.argv[6]
else:
    user = myUser
    day = myDay
    age = myAge

You help is appreciated.

0 Answers0