2016-03-23 2 views

答えて

3

あなたがオブジェクトファイルではない、サブプロセスのコマンドにファイル名を渡す必要があります。

f = open('/tmp/list.txt','w') 
f.write(list) 
f.close() # Make sure to close the file before call sub-process. 
      # Otherwise, file content will not visible to sub-process. 

process = subprocess.Popen('oscommand --file={}'.format(f.name), 
          shell=True, stdout=subprocess.PIPE) 
関連する問題