Read from txt file
Read from txt file
Hi, i want to move robot by reading from txt file with python. How can i do that?
Re: Read from txt file
Code: Select all
#python
from zmqRemoteApi import RemoteAPIClient
client = RemoteAPIClient()
sim = client.getObject('sim')
with open('file.txt','rt') as f:
for line in f:
# do something with line
# e.g. parse value then call sim.setJointTargetPosition
Re: Read from txt file
Or, from within CoppeliaSim:
Cheers
Code: Select all
#python
def sysCall_thread():
with open('file.txt','rt') as f:
for line in f:
print(line)