Created
October 16, 2019 15:08
-
-
Save seunggabi/2b1d934d3bdf2c4eb688b7617527e6bf to your computer and use it in GitHub Desktop.
byte2string.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pyparsing import unicode | |
from bs4 import BeautifulSoup | |
path = "" | |
binary_filename = "binary.txt" | |
i = open(binary_filename, "rb") | |
input = i.read() | |
input = unicode(input, errors='ignore') | |
bsObj = BeautifulSoup(path + input, "html.parser") | |
i.close() | |
num = 1 | |
for contents in bsObj.findAll("contents"): | |
t = str(contents) | |
t = unicode(t).encode('utf-8') | |
o = open(path + str(num) + ".txt", "wb") | |
o.write(t) | |
o.close() | |
num += 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment