执行python2的python3中系统os的python问题

时间:2020-05-21 22:41:36

标签: python-3.x windows python-2.7 system

当我尝试执行以下代码时:

#!/usr/bin/env python3

import os

commant_python_file = 'python2 C:\\EMAN2\\bin\\e2pdb2mrc.py'

def pdb2mrc(pdb_file, resolution):

    call= commant_python_file + " -R "+str(resolution)+" "+str(pdb_file)+" salida.mrc" + " > NUL: "
    print(call)
    os.system(call)

pdb2mrc("PDB_exist/6yif_A.pdb",5)    

它会产生以下错误:


pythone C:\EMAN2\bin\e2pdb2mrc.py -R 5 PDB_exist/6yif_A.pdb salida.mrc > NUL: 
  File "C:\Users\HP\AppData\Local\Programs\Python\Python38\lib\site.py", line 178
    file=sys.stderr)
        ^
SyntaxError: invalid syntax

有人知道为什么吗?

0 个答案:

没有答案
相关问题