Re: [Tutor] problems with the shebang line and linux

2006-02-17 Thread Alan Gauld
> Try this with the file > > vi filename > escape > :%s/^M// > Or just run the dos2unix command that comes with most Linux distros... Or even use Python to write a script to strip() each line and write it back with a \n... In fact there's a prewritten script called crlf.py in the Tools folder

Re: [Tutor] problems with the shebang line and linux

2006-02-17 Thread Brian van den Broek
Thanks to all for the replies. Indeed, it must have been the DOS vs. Unix line terminators as several people suggested. A couple of comments in-line below. Roel Schroeven said unto the world upon 16/02/06 11:14 AM: >>On 16/02/06, *Brian van den Broek* <[EMAIL PROTECTED] >>

Re: [Tutor] problems with the shebang line and linux

2006-02-17 Thread Roel Schroeven
Adam schreef: > > > On 16/02/06, *Brian van den Broek* <[EMAIL PROTECTED] > > wrote: > > [EMAIL PROTECTED]:~$ which python > /usr/bin/python > [EMAIL PROTECTED]:~$ cd /media/windata/ > [EMAIL PROTECTED]:/media/windata$ ./testerlyfoo.py > Working! >

Re: [Tutor] problems with the shebang line and linux

2006-02-17 Thread Adam
On 16/02/06, David Rock <[EMAIL PROTECTED]> wrote: * Adam <[EMAIL PROTECTED]> [2006-02-16 14:23]:> On 16/02/06, Brian van den Broek <[EMAIL PROTECTED]> wrote: >> 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 e

Re: [Tutor] problems with the shebang line and linux

2006-02-16 Thread Nick Lunt
; To: Brian van den Broek; Tutor > Subject: Re: [Tutor] problems with the shebang line and linux > > > Hi Brian, > > it's the ^M characters that are catching you out here. > > Often files from a windows PC will have ^M as the newline char when viewed > in linux/unix

Re: [Tutor] problems with the shebang line and linux

2006-02-16 Thread Nick Lunt
Hi Brian, it's the ^M characters that are catching you out here. Often files from a windows PC will have ^M as the newline char when viewed in linux/unix. On linux you should be able to check if a file has ^M in by running either 'vi -b filename' or 'sed -n l filename'. Try this with the file

Re: [Tutor] problems with the shebang line and linux

2006-02-16 Thread Python
On Thu, 2006-02-16 at 07:36 -0600, Brian van den Broek wrote: > Hi all, > > I've switched to Linux fairly recently and am still at the fumbling > about stage :-) I'm having a devil of a time with the shebang line > and running a py file from a command line. > The file has dos/windows format wi

Re: [Tutor] problems with the shebang line and linux

2006-02-16 Thread Tiago Saboga
Em Qui 16 Fev 2006 12:23, Adam escreveu: > > [EMAIL PROTECTED]:/media/windata$ ./testerlybar.py > > bash: ./testerlybar.py: /usr/bin/python^M: bad interpreter: No such > > file or directory > > It seems to me that that ^M is your problem although I'm not quite sure > where it came from there seems

Re: [Tutor] problems with the shebang line and linux

2006-02-16 Thread David Rock
* Adam <[EMAIL PROTECTED]> [2006-02-16 14:23]: > On 16/02/06, Brian van den Broek <[EMAIL PROTECTED]> wrote: > > 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

Re: [Tutor] problems with the shebang line and linux

2006-02-16 Thread Brian van den Broek
[EMAIL PROTECTED] said unto the world upon 16/02/06 08:22 AM: >>>bash: ./testerlybar.py: /usr/bin/python^M: bad interpreter: No such > > file or directory [EMAIL PROTECTED]:/media/windata$ > > Note the ^M the additional fileformat character inserted. That is > causing the problem. > > Instead o

Re: [Tutor] problems with the shebang line and linux

2006-02-16 Thread Senthil_OR
>> bash: ./testerlybar.py: /usr/bin/python^M: bad interpreter: No such file or directory [EMAIL PROTECTED]:/media/windata$ Note the ^M the additional fileformat character inserted. That is causing the problem. Instead of copying and pasting try to use cp file1 file2. Else, open the copied file a

Re: [Tutor] problems with the shebang line and linux

2006-02-16 Thread Adam
On 16/02/06, Brian van den Broek <[EMAIL PROTECTED]> wrote: Hi all,I've switched to Linux fairly recently and am still at the fumblingabout stage :-)  I'm having a devil of a time with the shebang lineand running a py file from a command line.I wrote the following little test script with IDLE 1.1.