On 01/-10/-28163 02:59 PM, Susana Iraiis Delgado Rodriguez wrote:
Hello Peter!

I added the line you suggested me and found out that I was just searching
for the filenames without pointing to a specific directory, so Python took
its directory (Python26) as default. After that I need to add a '\' to
separate the path from the filename because it was reading them as a single
string. But finally it worked nicely! here is the corrected script.

<snip>
  wksht.row(row).write(1, filename)
  n = os.path.splitext(filename)
  p = ruta+'\\'+n[0]+'.prj'


Use os.path.join() to combine these nodes. If you use an explicit backslash you can trigger two problems: 1) Your code won't be portable to other platforms 2) You could have trouble if one of the components already has a path separator.


DaveA
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to