Jan-07-2022, 03:16 AM
I'm working on a Markov bot for Twitter that reads off of a static directory and I know barely anything about coding. The program I got from a library and tweaked it to fit my needs.
For some reason, the Markov bot code I tweaked, Program A, reads the filename just fine. I don't get errors when I import that one into Python. Program B has code in it to import Program A into it and has a few basic commands. When I import that one into Python, it throws up an error message that the file name doesn't exist.
Error message in full:
I am terrible at coding and I think I jumped into the deep end with this. Please help!
For some reason, the Markov bot code I tweaked, Program A, reads the filename just fine. I don't get errors when I import that one into Python. Program B has code in it to import Program A into it and has a few basic commands. When I import that one into Python, it throws up an error message that the file name doesn't exist.
Error message in full:
Error:>>>import pookebot
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\slean\pookebot.py", line 15, in <module>
tweetbot.read(book)
File "C:\Users\slean\PokeBot.py", line 360, in read
self._error(u'read', u"File does not exist: '%s'" % (filename))
File "C:\Users\slean\PokeBot.py", line 1371, in _error
raise Exception(u"ERROR in Markovbot.%s: %s" % (methodname, msg))
Exception: ERROR in Markovbot.read: File does not exist: 'C:\Users\slean\PokeBot\pokemoncanon.txt'
I am making sure in the code to make all the \ in the filenames \\ but it shows up as \ in the error message. I am terrible at coding and I think I jumped into the deep end with this. Please help!