水题:python逆序输出文件
2017-09-01 本文已影响74人
Ryans
遇到一个奇怪的题目,一个图片文件二进制逆序了。
将顺序转正回来,是个二维码图片。
#!/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])