Cygwin-tcsh-无法运行Python脚本-找不到命令

问题描述 投票:0回答:1

我正在使用Cygwin的tcsh外壳。我安装了Cygwin是因为我有一个教授在Linux / Mac中给出了很多指令,并且它们都使用csh命令。

当我键入此内容时:

cat some_file.txt | some_python_script.py

我明白了:

some_python_script.py: Command not found.

其中some_python_script.py是应在stdin上运行的脚本。如果我在linux / mac环境中,如何使自己的Python脚本在Cygwin中工作?

谢谢!

python-3.x cygwin tcsh
1个回答
0
投票

您正在要求将some_file.txt的内容通过管道传输到some_python_script.py

它期待在那里的命令。通常,您将运行像这样的python脚本

python some_python_script.py

如果您想将some_file.txt的内容传送到其中,请执行此操作>>

cat some_file.txt | python some_python_script.py
© www.soinside.com 2019 - 2024. All rights reserved.