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!
Try: inFile = open(WORDLIST_FILENAME, 'r') The ", 0" isn't needed and apparently in different OS's and/or Python versions can cause problems.
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!
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 ).
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.
Join our real-time social learning platform and learn together with your friends!