View Single Post
  #3   (View Single Post)  
Old 24th April 2010
TerryP's Avatar
TerryP TerryP is offline
Arp Constable
 
Join Date: May 2008
Location: USofA
Posts: 1,547
Default

Being lazy, I tend to just use `diff -ru dir1 dir2`, and worry about the brevity that using checksums would offer, when I need to think of a grep string or awk program to filter the results from diff.

lol.



EDIT: by the way CS, code like this:

Code:
# Automagic slash/backslash conversion doesn't work with pythonpath.
if os.path.isdir('../aragorn'):
	if sys.platform[:3] == 'win':
		sys.path.append('..\\aragorn')
	else:
		sys.path.append('../aragorn')
Should never be necessary, just use the os.path module properly! Toggles over / and \ are utterly pointless; generally you should never use either in a file path directly. Both from the perspective of writing a program, and from writing os.path, it is very bad design. This is why things like os.path.sep and numerous path manipulation functions exist: so we don't have to write our own.

At least, assuming you like ease of porting between OSes, and easier to maintain scripts.


(My only real gripe with os.path is the inconsistencies of os.path.expandvars(), where the NT module has the best, and every other implementation sucks)
__________________
My Journal

Thou shalt check the array bounds of all strings (indeed, all arrays), for surely where thou typest ``foo'' someone someday shall type ``supercalifragilisticexpialidocious''.

Last edited by TerryP; 24th April 2010 at 03:35 PM.
Reply With Quote