mercredi 29 janvier 2020

Make script wait for an input number [duplicate]

When I use i=input nothing happens (no error, the robot just won't read the pressed 1 and go to the first loop). My guess is that input only waits for the user to press enter. Is there an equivalent for the user to press a specific number, to activate the if-loops below?

i=...?

if(i==1)
    current_pose = dType.GetPose(api)
    dType.SetPTPCmdEx(api, 2, x1,  y1,  z1, current_pose[3], 1)
    i=i+1

if(i==2)
    current_pose = dType.GetPose(api)
    dType.SetPTPCmdEx(api, 2, x2,  y2,  z2, current_pose[3], 1)
    i=i-1

Aucun commentaire:

Enregistrer un commentaire