Advertisement
Guest User

Untitled

a guest
Aug 29th, 2014
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. in_dir = /path/to/in_files/on/nas
  2. out_dir = /path/to/out_files/on/nas
  3.  
  4. def convert_all_files(in_dir, out_dir):
  5. os.chdir(in_dir)
  6. in_files = glob.glob('*.bin')
  7.  
  8. with MyDao() as dao: #MyDao is a database access object class
  9. for mf in in_files:
  10. caseid = mf.split('_', 1)[0]
  11. time_info = bin2txt(mf, out_dir) #bin2txt is the function to convert bin file to txt files
  12. dao.save(caseid, time_info) #save time info to DB
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement