00问答网
所有问题
shell脚本中怎么调用python脚本中的带参函数
如题所述
举报该问题
推荐答案 2017-02-28
# python脚本 test.py
# coding: utf-8
import sys
def print_data(a, b, c):
print a, b, c
if __name__ == "__main__":
print_data(sys.argv[1], sys.argv[2], sys.argv[3])
# shell 脚本
python test.py a b c
# 结束
a b c
温馨提示:答案为网友推荐,仅供参考
当前网址:
http://00.wendadaohang.com/zd/DIjDnTZIZZZrZ0ZDZnT.html
相似回答
大家正在搜
相关问题
shell脚本中怎么调用python脚本中的带参函数
shell脚本中怎么调用python脚本中的带参函数
shell脚本中怎么调用python脚本中的带参函数
shell脚本中怎么调用python脚本中的带参函数
shell脚本中怎么调用python脚本中的带参函数
python脚本怎样调用python脚本
python脚本中怎么调用shell命令
怎样才能让python 脚本像shell命令一样直接运行并可...