Reputation: 103
I have this test snippet
while True:
input("prompt> ")
On Windows, when I run this script with "py", I can use the arrow keys as expected. But when I try doing this in my ubuntu command line, it will show the following output:
How do I make it such that this code snippet is interactive for any python3 installation on any OS? Why is it only working on Windows now?
Upvotes: 0
Views: 356
Reputation: 751
it's about OS -
windows os is working differently from a based Linux-OS like ubuntu.
you can try this:
https://stackoverflow.com/a/893200/9350669
by the way, I just install python3 in my VM-ubuntu and run your script and the arrow keys work well, so you can try reinstall python or update the os.
Upvotes: 1
Reputation: 103
python3 -i script.py
Apparently this solves the problem and makes the session interactive. Lol okay.
Upvotes: 0