Search code examples
python-3.xcygwintcsh

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


I am using the tcsh shell of Cygwin. I installed Cygwin because I have a prof giving a bunch of instructions in Linux/Mac and they are all using csh commands.

When I type this:

cat some_file.txt | some_python_script.py

I get this:

some_python_script.py: Command not found.

Where some_python_script.py is a script that should be run on the stdin. How can I get my Python scripts to work in Cygwin like if I was in a linux/Mac environment?

Thanks!


Solution

  • You are asking it to pipe the content of some_file.txt into some_python_script.py

    It is expecting a command there. Generally you would run A python script like this

    python some_python_script.py
    

    If you want to pipe the content of some_file.txt into it you would do this

    cat some_file.txt | python some_python_script.py