basic code of what I am doing
Duncan Booth
duncan.booth at invalid.invalid
Wed Jun 11 17:10:41 EDT 2008
Alexnb <alexnbryan at gmail.com> wrote:
> path = self.e.get()
> path = "\"" + path + "\""
> os.startfile(path)
Why are you adding spurious quote marks round the filename? os.startfile()
will strip them off, but you don't need them. The help for os.startfile()
does say though that the path must not start with a /, so you should use
os.normpath to be on the safe side:
os.startfile(os.path.normpath(self.e.get())
Anyway, the code works either with that change, or as you originally wrote
it provided the path does not start with /. What was the question again?
More information about the Python-list
mailing list