MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.
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
|How to play a bell/system sound in Mac using Python||1||463|
|Using Python, I want to pass a URL some json and get back data (imitating Podbean's jQuery (AJAX?) function)||4||87|
|Turning python script into an applet||12||116|
|Python 3.5.2 - Script Help||3||66|