Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- in_dir = /path/to/in_files/on/nas
- out_dir = /path/to/out_files/on/nas
- def convert_all_files(in_dir, out_dir):
- os.chdir(in_dir)
- in_files = glob.glob('*.bin')
- with MyDao() as dao: #MyDao is a database access object class
- for mf in in_files:
- caseid = mf.split('_', 1)[0]
- time_info = bin2txt(mf, out_dir) #bin2txt is the function to convert bin file to txt files
- dao.save(caseid, time_info) #save time info to DB
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement