我有一个python脚本准备好了,我需要使用Hudson CI运行。我可以看到配置作业唯一支持的环境是一个可执行的shell。如何在可执行shell (Bash shell)中运行python脚本?有什么想法或建议吗?
发布于 2018-10-10 15:36:48
python3
python3 file.pypython2
python file.py发布于 2018-10-10 15:42:52
除了显而易见的python3 file.py或python file.py之外,还可以通过在顶部引入适当的shebang来使python文件成为可执行文件:
#!/usr/bin/env python3
...
(script follows here)或
#!/usr/bin/env python
...
(script follows here)使用这些,您的CI不需要知道脚本是用python、shell、perl或它使用的任何语言编写的。
https://stackoverflow.com/questions/52734889
复制相似问题