Advertisement
Dido09

StringInBinaryFile

Dec 16th, 2021
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.14 KB | None | 0 0
  1. my_file = open('RandomDoc.bin', 'wb+')
  2. string = 'This is good.'
  3. asc_code = string.encode('ASCII')
  4. my_file.write(asc_code)
  5. my_file.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement