[原创] 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
posted @ 2012-09-29 21:04  icemoon1987  阅读(186)  评论(0编辑  收藏  举报