# You may need to import some classes of the controller module. Ex:
# from controller import Robot, Motor, DistanceSensor
from controller import Robot
# create the Robot instance.
robot = Robot()
# get the time step of the current world.
timestep = int(robot.getBasicTimeStep())
while robot.step(timestep) != -1:
robot.step(100) # Webots专用的延时函数单位是毫秒
记录一下方便自己后面万一忘了,来查找
通过阅读controller.py的库文件发现的,网上只找到了C语言的