I have written the simple script:
import sys
print("len(sys.argv): "+str(len(sys.argv)))
if len(sys.argv) < 2:
print("Wrong params. ex: 'touch.py file_name file_name2'")
exit(1)
for file in sys.argv[1:]:
open(file, 'a')
Saved it, added at PATH
and try to call from CMD
like touch.py fileName
, however my script get only 1 argument -- path to the script. So, how can I call python script from CMD with params? Does it problem only for Windows? What about linux?