Skip to main content
Stack Overflow
  1. About
  2. For Teams

Return to Answer

Post Timeline

added 2 characters in body
Source Link
L3viathan
  • 27.5k
  • 2
  • 63
  • 84

Added another case to Michał Górny's answer:

Note that relative imports are based on the name of the current module. Since the name of the main module is always "main__main__", modules intended for use as the main module of a Python application must always use absolute imports.

Added another case to Michał Górny's answer:

Note that relative imports are based on the name of the current module. Since the name of the main module is always "main", modules intended for use as the main module of a Python application must always use absolute imports.

Added another case to Michał Górny's answer:

Note that relative imports are based on the name of the current module. Since the name of the main module is always "__main__", modules intended for use as the main module of a Python application must always use absolute imports.

Source Link
Panfeng Li
  • 3.7k
  • 4
  • 30
  • 37

Added another case to Michał Górny's answer:

Note that relative imports are based on the name of the current module. Since the name of the main module is always "main", modules intended for use as the main module of a Python application must always use absolute imports.

lang-py

AltStyle によって変換されたページ (->オリジナル) /