RSS feed
[root]
/
code
/
TI Pattern
/
software design
/
document
com
cX
c13
c12
c11
c10
c09
c07
c06
c05
c04
c03
c02
c01
login:
password:
title search:
Search this site
Enter your search terms
Web
www.carfield.com.hk
Submit search form
Prev
Next
Wed Dec 26 16:00:00 GMT 2001
SanityCheck
#: SanityCheck.py import string, glob, os def visitor(arg, dirname, names): dir = os.getcwd() os.chdir(dirname) try: pyprogs = [p for p in glob.glob('*.py') if p != "SanityCheck.py"] if not pyprogs: return print '[' + os.getcwd() + ']' for program in pyprogs: print '\t', program os.system("python %s > tmp" % program) file = open(program).read() output = open('tmp').read() # Append output if it's not already there: if file.find("output = '''") == -1 and \ len(output) > 0: divider = '#' * 50 + '\n' file = file.replace('#' + ':~', '#<hr>\n') file += "output = '''\n" + \ open('tmp').read() + "'''\n" open(program,'w').write(file) finally: os.chdir(dir) if __name__ == "__main__": os.path.walk('.', visitor, None) #:~
(google search)
(amazon search)
1
2
3
second
download zip of files only
Prev
Next