Friday, May 08, 2009

It's over!

Quick post to mention that i've finished my degree! more importantly i that i can get back to doing what i love, writing code (and playing FM).

Heres some extremely basic python for transforming a simple list of CRLF separated values into a sql statement.



def main():
fh = open('list.txt')

sql = open('sqlDump.txt','w')

i = 0
for line in fh:
statement = "INSERT INTO table (name) VALUES ('%s');\r" % line.rstrip()

sql.write( statement )

fh.close()
sql.close()

if __name__ == '__main__':
main()


Nothing special.

Off to china on sunday!!
再见

No comments: