python - 如何在单个包装脚本中包含和运行所有 python 脚本
问题描述
我有一些 12 个 python 脚本,我分别执行它们现在我想将这 12 个脚本包含在单个 shell 包装器中,并希望运行这个可以一次执行所有 12 个的包装器。我已经尝试了下面的简单外壳,但无法执行它
#!/bin/bash
/home/<user>/serverlist.py
/home/<user>/cluster.py
/home/<user>/listApps.py
`
[root@bin]# ./wsadmin.sh -lang jython -f /home/Devop/wrapper.py
WASX7209I: Connected to process "server1" on node localhostNode02 using SOAP connector; The type of process is: UnManagedProcess
WASX7017E: Exception received while running file "/home/Devop/wrapper.py"; exception information: com.ibm.bsf.BSFException: exception from Jython:
Traceback (innermost last):
(no code object) at line 0
File "<string>", line 3
sh "./home/Devop/listApps.py"
^
SyntaxError: invalid syntax`
I am getting this syntax error
解决方案
#!/bin/bash
python3 /home/<user>/serverlist.py #or just python
python3 /home/<user>/cluster.py
python3 /home/<user>/listApps.py
推荐阅读
- java - Gradle 依赖项:配置具有相互依赖关系的多模块构建
- php - 即使永久链接被刷新,Wordpress 帖子类型存档也无法正常工作
- java - 如何使用内容uri检查文件是否存在
- javascript - 在 NodeJs/Express 应用程序中运行耗时任务
- javascript - Angular:Nodemailer 显示很多运行时错误
- java - 多次初始化的静态最终字段
- php - 如何从 php 中的变量中删除逗号,以便将其保存为浮点值?
- python - 可以将 python 类声明为与另一个类具有相同的 __init__() 签名(包括默认值)?
- swift - 如何在 Alamofire API 请求的主体中发送嵌套对象?
- python - 在二维数组中查找大于 0 的最小值。Python