get_file_path.py
import os
import sys
def get_file_exr(path):
mpth=path.replace("\\",'/')
#print mpth
mroot=os.listdir(mpth)
m_file_list=[]
for f in mroot:
name,ext=os.path.splitext(f)
if ext==".exr":
mfp=os.path.join(mpth,f)
mfp=mfp.replace("\\",'/')
print mfp
m_file_list.append(mfp)
#print m_file_list
return m_file_list
path=sys.argv
print path
path=sys.argv[1]
get_file_exr(path)
执行python [get_file_path.py] [path] 即可。
通过result = subprocess.Popen(cmd,shell=True,stdout = subprocess.PIPE, stderr = subprocess.STDOUT)
可以获取后台屏幕的内容来使用。