Python Tutorials - Herong's Tutorial Examples - v2.14, by Herong Yang
Python Tutorials - Herong's Tutorial Examples
https://www.herongyang.com/Python
Copyright © 2011-2023 Herong Yang. All rights reserved.
This Python tutorial book is a collection of notes and sample codes written by the author while he was learning Python language himself. Topics include: installing Python environments on Windows, macOS and Linux computer; Python built-in data types; variables, operations, expressions and statements; user-defined functions; iterators, generators and list comprehensions; modules and packages; sys, os, and pathlib modules; Anaconda Python environment manager; Jupyter Notebooks; NumPy, SciPy libraries. Updated in 2023 (Version v2.14) with minor changes.
Table of Contents
Using Python Shell at python.org
Running Python Code at pythonanywhere.com
Python IDE at online-python.com
Install New Versions of Python on macOS
pip3 - Package Installer for Python 3
Install Python 2 Environment on CentOS
Common Features of All Data Types
Data Type - NoneType for Nothing
Data Type - 'bool' for Boolean Values
Data Type - 'int' for Integer Values
Data Type - 'float' for Real Numbers
Data Type - 'bytes' for Byte Sequence
Data Type - 'str' for Character String
Data Type - 'tuple' for Immutable List
Data Type - 'list' for Mutable List
Data Type - 'dict' for Dictionary Table
Variables, Operations and Expressions
Conditional Expression - Ternary Operation
Assignment Expression - Walrus Operation
"pass" Statement - Do Nothing Statement
Expression Statement - One Expression Only
"=" Statement - Assignment Statement
"del" Statement - Delete Statement
"import" Statement to Load Modules
"if" Statement for Conditional Execution
"while" Statement for Execution Loop
"for" Statement for Iterative Execution
"try" Statement to Catch Execution
"with" Statement for Context Manager
"match" Statement for Pattern Match
Function Statement and Function Call
Iterators, Generators and List Comprehensions
"import module" - Two-Step Process
sys.modules - Listing Loaded Modules
importlib.reload(module) - Reloading Module
"from module import member" Statement
"from module import *" Statement
__pycache__/module.version.pyc Files
Packages and Package Directories
Use "os" Module to Create Child Processes
Use "os" Module to Manage Files
"pathlib" - Object-Oriented Filesystem Paths
"pathlib.Path" - Path for Both Linux and Windows
"pathlib.Path" - Read and Write Operations
"pip" - Package Installer for Python
What Is "pip/pip2/pip3" Command
Use "pip" Package in Python Script
Install MySQL Connector/Python with "pip"
Using "pip" with Different Sources
Commonly Used Python Packages/Libraries
SciPy.org - Python Libraries for Science
NumPy - Python Library for Matrix operations
SciPy - Python Library for Mathematical Functions
pandas - Data Analysis and Manipulation
pandas.DataFrame/pandas.core.frame.DataFrame - The Table Class
pandas.core.series.Series - The Column Class
File Input and Output for DataFrame
Anaconda - Python Environment Manager
Introduction to Conda Environment
Share Conda Environment with Others
Manage Packages in Conda Environment
Run Conda Environment Command in Background
Jupyter Notebook and JupyterLab
Free Access of Jupyter Notebook and JupyterLab
Keywords: Python, Script, Language, Tutorial, Example