How do I import other Python files?

How do I import files in Python? I want to import:

  1. a file (e.g. file.py)
  2. a folder
  3. a file dynamically at runtime, based on user input
  4. one specific part of a file (e.g. a single function)

← Назад к списку