Python

From Rixort Wiki
Revision as of 15:28, 5 December 2019 by Paul (Sọ̀rọ̀ | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
  • Every file of Python source code that ends in .py is a module - no special code or naming is required.
  • dir fetches all names available inside a module: dir(modname)
  • Each file is a self-contained namespace.
  • reloads are not transitive, so reloading module A which imports module B does not reload B.
  • To run a script: exec(open('script.py').read())

Links

Books