Testing the data type of a value
When I run the following code, I get the following output:
>>> print(type(5))
class 'int'
Next, I try to compare the data-type of 5 with the earlier output, I get no
output:
>>> if type(5) == "":
print("Integer")
Why isn't this working? Advance thanks for your time.
and regards from
Binoy
--
https://mail.python.org/mailman/listinfo/python-list
Implementing C++'s getch() in Python
I'm working on Python 3.7 under Windows. I need a way to input characters without echoing them on screen, something that getch() did effectively in C++. I read about the unicurses, ncurses and curses modules, which I was not able to install using pip. Is there any way of getting this done? -- https://mail.python.org/mailman/listinfo/python-list
Re: Implementing C++'s getch() in Python
Hi Shakti! Thanks for your response. I have tried getpass() but got the following warning: Warning (from warnings module): File "C:\Users\Binoy\AppData\Local\Programs\Python\Python37-32\lib\getpass.py", line 100 return fallback_getpass(prompt, stream) GetPassWarning: Can not control echo on the terminal. Warning: Password input may be echoed. And true enough, the input string is echoed. I saw a video where getpass() worked on Linux. So, probably, its a Windows thing. Still looking for a solution to the same on Windows. -- https://mail.python.org/mailman/listinfo/python-list
Re: Implementing C++'s getch() in Python
I've run getpass() on IDLE, Spyder, PyCharm and Mu. All with negative results. -- https://mail.python.org/mailman/listinfo/python-list
