anonymous
  • anonymous
Hey Guys, i have a problem with the Hangman Game from the second problem set. When I run it without changing anything it gives me this error: inFile = open(WORDLIST_FILENAME, 'r', 0) ValueError: can't have unbuffered text I/O I am using Eclipse as development environment thanks!
MIT 6.00 Intro Computer Science (OCW)
  • Stacey Warren - Expert brainly.com
Hey! We 've verified this expert answer for you, click below to unlock the details :)
SOLVED
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.
jamiebookeater
  • jamiebookeater
I got my questions answered at brainly.com in under 10 minutes. Go to brainly.com now for free help!
rsmith6559
  • rsmith6559
Try: inFile = open(WORDLIST_FILENAME, 'r') The ", 0" isn't needed and apparently in different OS's and/or Python versions can cause problems.
anonymous
  • anonymous
Thanks for your help, I really appreciate it!! It worked, but now I get another error: wordlist = string.split(line) AttributeError: 'module' object has no attribute 'split' Could you help me again? Thanks a lot!
rsmith6559
  • rsmith6559
strings are treated as objects of type string. The method split() should be called on an instance of a string. string is a Python module. The code should be something like: >>> foo = "Hello World" >>> foo.split( ' ' ) ['Hello', 'World'] >>> The split() method takes a string to use to split the parent string on ( in this case, space ).

Looking for something else?

Not the answer you are looking for? Search for more explanations.

More answers

anonymous
  • anonymous
I am using Python 3.5 and work in LiClipse. Apparently, there were some changes specific either to OS or to Python version which require small changes in syntax. So in your case try wordlist = str.split(line). Should work.

Looking for something else?

Not the answer you are looking for? Search for more explanations.