Posts

Showing posts from June, 2018

Rename Sub Folders in A Directory With Python

Here's a little bit of code that renames sub folders in a directory with python. import os import os.path for (dirpath, dirnames, filenames) in os.walk(r'O:\!2016\your folder path here):     for idx in range(len(dirnames)):         print(dirnames[idx])         newname = dirnames[idx].split(' ')[0].upper() + " " + dirnames[idx].split(' ')[1].upper()         os.rename(os.path.join(dirpath, dirnames[idx]), os.path.join(dirpath, newname))         dirnames[idx] = newname

Harvey

My friend Harvey is retiring. I learned one of the most valuable GIS lessons of my career so far from Harvey. I met Harvey about a year into my GIS career.  Harvey was a cowboy fireman with the most impressive mustache.  He was in the office on light duty following a surgery. We were paired up to work on a few projects together, creating spreadsheets and maps. Harvey has bad eye sight.  The mapbook I made for the fire department had 27 pages covering the city.  But Harvey couldn't see it and would throw the mapbook at someone else to look at it while on their way to a call.  For Christmas later that year, we made Harvey his own special mapbook, with 108 pages covering the city.  He chuckled.  And used it. To this day, every map I make, I make with Harvey in mind.  Harvey is an old soul that doesn't like computers.  He has no use for complex maps.  While GIS is complex and ever-growing, I try to make every map a map that Harvey will understand.  It is easy for us GIS-e