![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Unknown
Join Date: Apr 2008
Location: unknown
Posts: 87
Rep Power: 1
![]() |
what is the purpose of '#!/usr/bin/env python'
i tried to run it in a interactive interpreter then it works like a comment but when i run it as a program all it does is to 'restart'? what does this mean? thanks
__________________
------------------------------------------------------------------------- I thought what I'd Do was, I'd pretend to be one of those deaf mutes ------------------------------------------------------------------------ |
|
|
|
|
|
#2 |
|
Newbie
Join Date: Apr 2008
Posts: 10
Rep Power: 0
![]() |
Re: what is the purpose of '#!/usr/bin/env python'
#!/whatever just tells the shell you're using to execute that interpreter for that file. it's the shell that interprets the #!/whatever, not python.
|
|
|
|
|
|
#3 |
|
Software Developer
Join Date: Jun 2008
Posts: 4
Rep Power: 0
![]() |
Re: what is the purpose of '#!/usr/bin/env python'
Specifically that refers to the linux interpreter, I'm not so sure that would be right under windows for instance.
usually what you do under linux is specify that in the first line and then assign the script executable permissions, then it can be run without specifying the interpreter in the command line e.g: :~$ python scriptname.py Mike
__________________
There are 10 kinds of people in this world....Those who understand binary and those who don't. |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Perfect Python | Dietrich | Python | 30 | Jan 5th, 2007 1:38 PM |
| [tutorial] Python for programming beginners | coldDeath | Python | 30 | Dec 14th, 2005 12:35 PM |
| Convert Python script to C++ code | clanotheduck | Python | 17 | Sep 25th, 2005 9:55 AM |
| Advanced Python Tricks | Arevos | Python | 19 | Sep 24th, 2005 8:39 AM |
| Python - A Programmers Introduction | coldDeath | Python | 17 | Aug 19th, 2005 1:41 PM |