Pat*_*ard 5 python command-line dos
我想将文件的内容以及其他一些参数传递给Windows上的python脚本。
在linux上,我可以这样做:
less input.txt | my_script.py > output.txt
Run Code Online (Sandbox Code Playgroud)
在Windows上,我尝试了以下操作,但似乎不起作用:
more input.txt | python my_script.py > output.txt
Run Code Online (Sandbox Code Playgroud)
知道我在做什么错吗?
使用以下命令。它可以在Linux和Windows中使用。
python my_script.py < input.txt > output.txt
Run Code Online (Sandbox Code Playgroud)