<br><br><div><span class="gmail_quote">On 16/02/06, <b class="gmail_sendername">Brian van den Broek</b> <<a href="mailto:broek@cc.umanitoba.ca">broek@cc.umanitoba.ca</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi all,<br><br>I've switched to Linux fairly recently and am still at the fumbling<br>about stage :-) I'm having a devil of a time with the shebang line<br>and running a py file from a command line.<br><br>I wrote the following little test script with IDLE
1.1.2 under Python<br>2.4.2 on Ubuntu 5.10:<br><br><code><br>#!/usr/bin/python<br>print "Working!"<br></code><br><br>I then C & P'ed it to another .py file. testerlyfoo.py is the<br>original, testerlybar.py
is the pasted copy.<br><br>Here's my command line results:<br><br>brian@Cedric:~$ which python<br>/usr/bin/python<br>brian@Cedric:~$ cd /media/windata/<br>brian@Cedric:/media/windata$ ./testerlyfoo.py<br>Working!<br>brian@Cedric
:/media/windata$ ./testerlybar.py<br>bash: ./testerlybar.py: /usr/bin/python^M: bad interpreter: No such<br>file or directory</blockquote><div><br>It seems to me that that ^M is your problem although I'm not quite sure where it came from there seems to be an extra character on the end of the copied one. Here's a little test I did:
<br><code><br>#! /bin/py<br>print "What the hell!!"<br></code><br>adam@darkstar:~$ ./test.py<br>-bash: ./test.py: /bin/py: bad interpreter: No such file or directory<br>and there doesn't seem to be any weird thing on the end even though that file doesn't exist.
<br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">brian@Cedric:/media/windata$<br><br>I even retyped the testerlybar.py file, but I end up with the same
<br>results as when the small script was copied and pasted.<br><br>Likewise, I got the same results after saving the two files to my Home<br>directory on the hail mary thought that perhaps the fact I'd save the<br>originals on a FAT32 mounted drive might be making things goofy.
<br><br>I'm stumped. Any steps I can take to work out what's going on?<br><br>Best to all,<br><br>Brian vdB<br>_______________________________________________<br>Tutor maillist - <a href="mailto:Tutor@python.org">Tutor@python.org
</a><br><a href="http://mail.python.org/mailman/listinfo/tutor">http://mail.python.org/mailman/listinfo/tutor</a><br></blockquote></div><br>