Python arguments cuts at < when reading from command line -
i got script supposed take time takes execute python
-script. simplicity supply actual command want execute arguments in commandline.
say call:
python time.py python ratatosk.py < input.txt
here after python time.py
actual command want execute.
however, when reading sys.argv
this:
print 'number of arguments:', len(sys.argv), 'arguments.' print 'argument list:', str(sys.argv)
it returns:
number of arguments: 3 arguments. argument list: ['time.py', 'python', 'ratatosk.py']
where did rest of arguments go? looks <
somehow stripped away.
i running python python 2.7.3 (v2.7.3:70274d53c1dd, apr 9 2012, 20:52:43) on macbook pro.
you need escape < sign. try calling:
python time.py python ratatosk.py \< input.txt
it might better use different character < running command easier
Comments
Post a Comment