[原创] Learning in Python:Chapter 3 How You Run Programs

1.    Files == Modules,  Top level module == scripts

 
2.    Module Imports and Reloads
  • Omit the .py
  • Import runs the file once per process. reload() can run mutiple times.
  • Module can contain variables, functions, etc.
  • from ... import ... :   Copy names from a module.
  • dir():   Return the attributes of a module.
  • exec(open('module.py').read()),  execfile('module.py')
3.    Advanced IDLE Tools
  • Debuger
  • object browser

你可能感兴趣的:(python)