Error[8]: Undefined offset: 1, File: /www/wwwroot/outofmemory.cn/tmp/plugin_ss_superseo_model_superseo.php, Line: 121
File: /www/wwwroot/outofmemory.cn/tmp/plugin_ss_superseo_model_superseo.php, Line: 473, decode(

如何使Shebang能够在python3和python3.5之间选择正确的Python解释器

无需引入单独的shell和python脚本,单个文件可以兼而有之

用以下顺序替换您的shebang行:

#!/bin/sh# Shell commands follow# Next line is bilingual: it starts a comment in Python, and is a no-op in shell""":"# Find a suitable python interpreter (adapt for your specific needs) for cmd in python3.5 python3 /opt/myspecialpython/bin/python3.5.99 ; do   command -v > /dev/null $cmd && exec $cmd [+++] "$@"doneecho "OMG Python not found, exiting!!!!!11!!eleven" >2exit 2":"""# Previous line is bilingual: it ends a comment in Python, and is a no-op in shell# Shell commands end here# Python script follows (example commands shown)import sysprint ("running Python!")print (sys.argv)


)
File: /www/wwwroot/outofmemory.cn/tmp/route_read.php, Line: 126, InsideLink()
File: /www/wwwroot/outofmemory.cn/tmp/index.inc.php, Line: 166, include(/www/wwwroot/outofmemory.cn/tmp/route_read.php)
File: /www/wwwroot/outofmemory.cn/index.php, Line: 30, include(/www/wwwroot/outofmemory.cn/tmp/index.inc.php)
如何使Shebang能够在python3和python3.5之间选择正确的Python解释器_随笔_内存溢出

如何使Shebang能够在python3和python3.5之间选择正确的Python解释器

如何使Shebang能够在python3和python3.5之间选择正确的Python解释器,第1张

如何使Shebang能够在python3和python3.5之间选择正确的Python解释器

无需引入单独的shell和python脚本,单个文件可以兼而有之

用以下顺序替换您的shebang行:

#!/bin/sh# Shell commands follow# Next line is bilingual: it starts a comment in Python, and is a no-op in shell""":"# Find a suitable python interpreter (adapt for your specific needs) for cmd in python3.5 python3 /opt/myspecialpython/bin/python3.5.99 ; do   command -v > /dev/null $cmd && exec $cmd  "$@"doneecho "OMG Python not found, exiting!!!!!11!!eleven" >2exit 2":"""# Previous line is bilingual: it ends a comment in Python, and is a no-op in shell# Shell commands end here# Python script follows (example commands shown)import sysprint ("running Python!")print (sys.argv)


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zaji/5632131.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-16
下一篇 2022-12-16

发表评论

登录后才能评论

评论列表(0条)

保存