- 1. Python Other
- 2. PyPi - Python Package Index
- 2.1. What is PyPi?
- 2.2. pip
- 2.3. Configure pip on Windows to avoid SSL issues
- 2.4. Upgrade pip
- 2.5. Upgrade PIP on Windows
- 2.6. PYTHONPATH
- 2.7. Requirements
- 2.8. Virtualenv
- 3. Web client - web scraping
- 3.1. get HTML page using urllib
- 3.2. Download image using urllib
- 3.3. get HTML page using requests
- 3.4. Download image using requests
- 3.5. Download image as a stream using requests
- 3.6. Download zip file using requests
- 3.7. Extract zip file
- 3.8. Beautiful Soup to parse HTML
- 3.9. requests - JSON - API
- 3.10. httpbin.org
- 3.11. requests get from httpbin - JSON
- 3.12. requests get IP from httpbin - JSON
- 3.13. requests get JSON User-Agent
- 3.14. requests change User-Agent
- 3.15. requests get header
- 3.16. requests change header
- 3.17. requests post
- 3.18. Interactive Requests
- 3.19. Download the weather - scraping
- 3.20. Download the weather - API call with requests
- 3.21. Download the weather - API call with requests
- 3.22. Tweet
- 3.23. bit.ly
- 3.24. API config file
- 3.25. Exercise: Combine web server and client
- 4. Python Web server
- 4.1. Hello world web
- 4.2. Dump web environment info
- 4.3. Web echo
- 4.4. Web form
- 4.5. Resources
- 5. Networking
- 5.1. Secure shell
- 5.2. ssh
- 5.3. ssh from Windows
- 5.4. Parallel ssh
- 5.5. telnet
- 5.6. prompt for password
- 5.7. ftp
- 6. Interactive shell
- 6.1. The Python interactive shell
- 6.2. REPL - Read Evaluate Print Loop
- 6.3. Using Modules
- 6.4. Getting help
- 6.5. Exercise: Interactive shell
- 7. Types in Python
- 7.1. mypy
- 7.2. Changing types
- 7.3. Changing types when reading a number
- 7.4. Types of variables
- 7.5. Types of function parameters
- 7.6. Types function returns None or bool
- 7.7. Types used properly
- 7.8. TODO: mypy
- 8. Logging
- 8.1. Simple logging
- 8.2. Simple logging - set level
- 8.3. Simple logging to a file
- 8.4. Simple logging format
- 8.5. Simple logging change date format
- 8.6. getLogger
- 8.7. Time-based logrotation
- 8.8. Size-based logrotation
- 9. Closures
- 9.1. Counter local - not working
- 9.2. Counter with global
- 9.3. Create incrementors
- 9.4. Create internal function
- 9.5. Create function by a function
- 9.6. Create function with parameters
- 9.7. Counter closure
- 9.8. Make incrementor with def (closure)
- 9.9. Make incrementor with lambda
- 9.10. Exercise: closure bank
- 9.11. Exercise: counter with parameter
- 9.12. Solution: closure bank
- 9.13. Solution: counter with parameter
- 10. Decorators
- 10.1. Decorators: simple example
- 10.2. Decorators - Flask
- 10.3. Decorators - Pytest
- 10.4. Decorators caching - no cache
- 10.5. Decorators caching - with cache
- 10.6. LRU - Least recently used cache
- 10.7. LRU - Least recently used cache
- 10.8. OOP - classmethod - staticmethod
- 10.9. Use cases for decorators in Python
- 10.10. Function assignment
- 10.11. Function assignment - alias print to say
- 10.12. Function assignment - don't do this
- 10.13. Passing functions as parameters
- 10.14. Traversing directory tree
- 10.15. Declaring Functions inside other function
- 10.16. Returning a new function from a function
- 10.17. Returning a closure
- 10.18. Decorator
- 10.19. Decorator Demo
- 10.20. Decorator to register function
- 10.21. A recursive Fibonacci
- 10.22. trace fibo
- 10.23. tron decorator
- 10.24. Decorate with direct call
- 10.25. Decorate with parameter
- 10.26. Decorator accepting parameter
- 10.27. Decorate function with any signature
- 10.28. Decorate function with any signature - implementation
- 10.29. Decorate function with any signature - skeleton
- 10.30. Decorate function with any signature - skeleton with name
- 10.31. Functool - partial
- 10.32. Exercise: Logger decorator
- 10.33. Exercise: decorators decorator
- 10.34. Solution: Logger decorator
- 10.35. Solution: Logger decorator (testing)
- 10.36. Solution decorators decorator
- 10.37. A list of functions
- 10.38. Insert element in sorted list using insort
- 11. Context managers (with statement)
- 11.1. Why use context managers?
- 11.2. Using Context Manager
- 11.3. Context Manager examples
- 11.4. cd in a function
- 11.5. open in function
- 11.6. open in for loop
- 11.7. open in function using with
- 11.8. Plain context manager
- 11.9. Param context manager
- 11.10. Context manager that returns a value
- 11.11. Use my tempdir - return
- 11.12. Use my tempdir - exception
- 11.13. cwd context manager
- 11.14. tempdir context manager
- 11.15. Context manager with class
- 11.16. Context managers with class
- 11.17. Context manager: with for file
- 11.18. With - context managers
- 11.19. Exercise: Context manager
- 11.20. Exercise: Tempdir on Windows
- 11.21. Solution: Context manager
- 12. Advanced lists
- 12.1. Change list while looping: endless list
- 12.2. Change list while looping
- 12.3. Copy list before iteration
- 12.4. for with flag
- 12.5. for else
- 12.6. enumerate
- 12.7. do while
- 12.8. list slice is copy
- 13. Warnings
- 13.1. Warnings
- 14. CSV
- 14.1. What is a CSV file?
- 14.2. CSV file without title row
- 14.3. CSV file with header
- 14.4. Read CSV file into lists
- 14.5. CSV with newlines missing closing quote
- 14.6. CSV to dictionary
- 14.7. CSV Attributes
- 14.8. CSV dialects
- 14.9. Reading CSV the naive way
- 14.10. CSV with quotes and newlines
- 14.11. Reading a CSV file
- 14.12. Exercise: CSV as dictionary of dictionaries
- 14.13. Exercise: CSV as dictionary of tuples of dictionaries
- 14.14. Exercise: count row length in csv files
- 14.15. Solution: CSV as dictionary of dictionaries
- 14.16. Solution: CSV as dictionary of tuples of dictionaries
- 14.17. Solution: count row length in csv files
- 15. Excel
- 15.1. Spreadsheets
- 15.2. Python Excel
- 15.3. Create an Excel file from scratch
- 15.4. Worksheets in Excel
- 15.5. Add expressions to Excel
- 15.6. Format field
- 15.7. Number series and chart
- 15.8. Read Excel file
- 15.9. Update Excel file
- 15.10. Barchart
- 15.11. Exercise: Excel
- 16. XML
- 16.1. XML Data
- 16.2. Expat - Callbacks
- 16.3. XML DOM - Document Object Model
- 16.4. XML SAX - Simple API for XML
- 16.5. SAX collect
- 16.6. XML elementtree
- 16.7. SAX with coroutine
- 17. Matplotlib
- 17.1. About Matplotlib
- 17.2. Matplotlib Line
- 17.3. Matplotlib Line with dates
- 17.4. Matplotlib Simple Pie
- 17.5. Matplotlib Simple Pie with params
- 17.6. Matplotlib Pie
- 17.7. Matplotlib Pie (test cases)
- 17.8. Plot, scatter, histogram
- 18. Seaborn
- 18.1. Searborn use examples
- 18.2. Seaborn tip
- 18.3. Seaborn Anscombes Quartet
- 19. Tox
- 19.1. Tox Examples
- 20. Selenium
- 20.1. Selenium installation
- 20.2. Get started with Selenium
- 20.3. Selenium Headless Screenshot
- 21. Playwright
- 21.1. Playwright installation
- 21.2. Playwright demo
- 21.3. Playwright screenshot
- 22. Advancted functions
- 22.1. Variable scopes
- 22.2. Name resolution order (LEGB)
- 22.3. Scoping: global seen from fuction
- 22.4. Assignment creates local scope
- 22.5. Local scope gone wrong
- 22.6. Changing global variable from a function
- 22.7. Global variables mutable in functions
- 22.8. Scoping issues
- 22.9. sub in sub
- 22.10. Scoping sub in sub (enclosing scope)
- 22.11. Function objects
- 22.12. Functions are created at run time
- 22.13. Mutable default
- 22.14. Use None as default parameter
- 22.15. Inner function created every time the outer function runs
- 22.16. Static variable
- 22.17. Static variable in generated function
- 22.18. Inspect
- 23. Variable number of function arguments
- 23.1. Python function arguments - a reminder
- 23.2. Functions with unknown number of argumerns
- 23.3. Variable length argument list with * and **
- 23.4. Passing arguments as they were received (but incorrectly)
- 23.5. Unpacking args before passing them on
- 23.6. Exercise: implement the my_sum function
- 23.7. Solution: implement the my_sum function
- 23.8. Exercise: implement the reduce function
- 23.9. Soluton: implement the reduce function
- 23.10. Exercise: sort pairs
- 23.11. Solution: sort pairs
- 24. Python Packages
- 24.1. Why Create package
- 24.2. Create package
- 24.3. Internal usage
- 24.4. use module in package - relative path
- 24.5. use package (does not work)
- 24.6. package importing (and exporting) module
- 24.7. use package (module) with import
- 24.8. use package with import
- 24.9. Creating an installable Python package
- 24.10. Create tar.gz file
- 24.11. Install Package
- 24.12. Dependencies
- 24.13. Add README file
- 24.14. Add README file (setup.py)
- 24.15. Include executables
- 24.16. Add tests
- 24.17. Add tests calc
- 24.18. Add tests all
- 24.19. setup.py
- 24.20. Run tests and create package
- 24.21. Exercise: package
- 24.22. Exercise: create executable
- 25. Distribution of Python code
- 25.1. Distribution demo 1
- 25.2. Distribution demo 2
- 25.3. Distribution demo 3
- 26. Distribute Python application as an exe
- 26.1. Packaging applications (creating executable binaries)
- 26.2. Using PyInstaller
- 26.3. Other PyInstaller examples
- 26.4. Other
- 26.5. Py2app for Mac
- 27. Ctypes
- 27.1. ctypes - hello
- 27.2. concat
- 27.3. links
- 28. 2to3
- 28.1. Convertig from Python 2 to Python 3
- 28.2. division
- 28.3. print in Python 2
- 28.4. print in Python 3
- 28.5. input and raw_input
- 28.6. Code that works on both 2 and 3
- 28.7. Compare different types
- 28.8. Octal numbers
- 28.9. 2to3 Resources
- 29. Design Patterns
- 29.1. What are Design Patterns?
- 29.2. Don't replace built-in objects
- 29.3. Facade - simple interface to complex system
- 29.4. Monkey Patching
- 29.5. Creation DPs "Just One"
- 29.6. Singleton
- 29.7. Monostate (Borg)
- 29.8. Dispatch table
- 30. Improving Performance - Optimizing code
- 30.1. Problems
- 30.2. Optimization strategy
- 30.3. Locate the source of the problem
- 30.4. Optimizing tactics
- 30.5. DSU: Decorate Sort Undecorate
- 30.6. Profile code
- 30.7. Slow example
- 30.8. profile slow code
- 30.9. cProfile slow code
- 30.10. Benchmarking
- 30.11. Benchmarking subs
- 30.12. Counting words - which implementation is faster?
- 30.13. for loop or reduce to add numbers?
- 30.14. Levenshtein distance
- 30.15. Generate words
- 30.16. Levenshtein - pylev
- 30.17. Levenshtein - editdistance
- 30.18. Editdistance benchmark
- 30.19. A Tool to Generate text files
- 30.20. Count characters
- 30.21. Memory leak
- 30.22. Garbage collection
- 30.23. Weak reference
- 30.24. Exercise: benchmark list-comprehension, map, for
- 30.25. Exercise: Benchmark Levenshtein
- 30.26. Exercise: sort files
- 30.27. Exercise: compare split words:
- 30.28. Exercise: count words
- 31. Python Pitfalls
- 31.1. Reuse of existing module name
- 31.2. Use the same name more than once
- 31.3. Compare string and number
- 31.4. Compare different types
- 31.5. Sort mixed data
- 32. Linters
- 32.1. Static Code Analyzis - Linters
- 32.2. PEP8
- 32.3. F811 - redefinition of unused
- 32.4. Warn when Redefining functions
- 33. Signals
- 33.1. Signals and Python
- 33.2. Sending Signal
- 33.3. Catching Signal
- 33.4. Catching Ctrl-C on Unix
- 33.5. Catching Ctrl-C on Unix confirm
- 33.6. Alarm signal and timeouts
- 33.7. Exercise: Catching Ctrl-C on Unix 2nd time
- 33.8. Exercise: Signals
- 33.9. Ctrl-z
- 34. Data Science
- 34.1. Data Scince Resources
- 35. FAQ
- 35.1. How not to name example scirpts?
- 35.2. Platform independent code
- 35.3. How to profile a python code to find causes of slowness?
- 35.4. pdb = Python Debugger
- 35.5. Avoid Redefining functions
- 36. Algorithm
- 36.1. Exercise: Find the odd value
- 36.2. Solution: Find the odd value
- 36.3. Exercise: Generalized find the odd value
- 36.4. Solution: Generlized Find the odd value
- 36.5. Exercise: Shortest sublist with sum over limit
- 36.6. Solution: Shortest sublist with sum over limit
- 37. Refactor
- 37.1. Refactoring example - change variable name
- 37.2. How to Refactor
- 37.3. Exercise: Fix deep indentation
- 38. Overview of Python syntax
- 38.1. Scalars
- 38.2. Numbers
- 38.3. Strings
- 38.4. int - float - string conversion
- 38.5. Booleans
- 38.6. Lists
- 38.7. Queue and Stack
- 38.8. Dictionaries
- 38.9. Tuples
- 38.10. Sets
- 38.11. I/O
- 38.12. STDIN - Standard input
- 38.13. CLI
- 38.14. Control flow
- 38.15. While - Loops
- 38.16. For - Loops
- 38.17. Conditionals
- 38.18. Comparision operators
- 38.19. Boolean operators
- 38.20. The conditional (ternary) operator
- 38.21. Random Values
- 38.22. Math
- 38.23. Exceptions
- 38.24. Files
- 38.25. Functions
- 38.26. Modules
- 39. Serialization (Marshalling)
- 39.1. Why Serialization is needed?
- 39.2. Questions to ask
- 39.3. Various tools for serialization
- 39.4. Serialization with h5py
- 39.5. Serialization of single Numpy array
- 39.6. Serialization of multiple Numpy arrays
- 40. Other slides
- 40.1. Other slides
- 40.2. Atom for Python
- 40.3. IDLE - Integrated DeveLopment Environment
- 40.4. sh-bang - executable on Linux/Apple
- 40.5. pydoc
- 40.6. Spyder Intro
- 40.7. Interactive Debugging
- 40.8. Parameter passing
- 40.9. Command line arguments and main
- 40.10. Name of the current function in Python
- 40.11. Name of the caller function in Python
- 40.12. Stack trace in Python using inspect
- 40.13. Getting the class name of an object
- 40.14. Circular references
- 40.15. Context managers: with (file) experiments
- 40.16. range vs xrange in Python
- 40.17. profile (with hotshot) slow code
- 40.18. Python Descriptors
- 40.19. Python from .NET
- 40.20. Matplotlib subplot
- 40.21. Jupyter StackOverflow - historgram
- 40.22. Jupyter StackOverflow - OpenSourcer
- 40.23. Jupyter StackOverflow - cross tabulation
- 40.24. Jupyter StackOverflow - salaries
- 40.25. Jupyter StackOverflow - replace values
- 40.26. NameError
- 40.27. UnboundLocalError
- 40.28. Insert element in sorted list using bisect
- 40.29. Gravatar in Python
- 40.30. Debug with ptpython
- 40.31. REPL - Interactive debugging with ptpython
- 40.32. Print in color on the CLI
- 40.33. Easy Install
- 40.34. sorting with sorted using a key
- 40.35. get and set locale
- 40.36. Modify time anomality
- 40.37. Some strange code
- 40.38. is vs ==
- 40.39. print_function
- 40.40. Dividers (no break or continue)
- 40.41. Remove file
- 40.42. Modules: more
- 40.43. import hooks
- 40.44. Python resources
- 40.45. Progress bar
- 40.46. from __future__
- 40.47. Variable scope
- 40.48. scope
- 40.49. type
- 40.50. Look deeper in a list