I'm having an issue with running a pretty simple Python script from a Windows batch file.
The Batch Code is:
"C:\Python27\python.exe" "V34_File_Converter.py" %*
pause
where the "V34_File_Converter.py" file is located in the same folder as the batch file.
The Python Code is:
import os,sys
import psse34
import psspy
print('we are in the program')
args_num = len(sys.argv) - 1
psspy.psseinit()
for f_name in sys.argv[1:]:
print f_name
psspy.read(0,f_name)
f_name_out = os.path.splitext(f_name)[0] + "_V34.RAW"
psspy.rawd_2(0,1,[1,1,1,0,0,0,0],0,f_name_out)
The main issue is when I double click the Batch file, the program runs fine, printing the first message and initializing the PSSE program. However, when I drag and drop files onto the batch script, I get the following Error:
C:\Python27\python.exe: can't open file 'V34_File_Converter.py': [Errno 2] No such file or directory
Which is strange, considering it finds that file no problem if no other arguments are passed.
Thanks for any help!