← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #166235]: about auto-search in a folder

 

Question #166235 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/166235

    Status: Open => Answered

RaiMan proposed the following answer:
on Windows, you have to use backslashes.
They have to be doubled (escaped) in normal strings or use raw strings r"".
file already contains a filename and is a string, so no additional '

shutil.copy2( file , r"d:\newname" ) # (remote_latest_file ,
save_to_local_side )

so if file contains e.g. r"x:\some-dir\somefile.txt" you would have a
copy at  r"d:\newname\somefile.txt" if new name is an existing directory
or simply r"d:\newname", where newname now is a text file without
extension and contains the contents of r"x:\some-dir\somefile.txt".

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.