My Account Log in

1 option

Head first Python / Paul Barry.

O'Reilly Online Learning: Academic/Public Library Edition Available online

View online
Format:
Book
Author/Creator:
Barry, Paul, 1966- author.
Language:
English
Subjects (All):
Python (Computer program language).
Automatic control--Data processing.
Automatic control.
Physical Description:
1 online resource (494 p.)
Edition:
1st ed.
Place of Publication:
Sebastopol : O'Reilly, [2011]
Language Note:
English
System Details:
text file
Summary:
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 was
Contents:
Table of Contents; Chapter 1: Meet Python: Everyone Loves Lists; What's to like about Python?; Install Python 3; Use IDLE to help learn Python; Work effectively with IDLE; Deal with complex data; Create simple Python lists; Lists are like arrays; Add more data to your list; Work with your list data; For loops work with lists of any size; Store lists within lists; Check a list for a list; Complex data is hard to process; Handle many levels of nested lists; Don't repeat code; create a function; Create a function in Python; Recursion to the rescue!; Your Python Toolbox
Chapter 2: Sharing Your Code: Modules of FunctionsIt's too good not to share; Turn your function into a module; Modules are everywhere; Comment your code; Prepare your distribution; Build your distribution; A quick review of your distribution; Import a module to use it; Python's modules implement namespaces; Register with the PyPI website; Upload your code to PyPI; Welcome to the PyPI community; With success comes responsibilit y; Life's full of choices; Control behavior with an extra argument; Before your write new code, think BIF; Python tries its best to run your code; Trace your code
Work out what's wrongUpdate PyPI with your new code; You've changed your API; Use optional arguments; Your module supports both APIs; Your API is still not right; Your module's reputation is restored; Your Python Toolbox; Chapter 3: Files and Exceptions: Dealing with Errors; Data is external to your program; It's all lines of text; Take a closer look at the data; Know your data; Know your methods and ask for help; Know your data (better); Two very different approaches; Add extra logic; Handle exceptions; Try first, then recover; Identif y the code to protect; Take a pass on the error
What about other errors?Add more error-checking code...; ...Or add another level of exception handling; So, which approach is best?; You're done...except for one small thing; Be specific with your exceptions; Your Python Toolbox; Chapter 4: Persistence: Saving Data to Files; Programs produce data; Open your file in write mode; Files are lef t open af ter an exception!; Extend try with finally; Knowing the t ype of error is not enough; Use with to work with files; Default formats are unsuitable for files; Why not modif y print lol()?; Pickle your data; Save with dump and restore with load
Generic file I/O with pickle is the way to go!Your Python Toolbox; Chapter 5: Comprehending Data: Work That Data!; Coach Kelly needs your help; Sort in one of t wo ways; The trouble with time; Comprehending lists; Iterate to remove duplicates; Remove duplicates with sets; Your Python Toolbox; Chapter 6: Custom Data Objects: Bundling Code with Data; Coach Kelly is back(with a new file format); Use a dictionary to associate data; Bundle your code and its data in a class; Define a class; Use class to define classes; The importance of self; Every method's first argument is self
Inherit from Python's built-in list
Notes:
Includes index.
Description based on online resource; title from PDF title page (ebrary, viewed August 14, 2014).
ISBN:
9781306810609
1306810604
9781449360436
1449360432
9781449396695
1449396690
OCLC:
740439310

The Penn Libraries is committed to describing library materials using current, accurate, and responsible language. If you discover outdated or inaccurate language, please fill out this feedback form to report it and suggest alternative language.

My Account

Shelf Request an item Bookmarks Fines and fees Settings

Guides

Using the Library Catalog Using Articles+ Library Account