3

I want define a path using the looping variable like this:

for i in range(2,4):
    click("1480530304554.png")
    wait("1480531095180.png")   
    type("cd D:\ISB\Pairs\" + str(i) + "\Acq\" + Key.ENTER)

This typecasting does not work in Sikuli which supports jython. Error is:

SyntaxError ( "no viable alternative at input 'cq'", )

Whats the way around this?

user248884
  • 851
  • 1
  • 11
  • 21

2 Answers2

2

In Windows systems, to define a path you must use double backslash. This will do what you need:

type("cd D:\\ISB\\Pairs\\" + str(i) + "\\Acq\\" + Key.ENTER)
Eugene S
  • 6,709
  • 8
  • 57
  • 91
1

I think you should use double backslash \\ or / instead of backslash \ Single backslash is an escape character

Ngo Thanh Nhan
  • 503
  • 2
  • 5
  • 17