Head First Python [NOOK Book]


Ever wished you could learn Python from a book? Head First Python is a complete learning experience for Python that helps you learn the language through a unique method that goes beyond syntax and how-to manuals, helping you understand how to be a great Python programmer. You'll quickly learn the language's fundamentals, then move onto persistence, exception handling, web development, SQLite, data wrangling, and Google App Engine. You'll also learn how to write mobile apps for ...

See more details below
Head First Python

Available on NOOK devices and apps  
  • NOOK Devices
  • Samsung Galaxy Tab 4 NOOK 7.0
  • Samsung Galaxy Tab 4 NOOK 10.1
  • NOOK HD Tablet
  • NOOK HD+ Tablet
  • NOOK eReaders
  • NOOK Color
  • NOOK Tablet
  • Tablet/Phone
  • NOOK for Windows 8 Tablet
  • NOOK for iOS
  • NOOK for Android
  • NOOK Kids for iPad
  • PC/Mac
  • NOOK for Windows 8
  • NOOK for PC
  • NOOK for Mac
  • NOOK for Web

Want a NOOK? Explore Now

NOOK Book (eBook)
BN.com price
(Save 42%)$39.99 List Price


Ever wished you could learn Python from a book? Head First Python is a complete learning experience for Python that helps you learn the language through a unique method that goes beyond syntax and how-to manuals, helping you understand how to be a great Python programmer. You'll quickly learn the language's fundamentals, then move onto persistence, exception handling, web development, SQLite, data wrangling, and Google App Engine. You'll also learn how to write mobile apps for Android, all thanks to the power that Python gives you.

We think your time is too valuable to waste struggling with new concepts. Using the latest research in cognitive science and learning theory to craft a multi-sensory learning experience, Head First Python uses a visually rich format designed for the way your brain works, not a text-heavy approach that puts you to sleep.

Read More Show Less

Product Details

  • ISBN-13: 9781449360436
  • Publisher: O'Reilly Media, Incorporated
  • Publication date: 11/15/2010
  • Sold by: Barnes & Noble
  • Format: eBook
  • Edition number: 1
  • Pages: 494
  • Sales rank: 375,661
  • File size: 32 MB
  • Note: This product may take a few minutes to download.

Meet the Author

Paul Barry is formally educated and trained in Computer Science and holds a Masters Degree in Computing Science. He has been programming professionally, on and off, for close to 25 years. Paul already has two textbooks to his name, and is also a Contributing Editor to Linux Journal magazine. His day job is with the Institute of Technology, Carlow in Ireland where he has spent over a decade preparing Ireland's next generation of computing folk to be productive in the workforce. His role as a third level educator affords him the opportunity to explore, learn and teach the very latest programming technologies and practices, which is something that he enjoys even though he knows this makes him a bonafide "geek". Paul lives just outside the town of Carlow in Ireland with his wife, two sons, daughter, dog and cat. There's a bunch of computers and a growing collection of music instruments in the house, too (and like a lot of the Head First family, Paul is a struggling guitarist trapped inside a geek's body). He has so far resisted any suggestion that the family acquire a hamster ... or a set of drums.

Read More Show Less

Table of Contents

Advance Praise for Head First Python;
Praise for other Head First books;
Author of Head First Python;
How to use This Book: Intro;
Who is this book for?;
We know what you’re thinking;
We know what your brain is thinking;
Metacognition: thinking about thinking;
Here’s what WE did;
Here’s what YOU can do to bend your brain into submission;
Read Me;
The technical review team;
Safari® Books Online;
Chapter 1: Meet Python: Everyone loves lists;
1.1 What’s to like about Python?;
1.2 Install Python 3;
1.3 Use IDLE to help learn Python;
1.4 Work effectively with IDLE;
1.5 Deal with complex data;
1.6 Create simple Python lists;
1.7 Lists are like arrays;
1.8 Add more data to your list;
1.9 Work with your list data;
1.10 For loops work with lists of any size;
1.11 Store lists within lists;
1.12 Check a list for a list;
1.13 Complex data is hard to process;
1.14 Handle many levels of nested lists;
1.15 Don’t repeat code; create a function;
1.16 Create a function in Python;
1.17 Recursion to the rescue!;
1.18 Your Python Toolbox;
Chapter 2: Sharing your Code: Modules of functions;
2.1 It’s too good not to share;
2.2 Turn your function into a module;
2.3 Modules are everywhere;
2.4 Comment your code;
2.5 Prepare your distribution;
2.6 Build your distribution;
2.7 A quick review of your distribution;
2.8 Import a module to use it;
2.9 Python’s modules implement namespaces;
2.10 Register with the PyPI website;
2.11 Upload your code to PyPI;
2.12 Welcome to the PyPI community;
2.13 With success comes responsibility;
2.14 Life’s full of choices;
2.15 Control behavior with an extra argument;
2.16 Before your write new code, think BIF;
2.17 Python tries its best to run your code;
2.18 Trace your code;
2.19 Work out what’s wrong;
2.20 Update PyPI with your new code;
2.21 You’ve changed your API;
2.22 Use optional arguments;
2.23 Your module supports both APIs;
2.24 Your API is still not right;
2.25 Your module’s reputation is restored;
2.26 Your Python Toolbox;
Chapter 3: Files and Exceptions: Dealing with errors;
3.1 Data is external to your program;
3.2 It’s all lines of text;
3.3 Take a closer look at the data;
3.4 Know your data;
3.5 Know your methods and ask for help;
3.6 Know your data (better);
3.7 Two very different approaches;
3.8 Add extra logic;
3.9 Handle exceptions;
3.10 Try first, then recover;
3.11 Identify the code to protect;
3.12 Take a pass on the error;
3.13 What about other errors?;
3.14 Add more error-checking code...;
3.15 ...Or add another level of exception handling;
3.16 So, which approach is best?;
3.17 You’re done...except for one small thing;
3.18 Be specific with your exceptions;
3.19 Your Python Toolbox;
Chapter 4: Persistence: Saving data to files;
4.1 Programs produce data;
4.2 Open your file in write mode;
4.3 Files are left open after an exception!;
4.4 Extend try with finally;
4.5 Knowing the type of error is not enough;
4.6 Use with to work with files;
4.7 Default formats are unsuitable for files;
4.8 Why not modify print_lol()?;
4.9 Pickle your data;
4.10 Save with dump and restore with load;
4.11 Generic file I/O with pickle is the way to go!;
4.12 Your Python Toolbox;
Chapter 5: Comprehending data: Work that data!;
5.1 Coach Kelly needs your help;
5.2 Sort in one of two ways;
5.3 The trouble with time;
5.4 Comprehending lists;
5.5 Iterate to remove duplicates;
5.6 Remove duplicates with sets;
5.7 Your Python Toolbox;
Chapter 6: Custom data Objects: Bundling code with data;
6.1 Coach Kelly is back (with a new file format);
6.2 Use a dictionary to associate data;
6.3 Bundle your code and its data in a class;
6.4 Define a class;
6.5 Use class to define classes;
6.6 The importance of self;
6.7 Every method’s first argument is self;
6.8 Inherit from Python’s built-in list;
6.9 Coach Kelly is impressed;
6.10 Your Python Toolbox;
Chapter 7: Web Development: Putting it all together;
7.1 It’s good to share;
7.2 You can put your program on the Web;
7.3 What does your webapp need to do?;
7.4 Design your webapp with MVC;
7.5 Model your data;
7.6 View your interface;
7.7 Control your code;
7.8 CGI lets your web server run programs;
7.9 Display the list of athletes;
7.10 The dreaded 404 error!;
7.11 Create another CGI script;
7.12 Enable CGI tracking to help with errors;
7.13 A small change can make all the difference;
7.14 Your webapp’s a hit!;
7.15 Your Python Toolbox;
Chapter 8: Mobile app Development: Small devices;
8.1 The world is getting smaller;
8.2 Coach Kelly is on Android;
8.3 Don’t worry about Python 2;
8.4 Set up your development environment;
8.5 Configure the SDK and emulator;
8.6 Install and configure Android Scripting;
8.7 Add Python to your SL4A installation;
8.8 Test Python on Android;
8.9 Define your app’s requirements;
8.10 The SL4A Android API;
8.11 Select from a list on Android;
8.12 The athlete’s data CGI script;
8.13 The data appears to have changed type;
8.14 JSON can’t handle your custom datatypes;
8.15 Run your app on a real phone;
8.16 Configure AndFTP;
8.17 The coach is thrilled with his app;
8.18 Your Python Toolbox;
Chapter 9: Manage Your data: Handling input;
9.1 Your athlete times app has gone national;
9.2 Use a form or dialog to accept input;
9.3 Create an HTML form template;
9.4 The data is delivered to your CGI script;
9.5 Ask for input on your Android phone;
9.6 It’s time to update your server data;
9.7 Avoid race conditions;
9.8 You need a better data storage mechanism;
9.9 Use a database management system;
9.10 Python includes SQLite;
9.11 Exploit Python’s database API;
9.12 The database API as Python code;
9.13 A little database design goes a long way;
9.14 Define your database schema;
9.15 What does the data look like?;
9.16 Transfer the data from your pickle to SQLite;
9.17 What ID is assigned to which athlete?;
9.18 Insert your timing data;
9.19 SQLite data management tools;
9.20 Integrate SQLite with your existing webapp;
9.21 You still need the list of names;
9.22 Get an athlete’s details based on ID;
9.23 You need to amend your Android app, too;
9.24 Update your SQLite-based athlete data;
9.25 The NUAC is over the moon!;
9.26 Your Python Toolbox;
Chapter 10: Scaling your Webapp: Getting real;
10.1 There are whale sightings everywhere;
10.2 The HFWWG needs to automate;
10.3 Build your webapp with Google App Engine;
10.4 Download and install App Engine;
10.5 Make sure App Engine is working;
10.6 App Engine uses the MVC pattern;
10.7 Model your data with App Engine;
10.8 What good is a model without a view?;
10.9 Use templates in App Engine;
10.10 Django’s form validation framework;
10.11 Check your form;
10.12 Controlling your App Engine webapp;
10.13 Restrict input by providing options;
10.14 Meet the “blank screen of death”;
10.15 Process the POST within your webapp;
10.16 Put your data in the datastore;
10.17 Don’t break the “robustness principle”;
10.18 Accept almost any date and time;
10.19 It looks like you’re not quite done yet;
10.20 Sometimes, the tiniest change can make all the difference...;
10.21 Capture your user’s Google ID, too;
10.22 Deploy your webapp to Google’s cloud;
10.23 Your HFWWG webapp is deployed!;
10.24 Your Python Toolbox;
Chapter 11: Dealing with Complexity: Data wrangling;
11.1 What’s a good time goal for the next race?;
11.2 So... what’s the problem?;
11.3 Start with the data;
11.4 Store each time as a dictionary;
11.5 Dissect the prediction code;
11.6 Get input from your user;
11.7 Getting input raises an issue...;
11.8 If it’s not in the dictionary, it can’t be found;
11.9 Search for the closest match;
11.10 The trouble is with time;
11.11 The time-to-seconds-to-time module;
11.12 The trouble is still with time...;
11.13 Port to Android;
11.14 Your Android app is a bunch of dialogs;
11.15 Put your app together...;
11.16 Your app’s a wrap!;
11.17 Your Python Toolbox;
11.18 It’s time to go...;
Leftovers: The Top Ten Things (we didn’t cover);
#1: Using a “professional” IDE;
#2: Coping with scoping;
#3: Testing;
#4: Advanced language features;
#5: Regular expressions;
#6: More on web frameworks;
#7: Object relational mappers and NoSQL;
#8: Programming GUIs;
#9: Stuff to avoid;
#10: Other books;
Read More Show Less

Customer Reviews

Average Rating 5
( 2 )
Rating Distribution

5 Star


4 Star


3 Star


2 Star


1 Star


Your Rating:

Your Name: Create a Pen Name or

Barnes & Noble.com Review Rules

Our reader reviews allow you to share your comments on titles you liked, or didn't, with others. By submitting an online review, you are representing to Barnes & Noble.com that all information contained in your review is original and accurate in all respects, and that the submission of such content by you and the posting of such content by Barnes & Noble.com does not and will not violate the rights of any third party. Please follow the rules below to help ensure that your review can be posted.

Reviews by Our Customers Under the Age of 13

We highly value and respect everyone's opinion concerning the titles we offer. However, we cannot allow persons under the age of 13 to have accounts at BN.com or to post customer reviews. Please see our Terms of Use for more details.

What to exclude from your review:

Please do not write about reviews, commentary, or information posted on the product page. If you see any errors in the information on the product page, please send us an email.

Reviews should not contain any of the following:

  • - HTML tags, profanity, obscenities, vulgarities, or comments that defame anyone
  • - Time-sensitive information such as tour dates, signings, lectures, etc.
  • - Single-word reviews. Other people will read your review to discover why you liked or didn't like the title. Be descriptive.
  • - Comments focusing on the author or that may ruin the ending for others
  • - Phone numbers, addresses, URLs
  • - Pricing and availability information or alternative ordering information
  • - Advertisements or commercial solicitation


  • - By submitting a review, you grant to Barnes & Noble.com and its sublicensees the royalty-free, perpetual, irrevocable right and license to use the review in accordance with the Barnes & Noble.com Terms of Use.
  • - Barnes & Noble.com reserves the right not to post any review -- particularly those that do not follow the terms and conditions of these Rules. Barnes & Noble.com also reserves the right to remove any review at any time without notice.
  • - See Terms of Use for other conditions and disclaimers.
Search for Products You'd Like to Recommend

Recommend other products that relate to your review. Just search for them below and share!

Create a Pen Name

Your Pen Name is your unique identity on BN.com. It will appear on the reviews you write and other website activities. Your Pen Name cannot be edited, changed or deleted once submitted.

Your Pen Name can be any combination of alphanumeric characters (plus - and _), and must be at least two characters long.

Continue Anonymously
Sort by: Showing all of 2 Customer Reviews
  • Anonymous

    Posted December 6, 2011

    Great first Python book

    I found that this book explains simple things that other books leave out. If you are just starting to code, and want to learn Python, this is a great start. Sometimes I found that other books would show the code, and give examples, but in the examples there would be a part of the code I had seen before, but none of the books would really explain that simple part. This book does explain that, it has pictures with arrows (I know what you're going to say), but it is very useful when learning to program for the first time. A lot of their examples stick out in my head while I am writing code in Python. The author also keeps an upbeat attitude throughout the book, which kept my interest. I would recommend this book for beginners in programming. If you have programmed in other languages, this is probably not the book for you.

    3 out of 3 people found this review helpful.

    Was this review helpful? Yes  No   Report this review
  • Anonymous

    Posted December 6, 2011

    Great intro

    Website design

    0 out of 1 people found this review helpful.

    Was this review helpful? Yes  No   Report this review
Sort by: Showing all of 2 Customer Reviews

If you find inappropriate content, please report it to Barnes & Noble
Why is this product inappropriate?
Comments (optional)