Thursday, August 25, 2005

Executing Python Files

This is a pesky little thing I just ran across. I was setting up some Python code on my Linux box, pulling it out of CVS on SourceForge, and did the obligatory chmod to make one of my tests runnable. But no matter what I tried, I couldn't run the darn thing.

Turns out, it has DOS-style line endings, (i.e. CRLF, instead of the CR that Unix/Linux likes). Once I used dos2unix to switch that, it worked fine. Apparently, the first-line hash-bang that tells the shell where to find the executable had bash all confused, and unable to find Python.

0 Comments:

Post a Comment

<< Home