I am trying to create a flow in PAD where an user have to answer some questions from Display Input Dialog. Those questions are saved in variables and then I use the variables as arguments to run a python script (I call the variables in my python script with variableA=sys.argv[1] for example).
As PAD does not support python 3, I run my script through Run PowerShell script, calling directly the environment of my python and the path to the script:
& "C:\Users\myname\anaconda3\python.exe" "C:\Users\myname\location1\location2\scriptPAD.py" "%variableA%" "%variableB%" "%variableC%" .
Also, as you can see, I placed the name of the variables at the end of the script to connect them with the sys.argv from my python code.
So the code was giving me an empty list as output, then I decided to get the output out in a txt format by inserting few lines in my python script:
final_output = process_code(....., ....., .....)
output_file_path= r"C:\Users\myname\location1\location2\python_output.txt"
with open(output_file_path, 'w') as file:
for match in final_output:
file.write(str(match) + '\n')
The goal was that after running the PowerShell, I would run Read text from file in PAD and it will get the results from the python script through the text file. However, the output of the Read text from file is that it cannot find the file. And certainly the code did not create the file at my location.... The weird thing is, if I run the same code in Visual Code (including the variables: "%variableA%" "%variableB%" "%variableC%"), the python code works fine and it also create the txt file in my location. So I am guessing that the problem is that the Run PowerShell script is not doing properly the job when reading the python script??
Does anyone have any suggestion what is going on here?