Issue
I have developed an application in python and pyside. I have developed it on linux machine. Now I want to deploy it on windows machine. Here problem is path. In linux forward slash(/) used as separator but windows uses backward slash(\) as separator.
So, on windows all paths not work. There are several paths in application(for stylesheet, images, log etc.)
Its difficult to change all paths as most of paths are hard code like:
rootPath()+'/static/images/add.png' #rootPath return os.path...
Example:
colorPickerBtnStyle = 'background:url(' + rootPath() + '/static/images/color_icon.png);background-repeat: no-repeat;background-position:center center;'
Is there any work around for this problem.
Solution
os.path.join()
will use the right kind of slash on the right platform.
Answered By - Thomas
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.