That is Python ;-)
raw strings r"..." cannot have a backslash as last (or only) character.
you should have a look at the os.path module and its features to create
path strings.
but if you want:
backslash = "\\"
IMGFILE=r"C:\Users\boi\Google Drive\Screenshots\SymbolsWD\log" + backslash
** Changed in: sikuli
Status: New => Invalid
** Changed in: sikuli
Assignee: (unassigned) => RaiMan (raimund-hocke)
--
You received this bug notification because you are a member of Sikuli
Drivers, which is subscribed to Sikuli.
https://bugs.launchpad.net/bugs/1810580
Title:
Backslash on the end of string does not work
Status in Sikuli:
Invalid
Bug description:
Hi!
I would like to define a STRING with a path, using a backslash at the last
character. Obviously that's not so simple. look at the script:
IMGFILE=r'C:\Users\boi\Google Drive\Screenshots\SymbolsWD\log\' # does not
work
Pathlog = r'Path used..'
print IMGFILE
IMGFILE='C:\Users\boi\Google Drive\Screenshots\SymbolsWD\log\' # does not work
Pathlog = r'Path used..'
print IMGFILE
IMGFILE="C:\Users\boi\Google Drive\Screenshots\SymbolsWD\log\" # does not work
Pathlog = r'Path used..'
print IMGFILE
IMGFILE=r"C:\Users\boi\Google Drive\Screenshots\SymbolsWD\log\" # does not
work
Pathlog = r'Path used..'
print IMGFILE
IMGFILE=r"C:\Users\boi\Google Drive\Screenshots\SymbolsWD\log" # does work,
but not what I need
Pathlog = r'Path used..'
print IMGFILE
IMGFILE=r"C:\Users\boi\Google Drive\Screenshots\SymbolsWD\log\ " # I dont
need the space in the end
Pathlog = r'Path used..'
print IMGFILE
IMGFILE=r"C:\Users\boi\Google Drive\Screenshots\SymbolsWD\log" +r"\ ".strip()
# finally something I can use
Pathlog = r'Path used..'
print IMGFILE
exit()
Output:
Path used..
Path used..
Path used..
Path used..
C:\Users\boi\Google Drive\Screenshots\SymbolsWD\log
C:\Users\boi\Google Drive\Screenshots\SymbolsWD\log\
C:\Users\boi\Google Drive\Screenshots\SymbolsWD\log\
C:\Users\boi\Google Drive\Screenshots\SymbolsWD\log\
[info] Exit code: 0
AND:
IMGFILE=r"C:\Users\boi\Google Drive\Screenshots\SymbolsWD\log" +r"\" # lets
close with an error
Pathlog = r'Path used..'
print IMGFILE
[error] script [ test ] stopped with error in line 29 at column 8
[error] SyntaxError ( "can't assign to operator", )
I am using Sikulix IDE 1.1.4 SNAPSHOT on Windows10
Thanks
To manage notifications about this bug go to:
https://bugs.launchpad.net/sikuli/+bug/1810580/+subscriptions
_______________________________________________
Mailing list: https://launchpad.net/~sikuli-driver
Post to : [email protected]
Unsubscribe : https://launchpad.net/~sikuli-driver
More help : https://help.launchpad.net/ListHelp