linux中sh与py文件的相互调用关系
Linux Python shell 执行文件之间的文件调用在shell sh 调用pycallpy.sh:#!/bin/bashecho 'start call py'./frompy.pyecho 'end call py'frompy.py:#!/usr/bin/pythonprint "from python"在Python py中调用shcallsh.py:#!/usr/bin
·
Linux Python shell 执行文件之间的文件调用
在shell sh 调用py
callpy.sh:
#!/bin/bash
echo 'start call py'
./frompy.py
echo 'end call py'
frompy.py:
#!/usr/bin/python
print "from python"
在Python py中调用sh
callsh.py:
#!/usr/bin/python
import sys
import os
print "start call sh file"
os.system('./fromsh.sh')
print "end call sh file"
fromsh.sh:
#!/bin/bash
echo "from sh file "
更多推荐
已为社区贡献1条内容
所有评论(0)