Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.
One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.
It's just a bunch of yes's and no's in a straight text file in Windows 7. However, I've tried reading the file several ways, and I get unexpected results. When I do this:
YES NO YES YES NO ...
file1 = list(open(sys.argv))
and when I do:
['\xff\xfeY\x00E\x00S\x00\r\x00\n', '\x00Y\x00E\x00S\x00\r\x00\n', '\x00N\x00O\x00\r\x00\n', '\x00N\x00O\x00\r\x00\n', ' \x00N\x00O\x00\r\x00\n', '\x00N\x00O\x00\r\x00\n', '\x00Y\x00E\x00S\x00\r\x00\n', '\x00Y\x00E\x00S\x00\r\x00\n', '\x00Y\ .......]
f1 = open(sys.argv, "r") lines1 = f1.readlines() for i in lines1: print i.strip()
What is going on here and how do I read this as I expect it to be in the file?
■Y E S Y E S N O N O N O N O Y E S Y E S Y E S N O Y E S Y E S
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.