Read from txt file
Posted: 14 May 2022, 10:16
Hi, i want to move robot by reading from txt file with python. How can i do that?
Discussions and questions about CoppeliaSim
http://forum.coppeliarobotics.com/
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
Code: Select all
#python
def sysCall_thread():
with open('file.txt','rt') as f:
for line in f:
print(line)