mirror of https://github.com/QMCPACK/qmcpack.git
32 lines
827 B
Python
Executable File
32 lines
827 B
Python
Executable File
#!/usr/bin/env python3
|
|
|
|
import sys,os
|
|
nexus_lib = os.path.join(os.path.dirname(__file__), '../nexus/lib')
|
|
sys.path.append(nexus_lib)
|
|
try:
|
|
from pseudopotential import GaussianPP
|
|
except:
|
|
print('Nexus must be installed to run this script.\nExpected Nexus library at {}'.format(nexus_lib))
|
|
sys.exit(1)
|
|
#end try
|
|
|
|
executable_name = sys.argv[0]
|
|
if len(sys.argv)<2:
|
|
print('Usage:\n{} <gamess-input-pp>'.format(executable_name))
|
|
sys.exit(2)
|
|
#end if
|
|
|
|
for filepath in sys.argv[1:]:
|
|
path,filename = os.path.split(filepath)
|
|
if '.' in filename:
|
|
fn,ext = filename.rsplit('.',1)
|
|
if ext in ('gms','gamess'):
|
|
filename = fn
|
|
#end if
|
|
#end if
|
|
filename += '.xml'
|
|
pp = GaussianPP(filepath,format='gamess')
|
|
pp.write(os.path.join(path,filename),format='qmcpack')
|
|
#end for
|
|
|