2013年5月21日
摘要: import sqlite3if __name__ =='__main__': db_file='d:\\data.db' conn=sqlite3.connect(db_file) cur=conn.cursor() cur.execute('SELECT * FROM table1') records=cur.fetchall() for x in records: print x[0]+' '+x[1] #有多少列就打印多少个 conn.close() 阅读全文
posted @ 2013-05-21 17:06 回头多少个秋 阅读(314) 评论(0) 推荐(0) 编辑
摘要: import osimport os.pathif __name__ =='__main__': root_dir='g:\\download' for root, dirs, files in os.walk(root_dir): for dir in dirs: print 'root=%s dir=%s' % (root,dir) #print 'root='+root+' dir='+dir for file in files: print 'roo... 阅读全文
posted @ 2013-05-21 17:01 回头多少个秋 阅读(144) 评论(0) 推荐(0) 编辑