开发者

Running python 64 with shebang (#!) on Mac

开发者 https://www.devze.com 2023-01-23 04:30 出处:网络
I use python 64bit as 开发者_如何学Gofollows. alias python64=\'arch -x86_64 /usr/bin/python2.6\'

I use python 64bit as 开发者_如何学Gofollows.

alias python64='arch -x86_64 /usr/bin/python2.6'

How can I run python 64bit mode with shebang(#!)?

??? #!/usr/bin/python2.6 ???


In OS X 10.6 arch is /usr/bin/arch, so your line is

#!/usr/bin/arch -x86_64 /usr/bin/python2.6

In general, if you don't know the path you can always use the env command in the shebang as shown here, which is guaranteed to be in /usr/bin. So,

#!/usr/bin/env arch -x86_64 /usr/bin/python2.6

will also work.


#!/path/to/arch -x86_64 /usr/bin/python2.6

I dont have a mac to test right now, but usually in *nix you can find the path to an executable using:

which arch
0

精彩评论

暂无评论...
验证码 换一张
取 消