I have a WORKING batch file that I want to execute by my Python program. here is the portion of program related to that task:
def execute_batch_file(self): batch_file_path = r'C:UsersUTENTEDesktopProgrammi compilati PythonOP10prova.bat' subprocess.Popen(batch_file_path, shell=True)
when I run the program I get the error message “Cannot open exaple.prn for reading”.
Again, if I execute the batch file manually I have no issue whatsoever. It does work fine. When I run it by my program I get the message above.
For info, the batch file lunches an “lpr” command for a “.prn” file to be printed.
Any clue about the issue?
Thanks alot.
Nico is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.