How to check if a module exists in Python

1 Answer

0 votes
import importlib

result = importlib.util.find_spec("memory")

print(result is not None)


       
                  

'''
run:

Fasle

'''

 



answered Feb 22, 2023 by avibootz
...