I wrote a small script that uses the Bash command line interface to input information into a database. The script works beautifully on my home desktop, but I would like to move it to the PythonAnywhere platform. My problem is that when I attempt to use the script, as soon as I type something at the prompt, I get the following error:
00:40 ~/enterjobs $ python enterjobs.py
Search for client by name
Client >> Bob
Traceback (most recent call last):
File "enterjobs.py", line 263, in <module>
main()
File "enterjobs.py", line 261, in main
ej_state.prompt()
File "enterjobs.py", line 128, in prompt
self.current_state["handler"](input(self.current_state["prompt"]))
File "<string>", line 1, in <module>
NameError: name 'Bob' is not defined
00:41 ~/lch/enterjobs $
I typed "Bob" without quotes, hit enter, and Python threw an exception and quit. If I type "Bob" with quotes and quote the rest of my input, my script works perfectly. But I do not want to quote everything I enter into my script's input. I'm guessing the issue arises from the implementation of the online Bash console on PythonAnywhere. Is there are workaround? I would even be happy to use some kind of hack to the builtin Python input() function. I just don't want to have to quote everything I type.