prosseek
prosseek

Reputation: 190799

Running python 64 with shebang (#!) on Mac

I use python 64bit as follows.

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

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

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

Upvotes: 1

Views: 636

Answers (2)

Muhammad Alkarouri
Muhammad Alkarouri

Reputation: 24662

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.

Upvotes: 1

Paulo Scardine
Paulo Scardine

Reputation: 77251

#!/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

Upvotes: 1

Related Questions