HI ,
I am trying to call a external python script using run command in Python too.
This command is working fine in interactive mode but failing with invalid syntax when i switch to production mode and run the workflow .
Can i run the workflow from gallery keeping scripts in shared drive ?
Appreciate if anyone has solution to fix this.
interactive Mode
Production mode
Solved! Go to Solution.
Production mode converts your Jupyter Notebook into a Python script that is executed directly against the command line. Thus, Jupyter Magics, such as %run will not work.
In the .py file you want to run, I recommend reorganizing your code into a function which you can then call with Alteryx.importPythonModule, where yourFunction() is the function in file.py that you would like to call
py_script = Alteryx.importPythonModule("file.py")
py_script.yourFunction()
Thanks AndrewKrammer, I am able call python script as explained