怎么样在shell脚本中调用python脚本

2025-04-26 20:44:46
推荐回答(2个)
回答1:

直接使用python 后面跟python脚本的文件名就可以

例如:python tr.py就是在shell中执行pr.py这个python脚本,见下图:

回答2:

1、直接执行,其实yum就是个python脚本。
file /usr/bin/yum
/usr/bin/yum: python script text executable
2、例如
#!/bin/sh
./math.py
yum -y install bind-utils