← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #232844]: Can Sikuli search the sub-folders to find screenshots?

 

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

Parn Yin posted a new comment:
Hi RaiMan, I see.
Thank you for the quick and detailed explanation!!!

By the way, I have another python question.
Sorry, I just have been started to learn python since last month...

In my automation test, I created 2 functions to set the module path and the BundlePath, which use the path as parameter.
For example, the one for BundlePath:

def set_screenshot_path(my_screenshot_path):
    if not os.path.isdir(my_screenshot_path):
        print ("[EXCEPTION] " + my_screenshot_path + " does not exist.")
        raise Exception
    print ("The screenshot path is " + str(getBundlePath()))
    if not my_screenshot_path in str(getBundlePath()):
        setBundlePath(my_screenshot_path)
        print ("[SETTING] Change the screenshot path to my_screenshot_path.")
        print ("The screenshot path is " + str(getBundlePath()))

Then there is a problem about escape character.
For example, if the user assign "C:\test\new" as the my_screenshot_path, the path can't be get correctly becuase of the "\t" and "\n".

Is there a way to read the raw input from it?
I searched the google but failed to find a good solution.
e.g. there is one but it has no answer:
http://stackoverflow.com/questions/9457676/python-escape-character-when-parameter-is-a-path-windows

Excuse me RaiMan, could you please kindly help me when you have time?
Thank you.

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