Python

From Rixort Wiki
Revision as of 21:09, 11 March 2018 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())