Modules


  1. Create modules
  2. path to load modules from - The module search path
  3. sys.path - the module search path
  4. Flat project directory structure
  5. Absolute path
  6. Relative path
  7. Traverse directory tree - list directories recursively
  8. Python modules are compiled
  9. How "import" and "from" work?
  10. Runtime loading of modules
  11. Conditional loading of modules
  12. Duplicate importing of functions
  13. Script or library
  14. Script or library - import
  15. Script or library - from import
  16. assert to verify values
  17. mycalc as a self testing module
  18. doctest
  19. Scope of import
  20. Export import
  21. Export import with __all__
  22. import module
  23. deep copy list
  24. deep copy dictionary
  25. Exercise: Number guessing
  26. Exercies: Scripts and modules
  27. Exercise: Module my_sum
  28. Exercise: Convert your script to module
  29. Exercise: Add doctests to your own code
  30. Solution: Module my_sum