This idea requires the software version to be 2.5 or above.
To create a file under the default folder that stores all task program (program), function get_task_path can be used for taking the task path.
In the sample below, a file named 16.txt will be create.
Then the for loop will write number 0 to 10 in the txt file. Each number will be in different row since there also a "\n" written to the txt file.
To read data, use f.read
The sample below will save the data read to variable x.
x = f.read