-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCmdChoice.py~
33 lines (25 loc) · 1.28 KB
/
CmdChoice.py~
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#! /usr/bin/env python
#coding=utf-8
from PathInit import *
from XmlCreate import *
import os
import subprocess
#调用不同的分子计算符软件进行分子描述符计算参数分别为DRAGON,GAUSSIAN,MOPAC
globalpath='/home/est863/Desktop/sytmac/'
class CmdChoice():
def __init__(self):
self.parse=ParseInitPath(globalpath+'InitPath.xml')
#得到各个分子计算符软件的路径,进行命令行操作
def PathChoiceAndExecute(self,cmd,filePath):
#dragon的filepath是xmlCreate生成的xml路径,默认在此文件夹中
if cmd=='DRAGON':
self.PATH=self.parse.get_xml_data(globalpath+'InitPath.xml''InitPath.xml','DRAGON')
#进入针对xml解析的计算分子描述符原始文件的路径,进行计算
if cmd=='MOPAC':
self.PATH=self.parse.get_xml_data(globalpath+'InitPath.xml','MOPAC')
#进入针对xml解析的计算分子描述符原始文件的路径,进行计算
if cmd=='GAUSSIAN':
self.PATH=self.parse.get_xml_data(globalpath+'InitPath.xml','GAUSSIAN')
#进入针对xml解析的计算分子描述符原始文件的路径,进行计算
Cmd=self.PATH+filePath
subprocess.Popen(Cmd,shell=True)