遇到一个奇怪的题目,一个图片文件二进制逆序了。
将顺序转正回来,是个二维码图片。
#!/usr/bin/python
with open("reverse","rb") as f:
tmp = f.read()
with open("newreverse","wb") as f:
f.write(tmp[::-1])
遇到一个奇怪的题目,一个图片文件二进制逆序了。
将顺序转正回来,是个二维码图片。
#!/usr/bin/python
with open("reverse","rb") as f:
tmp = f.read()
with open("newreverse","wb") as f:
f.write(tmp[::-1])
本文标题:水题:python逆序输出文件
本文链接:https://www.haomeiwen.com/subject/ajlkjxtx.html
网友评论