Comprehensive Guide to Python Programming
Comprehensive Guide to Python Programming
SXC LIBRARY
Preface.
KXiii
125146
J2
-22
X Core Python
Comments in Python 46
Single line comments 46
Multi line comments.. 46
Docstrings. 47
How Python Sees Variables. 49
Datatypes in Python .51
Built-in datatypes ...51
The None Type .51
Numeric Types 52
Representing Binary, Octal and Hexadecimal Numbers 53
Converting the Datatypes Explicitly. . . . 53
bool Datatype .55
Sequences in Python..... 56
str Datatype .56
bytes Datatype .57
bytearray Datatype . .58
list Datatype 59
tuple Datatype 59
range Datatype. 60
Sets. 61
set Datatype........ .61
frozenset Datatype ...62
Mapping Types.. 62
Literals in Python ....7.. .63
Numeric Literals. 64
Boolean Literals 64
String Literals .64
Determining the Datatype of a Variable . .65
What about Characters. .66
User-defined Datatypes.. .67
Constants in Python ,67
Identifiers and Reserved words.. .67
Narning Conventions in Python ....
Points to Remember.
Operator. 71
Arithmetic Operators .72
Table of Contents xi
340
Classes and Objects
...343
Encapsulation. 344
Abstraction
347
Inheritance
348
Polymorphism 349
Points to Remember.
351
Chapter 13: Classes and Objects
351
Creating a Class 355
The Self Variable.
355
Constructor
.357
Types of Variables.......
359
Namespaces .....361
Types of Methods.
361
Instance Methods
364
Class Methods.
Static Methods 364
367
Passing Members of One Class to AnotherClass.
.369
Inner Classes..
Points to Remember ...371
.510
Points to Remember. 514
Sockets
Knowing IP Address .626
URL.. .628
Reading the Source Code of a Web Page .628
Downloading a Web Page from Internet 630
Downloading an Image from Internet.. ....631
A TCP/IP Server. ....632
.634
A TCP/IP Client
AUDP Server. .635
A UDP Client 637
File Server .638
File Client. 640
641
Two-Way Communication between Server and Client.........
642
N Sending a Simple Mail
Points to Rememnber. .644
.647
Chapter 24: Python's Database Connectivity 649
DBMS
.649
Advantages of a DBMS over Files
.649
Types of Databases Used with Python
650
Installation of MySQL Database Software 651
Verifying MySQL in the Windows Operating System...... 660
Installing MySQLdb Module 661
Verifying the MySQLdb Interface Installation. 663
Working with MySQL Database 663
Using MySQL from Python 665
/Retrieving All Rows from a Table 666
/Inserting Rows into a Table. 669
Deleting Rows from a Table. 672
Updating Rows in a Table 673
,Creating Database Tables through Python. 674
Installation of Oracle 1lg... 678
Verifying Oracle Installation in Windows Operating System 682
Installing Oracle Database Driver... 683
Verifying the Driver Installation 683
Working with Oracle Database 684
Using Oracle Database from Python 686
Stored Procedures 689
Points to Remember.. .691
Table of Contents Xxi