In Python, I open a text file and read it line-by-line, and strip() the line before evaluating it. When I evaluate the line, I have an if statement to check if the line is "random", and then puts a random number into a variable called genRandom. I have another line in my code that looks like this:
thisLine.replace("genRANDOM",genRandom) #Replace genRANDOM with the random number
On every line, it seems to work ok. In the input text file, I have a line that looks like this:
-genRANDOM
Whenever my script evaluates that line, I get this error:
Traceback (most recent call last):
File "D:\Mass Storage\pythonscripts\TurnByTurn\execute.py", line 37, in <module>
thisLine.replace("genRANDOM",genRandom) #Replace genRANDOM with the random number
TypeError: expected a character buffer object
How can I fix this? Thanks in advance!