Excuse me, i’m going to use you thread to ask the same exact question.
I need to call a python script but it doesnt work.
I made a test script with output 5 random numbers:
3
5
7
1
6
i need those numbers to be writen to a file.csv so kantu can read those numbers by reading the csv file.
When i try the script on the command line all is ok
c:\python\scripts\testkantu.py > test.csv
The csv file is created with the 5 random numbers
But when i use xrun to call the script
kantu finish without error but the file is not created, also the python script can use a seed to generate the numbers, like testkantu.py 5 if i want the seed to be a variable can i use
“Value”: “${seed} > test.csv”?
so the line is c:\python\scripts\testkantu.py 5 > test.csv
# XRUN Python V1.0
import sys
#get command line value
i = int (sys.argv[1])
#Square it!
i = i * i
# exit code in Python (limited to value between 0...255)
sys.exit(i)
Thank you for your help, but calling the python script is not my issue, i used the thread, but my problem is i need the output from the python script to be saved into a csv so i can process it later,
1 i get data from web
2 i process the data with python and get a csv
3 i read the csv and
4 do funny things.
XRunAndWait is no shell command line. You can not use operators like “>”. The solution is to code the “write to CSV” inside the Python itself. The job of XRunAndWait is only to start the script.