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

Cygwin - tcsh - Can't run Python script - Command not found

我正在使用 Cygwin 的 tcsh shell。我安装了 Cygwin,因为我有一位教授在 Linux/Mac 中给出了一堆说明,他们都在使用 csh 命令。

当我输入这个时:

cat some_file.txt | some_python_script.py

我明白了:

some_python_script.py: Command not found.

其中 some_python_script.py 是一个脚本,在标准输入中应该是 运行。如何让我的 Python 脚本像在 linux/Mac 环境中一样在 Cygwin 中工作?

谢谢!

您要求它将 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