For Real CS robot
CS robot runs in real time on the A9 platform. General users can see and read-write files on x86 platforms.
A9 and x86 platform make a share folder for user to read-write files.
This share folder is locate at x86 platform /home/elite/user/program, that is, when users save file in this folder, the file can be shared synchronously to the A9 platform /rbctrl/EliRobot_share/program/
For example, user want to read and write the 16.txt file in the robot script from /home/elite/user/program, can use this code. After running this code, user can see 16.txt is changed from /home/elite/user/program ( /home/elite/user/program is default robot file save address)
with open('/rbctrl/EliRobot_share/program/16.txt') as f:
for i in range(0,10):
f.write(str(i)+"\n")
For the simulator
The read-write file is locate at EliServer folder, can use this kind of code:
with open('18.txt',"w") as f:
f.write('helo')
for i in range(0,10):
f.write(st