finallyliuyu
1.shell调用py脚:
比如我有个py:
import sys
for i in sys.stdin:
    print i
我用shell调用直接写就行:echo \'asdfadsf\' | ./test.py


2.python调用shell
import os,commands
os.system(\'cp a.txt b.txt\')#只调用不返回
commands.getoutput(\'ls -al\')#调用返回值

分类:

技术点:

相关文章:

  • 2021-12-16
  • 2022-02-14
  • 2021-12-27
  • 2021-11-20
  • 2021-11-30
  • 2021-11-30
  • 2021-11-20
猜你喜欢
  • 2021-05-16
  • 2021-08-05
  • 2021-10-05
  • 2022-12-23
  • 2022-12-23
  • 2021-10-19
  • 2021-11-30
相关资源
相似解决方案