[Tutor] Unusual pathfile
Steven D'Aprano
steve at pearwood.info
Tue Sep 13 19:00:50 CEST 2011
Susana Iraiis Delgado Rodriguez wrote:
> Hi!
> I just want to look the pathfile like this: C:\Python26 instead of
> C:/\Python26, I feel the loop repeats its walking with this pathfile
> structure. About the indention for the code, I tried my best to make it
> clear ande neat. But the mi e-mail editor it's mixing-up spaces.
> Here's again:
Susana, you are showing too much code that is unrelated to your problem.
Your problem is that your code gives the wrong result for the file name:
you want C:\Python26 but get C:/\Python26.
You should isolate the part of your code that produces the path names.
We don't need the part that creates buttons, or writes CSV files, or
prints messages to the user. As it stands now, I can't even tell which
part of the code generates "C:/\Python26", let alone how to fix it.
You should have a small function, no more than ten or twenty lines, that
handles the path names, and nothing else.
--
Steven
More information about the Tutor
mailing list