Hall / Stacey | Python 3 for Absolute Beginners | E-Book | www.sack.de
E-Book

E-Book, Englisch, 300 Seiten

Hall / Stacey Python 3 for Absolute Beginners


1. ed
ISBN: 978-1-4302-1633-9
Verlag: Apress
Format: PDF
Kopierschutz: 1 - PDF Watermark

E-Book, Englisch, 300 Seiten

ISBN: 978-1-4302-1633-9
Verlag: Apress
Format: PDF
Kopierschutz: 1 - PDF Watermark



There are many more people who want to study programming other than aspiring computer scientists with a passing grade in advanced calculus. This guide appeals to your intelligence and ability to solve practical problems, while gently teaching the most recent revision of the programming language Python. You can learn solid software design skills and accomplish practical programming tasks, like extending applications and automating everyday processes, even if you have no programming experience at all. Authors Tim Hall and J-P Stacey use everyday language to decode programming jargon and teach Python 3 to the absolute beginner.

Tim Hall currently provides front-line support for 64 Studio. He has also written newbie tutorials for Linux User and Developer magazine in between more mundane system admin and web authoring jobs. Tim has released albums and performed as a musician and songwriter, both solo and in collaboration with other artists. He has been further honored as the holder of the Bardic chair of Glastonbury between 2005 and 2007. Tim uses Python as his main programming language, primarily as a means for creative ends, because it is easy to read and fun to learn.

Hall / Stacey Python 3 for Absolute Beginners jetzt bestellen!

Autoren/Hrsg.


Weitere Infos & Material


1;Contents at a Glance;4
2;Table of Contents;5
3;About the Author;9
4;About the Technical Reviewer;10
5;Chapter 1: Introducing Python;11
5.1;Running Python on Various Systems;11
5.1.1;Installing on Windows;12
5.1.2;Installing on Other Systems;12
5.1.3;Choosing the Right Python Version;12
5.1.4;Understanding the Jargon;13
5.2;Learning While Having Fun;14
5.3;Introducing the Interactive Shell;14
5.4;Choosing to Code with a Text Editor;15
5.5;Choosing to Code with an Integrated Development Environment;15
5.6;Getting Started with Programming;15
5.7;Creating Your Own Help Files;16
5.8;Jargon Busting;16
5.9;Summary;17
6;Chapter 2: Designing Software;18
6.1;Designing Your Own Software (Why Bother?);18
6.1.1;Asking the Right Questions;19
6.1.2;Using Python to Solve Problems;19
6.2;Identifying the Problem;19
6.2.1;What Do You Want the Software to Do?;20
6.2.2;Who Will Be Using It?;20
6.2.3;What System Will Users Be Running It On?;21
6.3;Creating Your Wish List;21
6.3.1;Talking to Potential Users;21
6.3.2;Watching Users Perform the Task at Hand;22
6.3.3;Compiling User Stories;22
6.4;Devising a Solution;22
6.4.1;Understanding the Problem;22
6.4.2;Knowing What the Software Needs to Do;23
6.4.3;Considering Other Needs or Limitations;23
6.4.4;Defining Acceptable Results;23
6.4.5;Considering Maintenance;23
6.5;Breaking Down the Solution into Steps;24
6.5.1;Organizing the Tasks into Steps;25
6.5.2;Using Indentation and Subgroups;26
6.5.3;Refining Each Line of Your Pseudocode Until a Solution Is Reached;26
6.5.4;Coding the Design;27
6.5.5;Turning the Design into Executable Code;27
6.5.6;Further Refining the Design;28
6.5.7;Using functions;28
6.5.8;Testing the Design;29
6.5.9;Detecting and correcting coding errors;30
6.5.10;Noting Modifications, Extensions, and Enhancements;31
6.5.11;Documenting the Solution;31
6.6;Jargon Busting;33
6.7;Summary;34
7;Chapter 3: Variables and Data Types;35
7.1;Choosing Good Identifiers;35
7.1.1;Python Keywords;35
7.1.2;Following the Naming Rules;36
7.2;Creating Variables and Assigning Values;36
7.3;Recognizing Different Types of Variables;37
7.3.1;Working with Dynamic Typing;37
7.3.2;In the Beginning Was the Void;39
7.3.3;Joining Up Text Fragments;39
7.3.4;Using Quotes;40
7.3.5;Nesting Quotes;41
7.3.6;Escaping Sequences;42
7.3.7;Using Special Whitespace Characters;42
7.3.8;The More Strings Change the More They Stay the Same;43
7.3.9;Creating a Text Application;43
7.3.10;Working with Numbers;45
7.3.11;Using Binary: Computers Can Only Count to One;45
7.3.12;Bits and Bytes;45
7.3.13;Using Booleans: Truth or Dare;45
7.3.14;Using Whole Numbers (Integers);46
7.3.15;Performing Basic Mathematical Operations;46
7.3.16;Understanding Operator Precedence;47
7.3.17;Dividing Numbers;47
7.3.18;Working with Fractions and Floats;48
7.3.19;Converting One Type into Another;48
7.3.20;Working with Base 8 (Octal) and Base 16 (Hexadecimal);49
7.3.21;Creating a Number Application;51
7.4;Jargon Busting;53
7.5;Summary;55
8;Chapter 4: Making Choices;56
8.1;Comparing Things;56
8.1.1;Manipulating Boolean Values;59
8.1.2;Combining Conditional Expressions;60
8.1.3;Using Assignment Operators;60
8.1.4;Understanding Operator Precedence;61
8.2;Taking Control of the Process;62
8.2.1;Using the for Statement;76
8.3;Dealing with Logical Errors;64
8.4;Using Conditional Code in the Application;68
8.5;Now Repeat That;72
8.5.1;Looping with the while Statement;72
8.5.2;Now Get Out of That;74
8.5.3;Nesting Conditional Statements;76
8.6;Jargon Busting;80
8.7;Summary;81
9;Chapter 5: Using Lists;82
9.1;Working with Python Data Structures;82
9.1.1;Accessing the items in a sequence;82
9.1.2;If You’re Not on the List, You Can’t Come In;84
9.2;Tuples;86
9.2.1;Creating a Tuple;86
9.2.2;Changing the Values in a Tuple;87
9.3;Lists;87
9.3.1;Creating a List;87
9.3.2;Modifying a List;87
9.3.3;Stacks and Queues;89
9.3.4;Sorting Lists;89
9.3.5;Multidimensional Lists;90
9.3.6;Processing Large Amounts of Data Easily;90
9.3.7;List Comprehensions;91
9.4;Sets;92
9.5;Dictionaries;93
9.5.1;Defining Dictionaries;93
9.5.2;Deleting Items;95
9.5.3;Sorting Dictionaries;96
9.5.4;Using Dictionaries;96
9.6;A Simple Role-Playing Combat Game;96
9.7;Jargon Busting;106
9.8;Summary;107
10;Chapter 6: Functions;108
10.1;Accessing Privileged Information;108
10.1.1;Defining Functions;108
10.1.2;Sending Out Invitations;109
10.1.3;Passing an Unknown Number of Values into the Function;110
10.1.4;Using docstrings to Document Your Function;111
10.2;Working with Variable Scope;112
10.2.1;Understanding Scope;112
10.2.2;Using the global Statement;114
10.2.3;Manipulating Lists and Dictionaries;115
10.3;Refactoring rpcombat.py to Reduce Repetition;115
10.3.1;Cutting Out the Waffle;116
10.3.2;Keeping Your Code Readable;118
10.3.3;The Matrix Refactored;120
10.4;Jargon Busting;130
10.5;Summary;131
11;Chapter 7: Working with Text;132
11.1;Strings and Things;132
11.1.1;Splitting Strings;133
11.1.2;Joining Strings, or Avoiding Concatenation;134
11.1.3;Changing Case;135
11.1.4;Simple Methods of Formatting;136
11.1.5;Advanced Formatting;136
11.1.6;Format Specification;137
11.1.7;Editing Strings;141
11.1.8;Finding Strings;141
11.2;Matching Patterns Using Regular Expressions;142
11.2.1;Matching Subpatterns;144
11.2.2;Matching Character Sets and Alternatives;145
11.2.3;Finding Patterns at the Beginning or End of a String;145
11.2.4;Creating a Regular Expression Object;146
11.2.5;Letting the Characters Escape;146
11.2.6;Manipulating Strings Using Regular Expressions;146
11.3;Using Files;148
11.3.1;Opening Files;148
11.3.2;Modes and Buffers;149
11.3.3;Reading from and Writing to Files;149
11.3.4;Finding Your Way Around Files;150
11.3.5;Closing Files;151
11.4;Applications;152
11.4.1;Converting Text;152
11.4.2;Story;154
11.4.3;Checking and Correcting Styles;154
11.4.4;Formatting Data;161
11.4.5;Storing Data;163
11.5;Jargon Busting;166
11.6;Summary;167
12;Chapter 8: Executable Files, Organization, and Python on the Web;168
12.1;Making Programs Executable as Stand-Alone Applications;168
12.2;Organizing Your Project;171
12.3;Writing Stylish Code;172
12.3.1;Becoming More Pythonic;173
12.4;Importing Modules;177
12.5;Using exec() and eval();179
12.6;Putting Python on the Web;180
12.6.1;Creating a Quick CGI Form;184
12.7;Jargon Busting;186
12.8;Summary;186
13;Chapter 9: Classes;187
13.1;Empowering objects;188
13.1.1;Defining Classes;188
13.1.2;Who Is self?;189
13.1.3;Determining an Object’s Type;190
13.1.4;Namespaces and Why We Need Them;191
13.2;When Should Classes Be Used?;191
13.2.1;Parents and Children—Inheritance;195
13.2.2;Using Methods;196
13.3;Customizing Classes;197
13.3.1;Constructors;198
13.3.2;Customizing Output;199
13.3.3;Emulating Existing Types;200
13.3.4;Properties;202
13.3.5;Customizing Attribute Access;203
13.3.6;Emulating Numeric Types;203
13.4;Application;206
13.5;Jargon Busting;225
13.6;Summary;226
14;Chapter 10: Exceptions;227
14.1;When Something Goes Wrong;227
14.1.1;Handling Simple Exceptions;228
14.1.2;Using the try Statement with an except Clause in Python;228
14.2;Classes of Exceptions;230
14.2.1;Exception objects and the hierarchy of classes;230
14.2.2;Creating and Raising an Exception Object;231
14.2.3;Creating Your Own Exception Classes;233
14.2.4;Accessing Properties of the Raised Exception;235
14.2.5;Implementing Complex Error Handling;237
14.2.6;Using finally to Clean Up After a Problem;237
14.2.7;Putting Everything Together with else;238
14.2.8;Using the Traceback If All Else Fails;240
14.2.9;Exception Chaining and Tracebacks;241
14.3;A Final Note on Pythonic Exception Handling;244
14.4;Jargon Busting;245
14.5;Summary;246
15;Chapter 11: Reusing Code with Modules and Packages;247
15.1;Understanding Python Modules;247
15.1.1;Creating Your First Module;248
15.1.2;Using Your Module in Another Program;249
15.2;Everyday Module Usage;250
15.2.1;Flexible Importing;250
15.2.2;Structuring Your Modules;252
15.3;Advanced Module Behavior;255
15.3.1;Reloading Module Changes Dynamically;255
15.3.2;Python Module Internals;256
15.4;Combining Modules into Packages;258
15.4.1;Understanding Packages;258
15.4.2;Building a Pirate-Speak Package;258
15.5;The Universe of Python packages;260
15.5.1;Standard Modules;260
15.5.2;Installing Contributed Packages;260
15.5.3;Three Examples from the Python Universe;262
15.5.4;csv;262
15.5.5;datetime;263
15.5.6;Beautiful Soup and urllib;264
15.5.7;A Package for Everything—Eventually;265
15.6;Jargon Busting;265
15.7;Summary;266
16;Chapter 12: Simple Windowed Applications;267
16.1;Using Tkinter;267
16.2;Saying “Hello” with PyGTK;271
16.2.1;Catching Signals;273
16.2.2;Building Complex Interfaces;274
16.2.3;Creating the GUI;275
16.2.4;Making the Commands Do Something Useful;278
16.3;Using Glade and tepache to Build Interfaces;285
16.4;Jargon Busting;288
16.5;Summary;288
17;Index;289



Ihre Fragen, Wünsche oder Anmerkungen
Vorname*
Nachname*
Ihre E-Mail-Adresse*
Kundennr.
Ihre Nachricht*
Lediglich mit * gekennzeichnete Felder sind Pflichtfelder.
Wenn Sie die im Kontaktformular eingegebenen Daten durch Klick auf den nachfolgenden Button übersenden, erklären Sie sich damit einverstanden, dass wir Ihr Angaben für die Beantwortung Ihrer Anfrage verwenden. Selbstverständlich werden Ihre Daten vertraulich behandelt und nicht an Dritte weitergegeben. Sie können der Verwendung Ihrer Daten jederzeit widersprechen. Das Datenhandling bei Sack Fachmedien erklären wir Ihnen in unserer Datenschutzerklärung.