I had this code:
while True:
cmd = input('> ')
if cmd == 'exit':
break
But I wanted to implement advanced text input features like command history so I imported the readline module. Importing the readline module (and not even using it) will unlock these features. This code works perfectly:
import readline
while True:
cmd = input('> ')
if cmd == 'exit':
break
My problem (or maybe just annoyance) is that PyCharm gives me a non-fatal warning that I have an unused import statement. I assume this is just a simple fault in PyCharm for not realizing that the readline import WILL be used if you use the builtin input function.
What is the cleanest way for me to get rid of this warning? Also, is this a bug that PyCharm ought to fix?