更新时间:2021-06-10 19:06:38
coverpage
Title Page
About Packt
Why subscribe?
Packt.com
Contributors
About the author
About the reviewers
Packt is searching for authors like you
Preface
Who this book is for
What this book covers
To get the most out of this book
Download the example code files
Download the color images
Conventions used
Get in touch
Reviews
The Fundamentals of Python
What is Python?
Python versions
Interpreted versus compiled
Dynamic versus static
Python 2 versus Python 3 division
Working with Python
Installation
Launching the Python interpreter
Windows (Win8 and above)
Mac
Using the Python command prompt
Commenting Python code
Launching Python programs
Using the IPython shell
Summary
Data Types and Modules
Structuring code
Multiple line spanning
Common data types
Python numbers
Strings
Basic string operations
Indexing and slicing strings
String formatting
Combining and separating strings
Lists
List usage
Adding list elements
Mutability
Dictionaries
Creating dictionaries
Working with dictionaries
Dictionary details
Tuples
Why use tuples?
Sequence unpacking
Sets
Using data type methods
Sequence methods
String methods
List methods
Tuple methods
Dictionary methods
Set methods
Importing modules
Namespaces
Dot nomenclature
Types of imports
Modules as scripts
Logic Control
if...else statements
Loops
while loops
for loops
zip() function
Exceptions
Exception class hierarchy
User-defined exceptions
Final thoughts
Functions and Object Oriented Programming
Working with functions
Lambdas
Classes methods and namespaces
How are classes better?
Classes and instances
Modules
Inheritance
Operator overloading
Properties and class and static methods
Properties
Getters and setters
Class and static methods
Files and Databases
File I/O
Files and streams
Reading from a file
Iterating through files
Seeking