Re: [Tutor] python scripting using "./"

2011-05-25 Thread Wolf Halton
An oddity of the PATH variable in Linux (or at least Ubuntu) is that there is a folder in PATH called /home/~/bin. The ~ is replaced with your profile name. If you create that folder and put the file into it, you can invoke it from anywhere in the filesystem with just its name. On Tue, May 24, 2

Re: [Tutor] python scripting using "./"

2011-05-24 Thread Walter Prins
Hi Hank, On 24 May 2011 15:15, Hank Wilkinson wrote: > Yes, I would love to know why it doesn't work, or what I'm doing wrong. > > John-Wilkinsons-iMac:p31summerfield wilkinson$ cat hello.py > #!/usr/bin/env python > > print("Hello world") > John-Wilkinsons-iMac:p31summerfield wilkinson$ chmod +

Re: [Tutor] python scripting using "./"

2011-05-24 Thread Hank Wilkinson
Yes, I would love to know why it doesn't work, or what I'm doing wrong. John-Wilkinsons-iMac:p31summerfield wilkinson$ cat hello.py #!/usr/bin/env python print("Hello world") John-Wilkinsons-iMac:p31summerfield wilkinson$ chmod +X hello.py John-Wilkinsons-iMac:p31summerfield wilkinson$ ./hello.py

Re: [Tutor] python scripting using "./"

2011-05-24 Thread Walter Prins
On 24 May 2011 14:51, Hank Wilkinson wrote: > Thank you, I changed the first line to: > #!/usr/bin/env/python3 > then I tried again: > John-Wilkinsons-iMac:p31summerfield wilkinson$ ./hello.py > -bash: ./hello.py: /usr/bin/env/python3^M: bad interpreter: Not a directory > John-Wilkinsons-iMac:p31

Re: [Tutor] python scripting using "./"

2011-05-24 Thread Walter Prins
On 24 May 2011 14:53, Hank Wilkinson wrote: > Thank you. > John-Wilkinsons-iMac:p31summerfield wilkinson$ which python > /opt/local/bin/python > > OK excellent.So you can either use '#!/opt/local/bin/python' in your script, or alternatively '/usr/bin/env python' (presuming that you have 'env'

Re: [Tutor] python scripting using "./"

2011-05-24 Thread Hank Wilkinson
Thank you. John-Wilkinsons-iMac:p31summerfield wilkinson$ which python /opt/local/bin/python On May 24, 2011, at 9:27 AM, Walter Prins wrote: > The problem likely is as intimated by the error message that your python > interpreter not called "/usr/local/bin/python3.1" but I'd offhand guess, >

Re: [Tutor] python scripting using "./"

2011-05-24 Thread Hank Wilkinson
to... > > #!/usr/local/bin/python3 > > ...you should get along much better! :) > > S. > > -Original Message- > From: Hank Wilkinson [mailto:hwilkin...@triad.rr.com] > Sent: Tuesday, May 24, 2011 2:25 PM > To: Flynn, Stephen (L & P - IT) > Cc: t

Re: [Tutor] python scripting using "./"

2011-05-24 Thread Peter Otten
Hank Wilkinson wrote: > I am trying to do script in python using "./" > Here is a session showing "bad interpreter: No such file or directory" > Is this a python question/problem? It's a bash problem. The shell cannot cope with Windows line endings: ^M in the error message stands for chr(13) or

Re: [Tutor] python scripting using "./"

2011-05-24 Thread Christian Witts
On 2011/05/24 03:10 PM, Hank Wilkinson wrote: I am trying to do script in python using "./" Here is a session showing "bad interpreter: No such file or directory" Is this a python question/problem? Last login: Sat May 21 14:22:49 on ttys000 John-Wilkinsons-iMac:~ wilkinson$ cd /Users/wilkinson/

Re: [Tutor] python scripting using "./"

2011-05-24 Thread Flynn, Stephen (L & P - IT)
From: Hank Wilkinson [mailto:hwilkin...@triad.rr.com] Sent: Tuesday, May 24, 2011 2:25 PM To: Flynn, Stephen (L & P - IT) Cc: tutor@python.org Subject: Re: [Tutor] python scripting using "./" John-Wilkinsons-iMac:p31summerfield wilkinson$ ls -al /usr/local/bin/python ls: /usr

Re: [Tutor] python scripting using "./"

2011-05-24 Thread Joel Goldstick
On Tue, May 24, 2011 at 9:10 AM, Hank Wilkinson wrote: > I am trying to do script in python using "./" > Here is a session showing "bad interpreter: No such file or directory" > Is this a python question/problem? > > Last login: Sat May 21 14:22:49 on ttys000 > John-Wilkinsons-iMac:~ wilkinson$ cd

Re: [Tutor] python scripting using "./"

2011-05-24 Thread Hank Wilkinson
capita.co...@python.org > [mailto:tutor-bounces+steve.flynn=capita.co...@python.org] On Behalf Of > Hank Wilkinson > Sent: Tuesday, May 24, 2011 2:10 PM > To: tutor@python.org > Subject: [Tutor] python scripting using "./" > > I am trying to do script in python using "

Re: [Tutor] python scripting using "./"

2011-05-24 Thread Hank Wilkinson
inal Message- > From: tutor-bounces+steve.flynn=capita.co...@python.org > [mailto:tutor-bounces+steve.flynn=capita.co...@python.org] On Behalf Of > Hank Wilkinson > Sent: Tuesday, May 24, 2011 2:10 PM > To: tutor@python.org > Subject: [Tutor] python scripting using "./" &

Re: [Tutor] python scripting using "./"

2011-05-24 Thread Walter Prins
The problem likely is as intimated by the error message that your python interpreter not called "/usr/local/bin/python3.1" but I'd offhand guess, probably "/usr/local/bin/python". (Indeed, you run the interpreter yourself as "python" not "python3.1" so you should not be using "python3.1" in your s

Re: [Tutor] python scripting using "./"

2011-05-24 Thread Flynn, Stephen (L & P - IT)
tho*'... S. -Original Message- From: tutor-bounces+steve.flynn=capita.co...@python.org [mailto:tutor-bounces+steve.flynn=capita.co...@python.org] On Behalf Of Hank Wilkinson Sent: Tuesday, May 24, 2011 2:10 PM To: tutor@python.org Subject: [Tutor] python scripting using "./&qu

[Tutor] python scripting using "./"

2011-05-24 Thread Hank Wilkinson
I am trying to do script in python using "./" Here is a session showing "bad interpreter: No such file or directory" Is this a python question/problem? Last login: Sat May 21 14:22:49 on ttys000 John-Wilkinsons-iMac:~ wilkinson$ cd /Users/wilkinson/Documents/py32/p31summerfield John-Wilkinsons-iM

Re: [Tutor] Python scripting

2007-09-08 Thread Alan Gauld
"Ryan" <[EMAIL PROTECTED]> wrote >I am on a linux machine and I was wondering about python scripting. Python is usually installed on linux. Just type python at a shell prompt. > Mainly to get it up and running but also what can I do with > it etc. Any help would be appreciated, Thnx Python

[Tutor] Python scripting

2007-09-07 Thread Ryan
I am on a linux machine and I was wondering about python scripting. Mainly to get it up and running but also what can I do with it etc. Any help would be appreciated, Thnx ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/t

Re: [Tutor] Python Scripting

2005-01-22 Thread Danny Yoo
On Sat, 22 Jan 2005, Ali Polatel wrote: >I want to ask you something that I am really curious about. >Can I design web-pages with python or use py files to write html? Hi Ali, Almost every programming language allows us to write strings into files, so from an academic standpoint, 'yes

[Tutor] Python Scripting

2005-01-22 Thread Ali Polatel
   Hi all tutors,    I want to ask you something that I am really curious about.    Can I design web-pages with python or use py files to write html?    if the answer is yes and if I upload some scripts to the web-site with* .py    does someone have to ahve python interepreter in his computer to b