You are not logged in.

#1 2012-02-01 16:36:10

chessmaster
Member
From: Dover,DE
Registered: 2011-12-10
Posts: 30

(Solved)changing python #!/usr/bin/env python

https://wiki.archlinux.org/index.php/Python


I have read the wiki. But, my understanding on how this works is confusing me. Where would I make this change if I have a program that needs this version of python. Anyone care to elaborate on the "shebang"? Thanks!!!!

Last edited by chessmaster (2012-02-01 17:51:57)


When you see a good move, wait — look for a better one.

Offline

#2 2012-02-01 16:55:18

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: (Solved)changing python #!/usr/bin/env python

It's the first line of the script, open it in a text editor.

[karol@black scripts]$ head bigpac 
#!/usr/bin/env python
#
#   bigpkg : find packages that require a lot of space on your system
#   v0.3.0 (2011-06-21)
#
#   Copyright (c) 2009-2011 by Allan McRae <allan@archlinux.org>
#
#   This program is free software; you can redistribute it and/or modify
#   it under the terms of the GNU General Public License as published by
#   the Free Software Foundation; either version 2 of the License, or

'shebang' is the '#!', that's how you pronounce it.

Last edited by karol (2012-02-01 16:57:26)

Offline

#3 2012-02-01 16:56:46

marxav
Member
From: Gatineau, PQ, Canada
Registered: 2006-09-24
Posts: 386

Re: (Solved)changing python #!/usr/bin/env python

At the very beginning of your python file.  That's where the shebang goes.

#!/usr/bin/env python for python 3
#!/usr/bin/env python2 for python 2.X

Offline

#4 2012-02-01 17:51:37

chessmaster
Member
From: Dover,DE
Registered: 2011-12-10
Posts: 30

Re: (Solved)changing python #!/usr/bin/env python

karol wrote:

It's the first line of the script, open it in a text editor.

[karol@black scripts]$ head bigpac 
#!/usr/bin/env python
#
#   bigpkg : find packages that require a lot of space on your system
#   v0.3.0 (2011-06-21)
#
#   Copyright (c) 2009-2011 by Allan McRae <allan@archlinux.org>
#
#   This program is free software; you can redistribute it and/or modify
#   it under the terms of the GNU General Public License as published by
#   the Free Software Foundation; either version 2 of the License, or

'shebang' is the '#!', that's how you pronounce it.

Okay thanks!!! I understand now. So when ever I see this at the begining I can just change it to python2.


When you see a good move, wait — look for a better one.

Offline

Board footer

Powered by FluxBB