Re: Shebang line problems and python

2009-09-17 Thread Blaine
On Sep 16, 9:25 pm, Blaine wrote: > Hello, > > Scripts that have "#!/usr/bin/python" at the top do not parse > correctly. Bash treats scripts with that shebang as if they are bash > scripts. > > E.g.: > bla...@attila ~/apps/rs-mu $ /usr/sbin/env-update > /usr/sbin/env-update: line 6: import: comma

Re: Shebang line problems and python

2009-09-17 Thread Rami Chowdhury
> I think I've discovered the problem. Someone from IRC had directed me > here: http://bugs.gentoo.org/show_bug.cgi?id=279915 I would suggest testing with the Python binary itself in your shebang line (e.g. #!/usr/bin/python2.6, if it's in /usr/bin) to confirm, but that looks like it :-) R

Re: Shebang line problems and python

2009-09-17 Thread Diez B. Roggisch
Blaine schrieb: Hello, Scripts that have "#!/usr/bin/python" at the top do not parse correctly. Bash treats scripts with that shebang as if they are bash scripts. E.g.: bla...@attila ~/apps/rs-mu $ /usr/sbin/env-update /usr/sbin/env-update: line 6: import: command not found /usr/sbin/env-update

Re: Shebang line problems and python

2009-09-16 Thread Blaine
On Sep 16, 9:25 pm, Blaine wrote: > Hello, > > Scripts that have "#!/usr/bin/python" at the top do not parse > correctly. Bash treats scripts with that shebang as if they are bash > scripts. > > E.g.: > bla...@attila ~/apps/rs-mu $ /usr/sbin/env-update > /usr/sbin/env-update: line 6: import: comma

Re: Shebang line problems and python

2009-09-16 Thread Johan Grönqvist
Blaine skrev: I'm not sure if there is a Ctrl+Z in here... but, here's the output: bla...@attila ~/tmp $ hexdump shebang-test 000 2123 752f 7273 622f 6e69 702f 7479 6f68 010 0a6e 6d69 6f70 7472 7320 7379 730a 7379 020 732e 6474 756f 2e74 7277 7469 2865 4822 030 6c65 6f6c 202c 6f7

Re: Shebang line problems and python

2009-09-16 Thread Blaine
On Sep 16, 10:46 pm, Steven D'Aprano wrote: > On Wed, 16 Sep 2009 21:35:21 -0700, Blaine wrote: > > bla...@attila ~/tmp $ cat ./shebang-test > > #!/usr/bin/python > > import sys > > sys.stdout.write("Hello, world.\n") > > bla...@attila ~/tmp $ ./shebang-test > > ./shebang-test: line 2: import: com

Re: Shebang line problems and python

2009-09-16 Thread km
assuming that ur on linux/unix and assuming that u have shebang line as #!/usr/bin/python in ur script set permissions like this chmod 755 myscript.py and then run the script as ./myscripy.py OR simply run the python script as "python myscript.py" at the shell prompt (note that this doesnt need she

Re: Shebang line problems and python

2009-09-16 Thread Steven D'Aprano
On Wed, 16 Sep 2009 21:35:21 -0700, Blaine wrote: > bla...@attila ~/tmp $ cat ./shebang-test > #!/usr/bin/python > import sys > sys.stdout.write("Hello, world.\n") > bla...@attila ~/tmp $ ./shebang-test > ./shebang-test: line 2: import: command not found ./shebang-test: line > 3: syntax error near

Re: Shebang line problems and python

2009-09-16 Thread Blaine
Chris Rebert, Rami Chowdhury: bla...@attila ~/tmp $ which python /usr/bin/python Ben Finney: bla...@attila ~/tmp $ echo $SHELL /bin/bash bla...@attila ~/tmp $ cat ./shebang-test #!/usr/bin/python import sys sys.stdout.write("Hello, world.\n") bla...@attila ~/tmp $ ./shebang-test ./shebang-test: li

Re: Shebang line problems and python

2009-09-16 Thread Ben Finney
Blaine writes: > Scripts that have "#!/usr/bin/python" at the top do not parse > correctly. Bash treats scripts with that shebang as if they are bash > scripts. When you run a file as a command, it's not Bash that decides how to run it; the kernel has the job of understanding how to run the prog

Re: Shebang line problems and python

2009-09-16 Thread Rami Chowdhury
Is it possible that python is installed not in /usr/bin but in, say, / usr/local/bin? I'd suggest you try 'which python' to find out where it is. On my OS X, for instance: $ which python /Library/Frameworks/Python.framework/Versions/Current/bin/python - Rami Chowdhury "Never as

Re: Shebang line problems and python

2009-09-16 Thread Chris Rebert
On Wed, Sep 16, 2009 at 8:25 PM, Blaine wrote: > Hello, > > Scripts that have "#!/usr/bin/python" at the top do not parse > correctly. Bash treats scripts with that shebang as if they are bash > scripts. > > E.g.: > bla...@attila ~/apps/rs-mu $ /usr/sbin/env-update > /usr/sbin/env-update: line 6:

Shebang line problems and python

2009-09-16 Thread Blaine
Hello, Scripts that have "#!/usr/bin/python" at the top do not parse correctly. Bash treats scripts with that shebang as if they are bash scripts. E.g.: bla...@attila ~/apps/rs-mu $ /usr/sbin/env-update /usr/sbin/env-update: line 6: import: command not found /usr/sbin/env-update: line 8: syntax e