On ps2 hangman, I keep getting this error: IOError: [Errno 2] No such file or directory: 'words.txt' What am I doing wrong? Thanks!
sounds like the .txt document 'words.txt' doesn't exist in the path it's trying to reach it at.. though I'm not positive.
Ps2? what language
Is words.txt in the same folder as your program? With that syntax, it needs to be.
ya, the .txt document should be in the right project folder- doesn't have to be in the right class folder- I think just the right project. Anyway, if you're using java, you can create a file from the project using the PrintWriter class, and you can see where that file ends up- where that file ends up is the same spot you should expect to read in words.txt from. Or you can put words.txt wherever you want, then specify the path location in the PrintWriter/FileWriter/File class's constructors in java- don't know about other languages.
Join our real-time social learning platform and learn together with your friends!