I'm the author of Hamilton C shell. It sounds like you're using Cygwin with my C shell and getting the following error when you try to use python:
1 C% python
csh(C:\cygwin64\bin\python line 1): Couldn't open 'symlink' as a redirected standard input.
> in C:\cygwin64\bin\python
< called from line 1
The problem is that the Cygwin python command is a Cygwin-only symbolic link file rather than an actual executable. They're only supported by Cygwin. (You may have noticed that cmd.exe won't run it either.) Here's what's in it:
2 C% whereis python
C:\cygwin64\bin\python
3 C% cat `!!`
cat `whereis python`
!<symlink>python2.7.exe
Not being able to recognize it as anything else, the C shell tried to interpret it as a script, thought it recognized a !<
C shell i/o redirection operator but could not find a file named symlink
, hence the error message.
But given that all that file is doing is redirecting you to the actual executable, you can do the same thing with a C shell alias which you can save in your startup.csh file:
4 C% alias python python2.7
5 C% python
Python 2.7.10 (default, Jun 1 2015, 18:05:38)
[GCC 4.9.2] on cygwin
Type "help", "copyright", "credits" or "license" for more information.
>>> quit()
6 C% cd desktop
7 C% cat MyScript.py
print("Hello")
8 C% python MyScript.py
Hello
If you'd like to run your python scripts directly from the C shell without having to type the python command, the C shell supports the common #!
syntax to tell it to use the python interpreter. But notice it still needs the name of the actual executable. Here's an example:
9 C% cat MyScript2.py
#!python2.7
print("Hello")
10 C% MyScript2.py
Hello
11 C%