[Tutor] if os.path.exists() or if not os.path.exists()?

2011-03-24 Thread Susana Iraiis Delgado Rodriguez
OK!! I see the problem now! I also did a little change to the code, I open the .txt before the for stamentet. The script is working properly gdal.AllRegister() file_list = [ folders = Non for root, folders, files in os.walk( "C:\\" ): file_list.extend(os.path.join( root,fi) for fi in files if f

Re: [Tutor] if os.path.exists() or if not os.path.exists()?

2011-03-24 Thread Tom Zych
On Thu, 24 Mar 2011 09:22 -0600, "Susana Iraiis Delgado Rodriguez" wrote: > #This block is wrong, I think here is the problem > if os.path.exists(shx): > print 'El archivo ' +shx +' existe' > else: > log.write('No existe el archivo ' +shx + "\n") > i

[Tutor] if os.path.exists() or if not os.path.exists()?

2011-03-24 Thread Susana Iraiis Delgado Rodriguez
Hello everyone! I'm doing a python script that walks through files in my PC. Basically I'm searching files that end up with .shp, but these files must have extensions with .shx and .dbf. I want to write a .txt document which tells the user if a file doesn't exist in the directory. But I haven't be