Python Programming by Example

by Agus Kurniawan 22. November 2015 05:43


I released a new book "Python Programming by Example". This book helps you to learn how to program in Python. Several code and scenario samples are provided to accelerate your learning. All scripting samples are written in Python 3.x.

Table of Content

1. Development Environment

1.1 Installation

1.2 Development Tools

1.3 Python Shell

1.4 Running Python Application from Files

2. Python Programming Language

2.1 Common Rule

2.2 Variables

2.3 Comment

2.4 Arithmetic Operations

2.5 Mathematical Functions

2.6 Increment and Decrement

2.7 Getting Input from Keyboard

2.8 Python Operators

2.8.1 Comparison Operators

2.8.2 Logical Operators

2.8.3 Bitwise Opeators

2.8.4 Testing All

2.9 Decision Control

2.10 Iteration - for and while

2.11 break, continue and pass

2.12 Date & Time

3. Lists, Tuples and Dictionary

3.1 Lists

3.2 Tuples

3.3 Dictionary

4. Functions

4.1 Creating A Simple Function

4.2 Function with Parameters and Returning Value

4.3 Function with Multiple Returning Values

4.4 Recursion Function

4.5 Testing

5. Python Object Oriented

5.1 Creating Classes

5.2 Class Attributes

5.3 Built-In Class Attributes

5.4 Destroying Class Object

5.5 Write them All

5.6 Inheritance

5.7 Overriding Methods

5.8 Overloading Operators

6. Python Modules and Packages

6.1 Python Modules

6.2 import Statement

6.3 from...import * Statement

6.4 Installing External Python Package

7. String Operations

7.1 Getting Started

7.2 Concatenating Strings

7.3 String To Numeric

7.4 Numeric to String

7.5 String Parser

7.6 Check String Data Length

7.7 Copy Data

7.8 Upper and Lower Case Characters

7.9 Testing A Program

8. File Operations

8.1 Getting Started

8.2 Writing Data Into A File

8.2.1 Creating a File

8.2.2 Writing Data

8.2.3 Closing a File

8.2.4 Demo

8.3 Reading Data From A File

9. Error Handling

9.1 Error Handling

9.2 Catching All Errors

9.3 Raising Exceptions

9.4 Custom Exception

10. Building Own Python Module

10.1 Creating Simple Module

10.2 Building Own Python Package

11. Concurrency

11.1 Getting Started

11.2 Threading

11.3 Synchronizing Threads

11.3.1 Mutex Locks

11.3.2 Event

11.4 Queue

11.5 Multiprocessing

11.5.1 Process

11.5.2 Synchronizing Processes

11.6 Parallel Tasks

11.6.1 ThreadPoolExecutor

11.6.2 ProcessPoolExecutor

12. Encoding

12.1 Getting Started

12.2 Encoding Base64

12.3 Hexadecimal

12.4 JSON

12.5 XML

12.6 CSV

13. Hashing and Cryptography

13.1 Getting Started

13.2 Hashing

13.2.1 Hashing with MD5

13.2.2 Hashing with SHA1 and SHA256

13.2.3 Hashing with Key Using HMAC

13.2.4 Write them All

13.3 Cryptography

13.3.1 Symmetric Cryptography

13.3.2 Asymmetric Cryptography

14. Database Programming

14.1 Database for Python

14.2 MySQL Driver for Python

14.3 Testing Connection

14.4 CRUD (Create, Read, Update and Delete) Operations

14.4.1 Create Data

14.4.2 Read Data

14.4.3 Update Data

14.4.4 Delete Data

14.4.5 Write them All

15. Socket Programming

15.1 Socket Module

15.2 Hello World

15.3 Client/Server Socket

15.3.1 Server Socket

15.3.2 Client Socket

15.3.3 Testing

16. Python Regular Expressions

16.1 Getting Started

16.2 Demo

17. Python GUI Programming

17.1 Getting Started

17.2 Hello Python GUI

17.3 Working with Input Form

17.4 Working with Common Dialogs

18. Python Unit Testing

18.1 Getting Started

18.2 Demo


How to Buy

You can get this book on the following online store:


Amazon Kindle,

Google Play Books,




Books | Python

blog comments powered by Disqus

About Agus Kurniawan

Agus Kurniawan

For more detail about me click here [V]

Please entry your name into my guestbook [V]

If you want to contact me, please go here [V]

Go here for my professional services [V]

My Books

Arduino Pro Mini A Hands-On Guide for Beginner 

Arduino Pro Micro A Hands-On Guide for Beginner  Arduino Nano A Hands-On Guide for Beginner

Python and SQL Server Development  Coral Dev Board I/O Programming Using Python

Digi XBee3 Zigbee 3 Development Workshop  Microchip MPLAB Xpress Development Workshop

DFRobot Romeo V2 Development Workshop  Getting Started with Coral Dev Board

Arduino Sketch for ESP8266 Development Workshop  Internet of Things Projects with ESP32

Teensy LC Development Workshop  Arduino Sketch for STM8 Development Workshop

Sigfox Development with SiPy, LoPy4, FiPy  Sigfox Development with STM32 B-L072Z-LRWAN1

Arduino Sketch for STM32 Development Workshop  Arduino MKR ZERO Development Workshop

Administering and Developing Azure SQL Database  Pycom WiPy 3.0 Development Workshop

Getting Started with Ubuntu Core for Raspberry Pi 3  Practical Kotlin Programming

Arduino Sketch for ESP32 Development Workshop  Building Wireless Sensor Networks with ESP32 LoRa

Getting Started with ACKme Mackerel AMW004 Development  NodeMCU for ESP32 Development Workshop 

Arduino MKR WIFI 1010 Development Workshop  IOIO-OTG Development Workshop

MicroPython for STM32 Nucleo Technical Workshop  STM32 Nucleo-32 Development Workshop

Learn CloudFormation  SparkFun nRF52832 Development Workshop

LinkIt Smart 7688 and LinkIt Smart 7688 Duo Development Workshop  CircuitPython Development Workshop

MicroPython for BBC micro:bit Technical Workshop  RedBear Blend v2 Development Workshop

Realtek Ameba RTL8195 Technical Workshop  Practical Contiki-NG: Programming for Wireless Sensor Networks

ESPectro32 Technical Workshop STEMTera Development Workshop

BeagleBone Black Wireless Technical Workshop Arduino MKR GSM 1400 Development Workshop

Dragino LoRa Development Workshop Learning AWS IoT

Tessel 2 Development Workshop Raspberry Pi Compute Module 3 Technical Workshop

Vue.js Programming by Example Administering and Developing SQL Server 2017 for Linux

Arduino MKRFOX1200 Development Workshop  Intelligent IoT Projects in 7 Days

Teensy Development Workshop Teensy 3.5 and Teensy 3.6 Boards Edition OpenMV Development Workshop

ESPresso Lite V2.0 Development Workshop  MicroPython for ESP32 Development Workshop

Arduino FIO Development Workshop  Getting Started with Android Things for Raspberry Pi 3

Pycom WiPy 2.0 Development Workshop  XBee ZigBee Development Workshop

SparkFun ESP32 Thing Development Workshop Getting Started With BBC micro:bit

Getting Started With Raspberry Pi Zero W Espruino Pico Development Workshop

Getting Started with ASP.NET Core for OS X, Linux, and Windows  Arduino TIAN Development Workshop

SimpleLink Wi-Fi CC3200 LaunchPad Development Workshop  MicroPython for ESP8266 Development Workshop

Smart Internet of Things Projects  Arduino UNO WiFi Development Workshop

XBee Wi-Fi development workshop SparkFun Simblee BLE Development Workshop

Mengenal Microsoft Azure ML Getting Started with Windows 10 IoT Core for Raspberry Pi 3

Arduino and Genuino Zero Development Workshop Go and SQL Server Programming By Example

Arduino and Genuino MKR1000 Development Workshop  Mengenal Microsoft Azure IoT

Getting Started with Raspberry Pi 3 PHP and PostgreSQL Programming By Example

Arduino and Genuino 101 Development Workshop Getting Started with Raspberry Pi Zero

Getting Started with Arduino Wiring for Windows 10 IoT Core Getting Started with Wolfram Language and Mathematica for Raspberry Pi

Arduino Uno: A Hands-On Guide for Beginner Arduino Leonardo and Arduino Micro: A Hands-On Guide for Beginner

RedBearLab CC3200 Development Workshop The Photon Kit Development Workshop

Python Programming by Example Raspberry Pi LED Blueprints

Bluno Beetle Development Workshop BeagleBone Black Programming using Matlab

Arduino Programming using MATLAB Digispark USB Development Workshop

Near Field Communication (NFC) for Embedded Applications Arduino Development for OSX and iOS

SparkFun ESP8266 Thing Development Workshop Teensy Development Workshop

Getting Started with Windows 10 for Raspberry 2 NodeMCU Development Workshop

Getting Started with ASP.NET 5 for OS X, Linux, and Windows Getting Started with Windows Remote Arduino

Redis Programming by Example The Hands-on ARM mbed Development Lab Manual

Getting Started With STM32 Nucleo Development Getting Started with Windows IoT and Intel Galileo

Learning C by Example Getting Started with Raspberry Pi 2

Getting Started with Arduino and Go The Hands-on Arduino Yún Manual Lab

The Hands-on MEAN Lab Manual, Volume 1 Go Programming by Example

Getting Started with Scratch for pcDuino Raspberry Pi Wireless Networks

BeagleBone Black Programming by Example Database Programming Using R

Learning R in 120 Minutes The Hands-on Intel Edison Manual Lab

Getting Started with pcDuino3 TI ARM Cortex-M LaunchPad Programming by Example

Raspberry Pi I/O Programming using Python Getting Started with Intel IoT and Intel Galileo

Pemrograman Java Tingkat Lanjut PHP and MongoDB Programming By Example

ASP.NET SignalR Programming By Example KnockoutJS Programming by Example

Getting Started with Java ME Embedded 8 and Raspberry Pi XBee IEEE 802.15.4 Programming

Raspberry Pi System Programming for Beginner Backbone.js Programming By Example

PHP and SQL Server Programming By Example AngularJS Programming by Example

jQuery Programming by Example Getting Started with Arduino and Ruby

Raspberry Pi Command Line for Beginner Getting Started with Arduino and Python

MSP430 LaunchPad Programming TypeScript Programming by Example

Getting Started with Matlab Simulink and Arduino SQL Server for Node.js

Pocket Reference: Netduino for Beginner Database Programming using Matlab

Pocket Reference: Basic Sensors in Windows 8 Getting Started with Matlab Simulink and Raspberry Pi

Getting Started with Arduino and Java  Pocket Reference: Raspberry Pi Programming

Getting Started with Arduino and Matlab Getting Started with Arduino and .NET

Pocket Reference: Raspberry Pi Getting Started with Arduino and Node.js

MongoDB for VB.NET Panduan Praktis Windows Azure

Network Forensics: Panduan Analisis Dan Investigasi Paket Data Jaringan Menggunakan Wireshark Object-Relational Mapping (ORM): MongoDB, Mongoosejs and Node.js By Example

Nodejs Programming by Example MongoDB for by Example

Pemrograman Parallel Dengan MPI dan C Panduan Lengkap iPad 2 Untuk Pemula

Pemrograman Jaringan Dengan Java Aplikasi Pilihan iPad Untuk Anak-Anak

Buku lainnya [V]

Agus Kurniawan is Microsoft MVP (Most Valuable Professional)

Agus Kurniawan- Github Profile

Agus Kurniawan- Codeplex Profile

Follow Me

Follow agusk2010 on Twitter

Month List