Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import subprocess
- contents = subprocess.check_output('cat xxx',shell=True)
- for l in contents.splitlines():
- e = l.split()
- number = int(e[2],base=16)
- print(e[0],e[1],number>>4&1,number>>3&1,number&0b111)
- p = Popen(['cat', xxx], stdout=PIPE)
- for line in iter(p.stdout.readline, ''):
- process_content(line) # process_content の実装方法は @takoika さんの回答にご参考
Add Comment
Please, Sign In to add comment