擅长:python、mysql、java
<p>只需在这些文件中添加一个附加注释,请确保在您的.read文件中添加一个中断,否则它将继续运行。</p>
<pre><code>def HexView():
with open(<yourfilehere>, 'rb') as in_file:
while True:
hexdata = in_file.read(16).hex() # I like to read 16 bytes in then new line it.
if len(hexdata) == 0: # breaks loop once no more binary data is read
break
print(hexdata.upper()) # I also like it all in caps.
</code></pre>