Python Forum
How to know modules contained by python3 library
Thread Rating:
  • 1 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to know modules contained by python3 library
#1
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'
Reply
#2
You have asked about this before.
Reply
#3
msvcrt is a module for Windows Systems.

If you want to use getch, look here: https://stackoverflow.com/questions/5103...m-the-user

Or use this package: https://pypi.org/project/getch/ [Linux, MacOS]
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
Reply
#4
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"
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How can prepare the modules when compiling python3.11? luofeiyu 1 565 Sep-28-2023, 03:50 PM
Last Post: deanhystad
  code to send attachments contained on the drive. stefanoste78 1 849 Oct-12-2022, 02:16 AM
Last Post: Larz60+
  Remove an item from a list contained in another item in python CompleteNewb 19 5,669 Nov-11-2021, 06:43 AM
Last Post: Gribouillis
  MacOS BigSur Python3 - dyld: Library not loaded: trillionanswers 1 4,199 Mar-02-2021, 11:00 PM
Last Post: nilamo
  Not able to use boto library with compressed content in python3 avinash2020 1 1,880 Aug-13-2020, 09:24 PM
Last Post: avinash2020
  standard library modules chpyel 4 2,809 May-10-2020, 02:58 PM
Last Post: snippsat
  Gnuradio python3 is not compatible python3 xmlrpc library How Can I Fix İt ? muratoznnnn 3 4,893 Nov-07-2019, 05:47 PM
Last Post: DeaD_EyE
  installation directory of modules in python3.7 srm 2 2,731 Jul-11-2019, 01:06 PM
Last Post: joe_momma
  Call a Function contained in a Tuple SamGer 7 5,061 Jun-14-2019, 05:00 PM
Last Post: ThomasL
  Issue python3.6 while inheriting telnet library sourabhjaiswal92 4 4,091 May-09-2018, 05:20 AM
Last Post: sourabhjaiswal92

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020