Wednesday 15 June 2011

Python not opening files properly -



Python not opening files properly -

i made python program, , converted .exe cxfreeze. several lines of code in converted python script are

os.chdir(path) if os.path.exists('somefile.html')==false: file = open('somefile.html', 'w') file.write('#html code') file.close() webbrowser.open('somefile.html')

when opens, reason, has right path (c:\blah\blah\blah\somefile.html) plus \ in filepath in front end of drivename. (\c:\blah\blah\blah\somefile.html)

obviously, makes webbrowser display error "webbrowser_name cannot find specified file."

does know why it's doing this?

python python-3.x web

No comments:

Post a Comment