Python Forum
How to know modules contained by python3 library - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: How to know modules contained by python3 library (/thread-12628.html)



How to know modules contained by python3 library - sylas - Sep-04-2018

Hi all ! I try to import 'msvcrt'. Impossible. I am using python 3.7. On Linux.
Error:
>>> import msvcrt ... import sys ... ... while True: ... ch = msvcrt.getch() ... if ch in b'\x00': ... ch = msvcrt.getch() # Second call returns the scan code ... if ch in b'\xe0': ... ch = msvcrt.getch() # Second call Function keys ... if ch == b'q': ... sys.exit() ... else: ... print(f'Key Pressed: {ch}') Traceback (most recent call last): File "<stdin>", line 1, in <module> ModuleNotFoundError: No module named 'msvcrt' No module named 'msvcrt'



RE: How to know modules contained by python3 library - snippsat - Sep-04-2018

You have asked about this before.


RE: How to know modules contained by python3 library - DeaD_EyE - Sep-04-2018

msvcrt is a module for Windows Systems.

If you want to use getch, look here: https://stackoverflow.com/questions/510357/python-read-a-single-character-from-the-user

Or use this package: https://pypi.org/project/getch/ [Linux, MacOS]


RE: How to know modules contained by python3 library - sylas - Sep-04-2018

I confess that I am lost handling one day Linux, next day windows, since I have a double boot computer. Thanks for your help. There are some files where we could join at the top : "#file for windows only"