Python

From Rixort Wiki
Revision as of 10:39, 2 July 2019 by Paul (Sọ̀rọ̀ | contribs)
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

  • Learning Python - From the author of Learning Python and Programming Python.