- 1. Python Context Managers
- 2. Context managers (with statement)
- 2.1. Why use context managers?
- 2.2. Using Context Manager
- 2.3. Context Manager examples
- 2.4. cd in a function
- 2.5. open in function
- 2.6. open in for loop
- 2.7. open in function using with
- 2.8. Plain context manager
- 2.9. Param context manager
- 2.10. Context manager that returns a value
- 2.11. Use my tempdir - return
- 2.12. Use my tempdir - exception
- 2.13. cwd context manager
- 2.14. tempdir context manager
- 2.15. Context manager with class
- 2.16. Context managers with class
- 2.17. Context manager: with for file
- 2.18. With - context managers
- 2.19. Exercise: Context manager
- 2.20. Exercise: Tempdir on Windows
- 2.21. Solution: Context manager