gpt4 book ai didi

python - 在 Mac 上使用 shebang (#!) 运行 python 64

转载 作者:行者123 更新时间:2023-12-01 06:14:23 33 4
gpt4 key购买 nike

我使用Python 64位如下。

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

如何使用 shebang(#!) 运行 python 64 位模式?

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

最佳答案

在 OS X 10.6 arch 中是 /usr/bin/arch,所以你的行是

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

一般来说,如果您不知道路径,您可以随时在 shebang 中使用 env 命令,如下所示 here ,保证位于 /usr/bin 中。所以,

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

也可以。

关于python - 在 Mac 上使用 shebang (#!) 运行 python 64,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4092497/

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com