Lean Python -  Paul Gerrard

Lean Python (eBook)

Learn Just Enough Python to Build Useful Tools

(Autor)

eBook Download: PDF
2016 | 1st ed.
XXV, 87 Seiten
Apress (Verlag)
978-1-4842-2385-7 (ISBN)
Systemvoraussetzungen
34,99 inkl. MwSt
  • Download sofort lieferbar
  • Zahlungsarten anzeigen

Learn only the essential aspects of Python without cluttering up your mind with features you may never use. This compact book is not a 'best way to write code' type of book; rather, the author goes over his most-used functions, which are all you need to know as a beginner and some way beyond.

Lean Python takes 58 Python methods and functions and whittles them down to 15: as author Paul Gerrard says, 'I haven't found a need for the rest.'


What You'll Learn
  • Discover lean Python and how to learn just enough to build useful tools
  • Use Python objects, program structure, I/O, modules and more
  • Handle errors and exceptions 
  • Test your code
  • Access the Web; do searching; and persist data

Who This Book Is For

This book is aimed at three categories of reader: The experienced programmer - if you already know a programming language, this book gives you a shortcut to understanding the Python language and some of its design philosophy. 

You work in IT and need a programming primer - you might be a tester who needs to have more informed technical discussions with programmers. Working through the examples will help you to appreciate the challenge of good programming. 

First-timer - you want a first book on programming that you can assimilate quickly to help you decide whether programming is for you.



Paul Gerrard is a consultant, teacher, author, webmaster, programmer, tester, conference speaker, rowing coach and publisher.
Learn only the essential aspects of Python without cluttering up your mind with features you may never use. This compact book is not a "e;best way to write code"e; type of book; rather, the author goes over his most-used functions, which are all you need to know as a beginner and some way beyond.Lean Python takes 58 Python methods and functions and whittles them down to 15: as author Paul Gerrard says, "e;I haven't found a need for the rest."e;What You'll LearnDiscover lean Python and how to learn just enough to build useful toolsUse Python objects, program structure, I/O, modules and moreHandle errors and exceptions Test your codeAccess the Web; do searching; and persist dataWho This Book Is ForThis book is aimed at three categories of reader: The experienced programmer - if you already know a programming language, this book gives you a shortcut to understanding the Python language and some of its design philosophy. You work in IT and need a programming primer - you might be a tester who needs to have more informed technical discussions with programmers. Working through the examples will help you to appreciate the challenge of good programming. First-timer - you want a first book on programming that you can assimilate quickly to help you decide whether programming is for you.

Paul Gerrard is a consultant, teacher, author, webmaster, programmer, tester, conference speaker, rowing coach and publisher.

Contents at a Glance 4
Contents 5
About the Author 10
About the Technical Reviewer 11
Preface 12
Acknowledgments 19
Chapter 1: Getting Started 21
The Python Interpreter 21
Interactive Mode 21
Command-Line Mode 23
Coding, Testing and Debugging Python Programs 23
Comments, Code Blocks, and Indentation 24
Variables 25
Common Assignment Operations 25
Other Assignment Operations 26
Python Keywords 26
Special Identifiers 27
Python Modules 28
Typical Program Structure 28
Chapter 2: Python Objects 30
Object Types 30
Factory Functions 30
Numbers 31
Arithmetic Operators 31
Other Operators 32
Conversion Functions 32
Boolean Numbers 33
Random Numbers 33
Sequences: Strings, Lists, and Tuples 33
Sequence Storage and Access 33
Membership 34
Concatenation2 34
Sequence Elements and Slices 35
Sequence Built-In Functions 35
Strings 35
Assignment 36
Accessing Substrings 36
String Comparison 36
Membership (Searching) 37
Special Characters and Escaping 37
Triple Quotes 37
String Formatting 38
String Functions 38
Lists 39
Creating Lists 39
Updating Lists 40
Indexing 40
Sequence Operations and Functions 41
Tuples 41
Creating Tuples 41
Sequence Operations and Functions 41
Dictionaries 41
Creating a Dictionary 42
Updating a Dictionary 42
Dictionary Operations 42
Chapter 3: Program Structure 44
Decision Making 44
The if Statement 44
The pass Statement 45
Types of Test 45
Loops and Iteration 46
For Statement 47
While Statement 47
Break Statement 48
Continue Statement1 48
List Comprehensions 49
Using Functions 49
Why Write Functions? 49
What Is a Function? 50
Return Values 51
Calling a Function 51
Named Arguments 52
Variable Scope 52
Chapter 4: Input and Output 53
Displaying Output 53
Getting User Input 54
Writing and Reading Files 55
Opening Files 55
Closing Files 56
Reading Files 56
Writing to Files 57
Accessing the File System 58
Command-Line Arguments 59
Chapter 5: Using Modules 60
Importing Code from a Module 60
Modules Come from the Python Path 60
Creating and Using Your Own Modules 61
Chapter 6: Object Orientation1 63
What Is Object Orientation? 63
Creating Objects Using Classes 64
Chapter 7: Exception and Error Handling 69
Exceptions and Errors 69
Chapter 8: Testing Your Code 73
Modularizing Code and Testing It1 73
Test-Driven Development 73
The unittest Framework 74
Assertions 77
More Complex Test Scenarios 77
Chapter 9: Accessing the Web1 78
Chapter 10: Searching 81
Searching for Strings 81
More Complex Searches 81
Introducing Regular Expressions1 82
Simple Searches 82
Using Special Characters 82
Finding Patterns in Text 84
Capturing Parentheses 86
Finding Links in HTML 86
Chapter 11: Databases1 88
SQLite 88
Database Functions 88
Connecting and Loading Data into SQLite 89
Chapter 12: What Next? 92
Appendices 93
References 93
Web1 93
Books 93
Tools 94
Python Built-In Exceptions Hierarchy2 94
Appendix: Further Information 96
Contacting the Author 96
Are You Interested in Training? 96
Learning Python (1- or 2-day course) 96
Online Training 97
leanpy.com 97
Index 98

Erscheint lt. Verlag 11.11.2016
Zusatzinfo XXV, 87 p. 2 illus., 1 illus. in color.
Verlagsort Berkeley
Sprache englisch
Themenwelt Informatik Programmiersprachen / -werkzeuge Python
Mathematik / Informatik Informatik Software Entwicklung
Schlagworte Agile • language • Lean • learn • programming • Python
ISBN-10 1-4842-2385-3 / 1484223853
ISBN-13 978-1-4842-2385-7 / 9781484223857
Haben Sie eine Frage zum Produkt?
PDFPDF (Wasserzeichen)
Größe: 6,8 MB

DRM: Digitales Wasserzeichen
Dieses eBook enthält ein digitales Wasser­zeichen und ist damit für Sie persona­lisiert. Bei einer missbräuch­lichen Weiter­gabe des eBooks an Dritte ist eine Rück­ver­folgung an die Quelle möglich.

Dateiformat: PDF (Portable Document Format)
Mit einem festen Seiten­layout eignet sich die PDF besonders für Fach­bücher mit Spalten, Tabellen und Abbild­ungen. Eine PDF kann auf fast allen Geräten ange­zeigt werden, ist aber für kleine Displays (Smart­phone, eReader) nur einge­schränkt geeignet.

Systemvoraussetzungen:
PC/Mac: Mit einem PC oder Mac können Sie dieses eBook lesen. Sie benötigen dafür einen PDF-Viewer - z.B. den Adobe Reader oder Adobe Digital Editions.
eReader: Dieses eBook kann mit (fast) allen eBook-Readern gelesen werden. Mit dem amazon-Kindle ist es aber nicht kompatibel.
Smartphone/Tablet: Egal ob Apple oder Android, dieses eBook können Sie lesen. Sie benötigen dafür einen PDF-Viewer - z.B. die kostenlose Adobe Digital Editions-App.

Zusätzliches Feature: Online Lesen
Dieses eBook können Sie zusätzlich zum Download auch online im Webbrowser lesen.

Buying eBooks from abroad
For tax law reasons we can sell eBooks just within Germany and Switzerland. Regrettably we cannot fulfill eBook-orders from other countries.

Mehr entdecken
aus dem Bereich
Arbeiten mit NumPy, Matplotlib und Pandas

von Bernd Klein

eBook Download (2023)
Carl Hanser Verlag GmbH & Co. KG
29,99
Arbeiten mit NumPy, Matplotlib und Pandas

von Bernd Klein

eBook Download (2023)
Carl Hanser Verlag GmbH & Co. KG
29,99