Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os
- fp=open("try.ts","rb")
- for i in range(100):
- buf=fp.read(188)
- if buf[0]=="x47"
- print "OK"
- fp.close()
- if buf[0]=="x47"
- ^
- SyntaxError: invalid syntax
- if buf[0]=="x47":
- IndexError: string index out of range
- if buf[0]=="x47":
- IndexError: string index out of range
- with open('wxasrs.mp3','rb') as f:
- print(isinstance(f.read(), str))
- print(isinstance(f.read(), bytes))
- False
- True
Add Comment
Please, Sign In to add comment