Contents
- Getting Started
- First Python program
- Creating variables and assigning values
- Block Indentation
- Datatypes
- Collection Types
- IDLE - Python GUI
- User Input
- Built in Modules and Functions
- Creating a module
- Installation of Python 2.7.x and 3.x
- String function - str and repr
- Installing external modules using pip
- Help Utility
- List comprehension
- Basics of list comprehensions
- Conditional List Comprehensions
- Avoid repetitive and expensive operations using conditional clause
- Dictionary Comprehensions
- List Comprehensions with Nested Loops
- Generator Expressions
- Set Comprehensions
- Refactoring filter and map to list comprehensions
- Comprehensions involving tuples
- Counting Occurrences Using Comprehension
- Changing Types in a List
- Filter
- List
- List
- List methods and supported operators
- 0Accessing list values
- Checking if list is empty
- Iterating over lists
- Checking whether an item is in a list
- Iterating over a list
- Any and All
- Length of a list
- Concatenate and Merge lists
- Reversing list elements
- Remove duplicate values in list
- Accessing values of a dictionary
- Comparison of lists
- The dict constructor
- Accessing values in nested list
- Initializing a List to a Fixed Number of Elements
- Functions
- Functions
- Defining and calling simple functions
- Defining a function with an arbitrary number of arguments
- Lambda Inline, Anonymous Functions
- Defining a function with optional arguments
- Defining a function with optional mutable arguments
- Argument passing and mutability
- Returning values from functions
- Closure
- Forcing the use of named parameters
- Defining a function with arguments
- Recursive functions
- Recursion limit
- Nested functions
- Recursive Lambda using assigned variable
- Defining a function with multiple arguments
- Iterable and dictionary unpacking
- Decorators
- Math module
- Loops
- Loops
- Changing the sequence you are iterating over
- Break and Continue in Loops
- For loops
- Iterating over lists
- Loops with an else clause
- Iterating over dictionaries
- The Pass Statement
- While Loop
- Iterating different portion of a list with different step size
- The half loop do-while
- Looping and Unpacking
- Random module
- Comparisons
- Importing modules
- Sorting Minimum and Maximium
- Operator module
- Variable Scope and Binding
- Basic Input and Output
- Files, Folders, I/O
- Files, Folders, I/O
- File modes
- Reading a file line-by-line
- Iterate files recursively
- Getting the full contents of a file
- Writing to a file
- Check whether a file or path exists
- Random File Access Using mmap
- Copying contents of one file to a different file
- Copy a directory tree
- Read a file between a range of lines
- Replacing text in a file
- Checking if a file is empty
- JSON Module
- String Methods
- String Methods
- Changing the capitalization of a string
- str.translate Translating characters in a string
- str.format and f-strings Format values into a string
- String modules useful constants
- Replace all occurrences of one substring with another substring
- Reversing a string
- Testing what a string is composed of
- Split a string based on a delimiter into a list of strings
- Stripping unwanted leading/trailing characters from a string
- String Contains
- Join a list of strings into one string
- Counting number of times a substring appears in a string
- Case insensitive string comparisons
- Test the starting and ending characters of a string
- Justify strings
- Conversion between str or bytes data and unicode characters
- Metaclasses
- Indexing and Slicing
- Generators
- Generators
- Introduction
- Infinite sequences
- Sending objects to a generator
- Yielding all values from another iterable
- Iteration
- The next function
- Coroutines
- Refactoring list-building code
- Yield with recursion recursively listing all files in a directory
- Generator expressions
- Using a generator to find Fibonacci Numbers
- Searching
- Iterating over generators in parallel
- Chaining multiple iterators together
- Simple Mathematical Operators
- Reduce
- Map Function
- Exponentation
- Exponentiation
- Exponentiation using builtins and pow
- Square root math.sqrt and cmath.sqrt
- Modular exponentiation pow with 3 arguments
- Exponentiation using the math module math.pow
- Exponential function math.exp and cmath.exp
- Exponential function minus 1 math.expm1
- Magic methods and exponentiation builtin math and cmath
- Roots nth-root with fractional exponents
- Computing large integer roots
- Searching
- Searching
- Searching for an element
- Getting the index for strings str.index str.rindex and str.find str.rfind
- Getting the index list and tuples list.index tuple.index
- Searching keys for a value in dict
- Getting the index for sorted sequences bisect.bisect left
- Searching nested sequences
- Searching in custom classes contains and iter
- Dictionary
- Dictionary
- Introduction to Dictionary
- Avoiding KeyError Exceptions
- Iterating Over a Dictionary
- Dictionary with default values
- Merging dictionaries
- Unpacking dictionaries using the ** operator
- Creating an ordered dictionary
- Creating a dictionary
- Accessing values of a dictionary
- Accessing keys and values
- All combinations of dictionary values
- The trailing comma
- The dict constructor
- Dictionaries Example
- Classes
- Classes
- Introduction to classes
- Bound unbound and static methods
- Basic inheritance
- Monkey Patching
- New-style vs. old-style classes
- Class methods alternate initializers
- Untitled
- Properties
- Using the property decorator for read-write properties
- Singleton class
- Default values for instance variables
- Class composition
- Class and instance variables
- Listing All Class Members
- Setting the ABCMeta metaclass
- Using the property decorator
- Descriptors and Dotted Lookups
- Counting
- Counting all occurrence of all items in an iterable collections.Counter
- Getting the most common value-s collections.Counter.most common
- Counting the occurrences of one item in a sequence list.count and tuple.count
- Counting the occurrences of a substring in a string str.count
- Counting occurrences in numpy array
- Manipulating XML
- Date and Time
- Date and Time
- Parsing a string into a timezone aware datetime object
- Constructing timezone-aware datetimes
- Basic datetime objects usage
- Computing time differences
- Simple date arithmetic
- Subtracting months from a date accurately
- Converting timestamp to datetime
- Switching between time zones
- Fuzzy datetime parsing extracting datetime out of a text
- Parsing an arbitrary ISO 8601 timestamp with minimal libraries
- Parsing a string with a short time zone name into a timezone aware datetime object
- Iterate over dates
- Get an ISO 8601 timestamp
- Set
- Collections module
- Parallel computation
- Multithreading
- Writing C extensions
- Unit Testing
- Regular Expressions
- Regular Expressions Regex
- Matching the beginning of a string
- Searching
- Precompiled patterns
- Flags
- Splitting a string using regular expressions
- Replacing
- Find All Non-Overlapping Matches
- Checking for allowed characters
- Grouping
- Escaping Special Characters
- Iterating over matches using re.finditer
- Match an expression only in specific locations
- Bitwise Operators
- Incompatibilities moving from Python 2 to Python 3
- 000Incompatibilities moving from Python 2 to Python 3
- Integer Division
- Unpacking Iterables
- Strings Bytes versus Unicode
- Print statement vs. Print function
- Differences between range and xrange functions
- Raising and handling Exceptions
- Leaked variables in list comprehension
- True False and None
- User Input
- Comparison of different types
- .next method on iterators renamed
- filter map and zip return iterators instead of sequences
- Renamed modules
- long vs. int
- Removed operators and synonymous with and repr
- Reduce is no longer a built-in
- All classes are new-style classes in Python 3
- AbsoluteRelative Imports
- map
- The round function tie-breaking and return type
- cmp function removed in Python 3
- File IO
- Return value when writing to a file object
- Octal Constants
- encode / decode to hex no longer available
- exec statement is a function in Python 3
- Dictionary method changes
- Class Boolean Value
- hasattr function bug in Python 2
- Virtual environments
- Virtual environments
- Creating and using a virtual environment
- Specifying specific python version to use in script on UnixLinux
- Creating a virtual environment for a different version of python
- Making virtual environments using Anaconda
- Managing multiple virtual enviroments with virtualenvwrapper
- Installing packages in a virtual environment
- Discovering which virtual environment you are using
- Using virtualenv with fish shell
- Checking if running inside a virtual environment
- Copying data
- Tuple
- Context Managers with Statement
- Hidden Features
- Enum
- String Formatting
- String Formatting
- Basics of String Formatting
- Alignment and padding
- Format literals f-string
- Float formatting
- String formatting with datetime
- Named placeholders
- Formatting Numerical Values
- Nested formatting
- Format using Getitem and Getattr
- Padding and truncating strings combined
- Custom formatting for a class
- Conditionals
- Conditionals
- Conditional Expression or The Ternary Operator
- if, elif and else
- Truth Values
- Boolean Logic Expressions
- Using the cmp function to get the comparison result of two objects
- 0Else statement
- If statement
- Testing if an object is None and assigning it
- Conditional Expression Evaluation Using List Comprehensions
- Complex math
- Unicode and bytes
- The __name__ special variable
- Check if path exists
- Networking
- Asyncio Module
- Print Function
- os.path module
- Creating Python packages
- Parsing Command Line Arguments
- Parsing Command Line arguments
- Hello world in argparse
- Using command line arguments with argv
- Setting mutually exclusive arguments with argparse
- Basic example with docopt
- Custom parser error message with argparse
- Conceptual grouping of arguments with argparse.add argument group
- Advanced example with docopt and docopt dispatch
- HTML Parsing
- Subprocess Library
- setup.py
- List slicing
- Sockets
- Itertools Module
- Itertools Module
- itertools.dropwhile
- Combinations method in Itertools Module
- Take a slice of a generator
- Zipping two iterators until they are both exhausted
- Grouping items from an iterable object using a function
- itertools.takewhile
- itertools.count
- itertools.product
- itertools.repeat
- Get an accumulated sum of numbers in an iterable
- Cycle through elements in an iterator
- itertools.permutations
- Chaining multiple iterators together
- Recursion
- Boolean Operators
- dis module
- Type Hints
- pip PyPI Package Manager
- pip PyPI Package Manager
- Install Packages
- To list all packages installed using pip
- Upgrade Packages
- Uninstall Packages
- Updating all outdated packages on Linux
- Updating all outdated packages on Windows
- Create a requirements.txt file of all packages on the system
- Create a requirements.txt file of packages only in the current virtualenv
- Using a certain Python version with pip
- Installing packages not yet on pip as wheels
- locale module
- Exceptions
- Exceptions
- Catching Exceptions
- Do not catch everything
- Catching multiple exceptions
- Re-raising exceptions
- Exception Hierarchy
- Else
- Raising Exceptions
- Creating custom exception types
- Practical examples of exception handling
- Exceptions are Objects too
- Running clean-up code with finally
- Chain exceptions with raise from
- Web scraping
- Web scraping with Python
- Scraping using the Scrapy framework
- Basic example of using requests and lxml to scrape some data
- Maintaining web-scraping session with requests
- Scraping using Selenium WebDriver
- Scraping using BeautifulSoup4
- Modify Scrapy user agent
- Simple web content download with urllib.request
- Scraping with curl
- deque module
- Distributing self-contained applications
- Property Objects
- Overloading
- Debugging
- Reading and Writing CSV
- Dynamic code execution with exec and eval
- Dynamic code execution with exec and eval
- 0Executing code provided by untrusted user using exec eval or ast.literal eval
- Evaluating statements with exec
- Evaluating an expression with eval
- Precompiling an expression to evaluate it multiple times
- Evaluating an expression with eval using custom globals
- Evaluating a string containing a Python literal with ast.literal eval
- PyInstaller - Distributing Python Code
- Iterables and Iterators
- Data Visualization
- The interpreter command line console
- args and kwargs
- args and kwargs
- Using kwargs when writing functions
- Using args when writing functions
- Populating kwarg values with a dictionary
- Using kwargs when calling functions
- Keyword-only and Keyword-required arguments
- Using args when calling functions
- kwargs and default values
- Using args when calling functions
- functools module
- Garbage Collection
- Indentation
- Security and Cryptograhy
- Pickle data serialization
- urllib
- Binary Data
- Python and Excel
- Idioms
- Method Overriding
- Difference between a module and a package
- Data Serialization
- Python Concurrency
- RabbitMQ using AMQPStorm
- PostgreSQL
- Descriptor
- Common Pitfalls
- List multiplication and common references
- Mutable default argument
- Changing the sequence you are iterating over
- Integer and String identity
- Dictionaries are unordered
- Variable leaking in list comprehensions and for loops
- Chaining of or operator
- sys.argv0 is the name of the file being executed
- Accessing int literals attributes
- Global Interpreter Lock GIL and blocking threads
- Multiple return
- Pythonic JSON keys
- Multiprocessing
- Creating temporary files with tempfile
- Working with ZIP files
- Stack
- Profiling
- User-Defined Methods
- Working around Global Interpreter Lock
- Deployment using conda
- Logging
- Processes and Threads
- os module
- Comments and documentation
- Database Access
- Python HTTP Server
- Alternatives to switch statement from other languages
- List destructuring
- Accessing Python source code and bytecode
- Mixins
- Attribute Access
- ArcPy
- Python Anti-Patterns
- Plugin and Extension Classes
- Websockets
- Immutable data types
- String representations of class
- Arrays
- Arrays
- Access individual elements through indexes
- Basic Introduction to Arrays
- Append any value to the array using append method
- Insert value in an array using insert method
- Extend python array using extend method
- Add items from list into array using fromlist method
- Remove any array element using remove method
- Remove last array element using pop method
- Fetch any element through its index using index method
- Reverse a python array using reverse method
- Get array buffer information through buffer info method
- Check for number of occurrences of an element using count method
- Convert array to string using tostring method
- Convert array to a python list with same elements using tolist method
- Append a string to char array using fromstring method
- Operator Precedence
- Polymorphism
- Alternative Python implementations
- List Comprehensions
- Web Server Gateway Intrerface WSGI
- 2to3 tool
- Abstract Syntax Tree
- Abstract Base Classes
- Unicode
- ssh in Python
- Serial Communication with pyserial
- Neo4j
- Performance optimization
- Curses
- Templates
- pass statement
- Testing with py.test
- Date Formatting
- heapq
- tkinter
- CLI subcommands
- Defining functions with list arguments
- SQLite3 module
- Persistence with pickle
- Connecting to SQL Server
- Design Patterns
- Multidimensional arrays
- Audio
- pyglet
- queue module
- ijson
- webbrowser module
- base64 module
- Flask
- Groupby
- Sockets and Message Encryption / Decryption
- pygame
- Input Subset and Output External Data Files using Pandas
- hashlib
- Gzip
- ctypes
- Creating a Windows Service
- Mutable vs. Immutable
- configparser
- Common Exceptions
- Optical Character Recognition OCR
- Python Data Types
- Partial functions
- Generating graphs
- Unzipping Files
- Functional Programming
- Python Virtual Environment - virtualenv
- sys module
- virtual environment with virtualenvwrapper
- virtualenvwrapper on Windows
- Python Requests Post
- Plotting with Matplotlib
- A Simple Plot in Matplotlib
- Adding more features to a simple plot axis labels title axis ticks grid and legend
- Making multiple plots in the same figure by superimposition similar to MATLAB
- Making multiple Plots in the same figure using plot superimposition with separate plot commands
- Plots with Common X-axis but different Y-axis Using twinx
- Plots with common Y-axis and different X-axis using twiny
- Python Lex-Yacc
- pyaudio
- shelve
- pip and PyPI Package Manager
- Writing to CSV from String or List
- Raise Custom Errors Exceptions
- Using loops within functions
- Contributors