Ben Chuanlong Du's Blog

It is never too late to learn.

Tips on Python Module

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

Import a Module

  1. There are 3 different ways to import Python modules.

    import module_name
    import module_name as alias
    from module import pkg_mod_or_fun
    
  2. The module importlib.resources (since Python 3.7+) leverages …