diff options
Diffstat (limited to 'src/converter/libConverter.py')
-rw-r--r-- | src/converter/libConverter.py | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/converter/libConverter.py b/src/converter/libConverter.py index 617c72c2..3c30f7d3 100644 --- a/src/converter/libConverter.py +++ b/src/converter/libConverter.py @@ -22,11 +22,16 @@ class PspiceLibConverter: # Construct the full path to libParser.py parser_path = os.path.join(script_dir, relative_parser_path) - print(parser_path) - command = f"cd {parser_path} ; python3 libParser.py {file_path}" - print(f"cd {parser_path} ; python3 libParser.py {file_path}") + print("Parser Path:",parser_path) + + # Prepare the command as a list + output_dir = os.path.dirname(file_path) + + command = ["python3", "libparser.py", file_path, output_dir] + print(f"Running command: {' '.join(command)} in directory: {parser_path}") + try: - subprocess.run(command, shell=True, check=True) + subprocess.run(command, check=True, cwd=parser_path) # Message box with the conversion success message msg_box = QMessageBox() msg_box.setIcon(QMessageBox.Information) @@ -81,4 +86,4 @@ class PspiceLibConverter: msg_box.setWindowTitle("No File Selected") msg_box.setText("Please select a file before uploading.") msg_box.setStandardButtons(QMessageBox.Ok) - msg_box.exec_()
\ No newline at end of file + msg_box.exec_() |