Python Pocket Reference (5th Edition) by Mark Lutz

By Mark Lutz

Up-to-date for either Python 3.4 and 2.7, this handy pocket consultant is the right on-the-job speedy reference. You’ll locate concise, need-to-know info on Python kinds and statements, distinctive procedure names, integrated services and exceptions, universal ordinary library modules, and different famous Python instruments. The convenient index allows you to pinpoint precisely what you need.

Written via Mark Lutz—widely famous because the world’s best Python trainer—Python Pocket Reference is a perfect significant other to O’Reilly’s vintage Python tutorials, Learning Python and Programming Python, additionally written by means of Mark.

This 5th variation covers:

• integrated item kinds, together with numbers, lists, dictionaries, and more
• Statements and syntax for growing and processing objects
• services and modules for structuring and reusing code
• Python’s object-oriented programming tools
• integrated capabilities, exceptions, and attributes
• particular operator overloading methods
• well-known ordinary library modules and extensions
• Command-line thoughts and improvement tools
• Python idioms and hints
• The Python SQL Database API

Show description

Read or Download Python Pocket Reference (5th Edition) PDF

Best python books

Fundamentals of Python: From First Programs through Data Structures

In basics OF PYTHON: FROM FIRST courses via info buildings, Washington and Lee college professor Kenneth A. Lambert provides all the vital themes in CS1 and CS2 in a single quantity. This low-priced layout offers teachers with a constant method of educating introductory programming and information constructions over a customary two-term path series.

Python for Data Analysis: Data Wrangling with Pandas, NumPy, and IPython

Python for facts research is worried with the nuts and bolts of manipulating, processing, cleansing, and crunching facts in Python. it's also a realistic, sleek creation to clinical computing in Python, adapted for data-intensive functions. this can be a publication in regards to the elements of the Python language and libraries you'll have to successfully remedy a extensive set of knowledge research difficulties.

Python and AWS

For those who intend to exploit Amazon net providers (AWS) for distant computing and garage, Python is a perfect programming language for constructing purposes and controlling your cloud-based infrastructure. This cookbook will get you begun with greater than dozen recipes for utilizing Python with AWS, in response to the author’s boto library.

Artificial Intelligence with Python

Construct real-world synthetic Intelligence functions with Python to intelligently have interaction with the area round you approximately This publication Step into the superb international of clever apps utilizing this complete consultant input the realm of man-made Intelligence, discover it, and create your personal functions paintings via basic but insightful examples that may get you up and working with man made Intelligence very quickly Who This ebook Is For This booklet is for Python builders who are looking to construct real-world man made Intelligence functions.

Additional resources for Python Pocket Reference (5th Edition)

Example text

If count is passed, the first count oc‐ currences are replaced. join(x). splitlines([keepends]) Splits string S on line breaks, returning lines list. The result does not retain line break characters unless keepends is true. format_map(mapping) See section “String formatting”. format(**M), but M is not copied. capitalize() Capitalizes the first character of string S, and lowercases its other characters. expandtabs([tabsize]) Replaces tabs in string S with tabsize spaces (default is 8). strip([chars]) Removes leading and trailing whitespace from string S (or characters in chars if passed).

L = list('spam') Creates a list of all items in any iterable, by calling the type constructor function. L = [x ** 2 for x in range(9)] Creates a list by collecting expression results during itera‐ tion (list comprehension). append(X) Inserts the single object X at the end of L, changing the list in-place. extend(I) Inserts each item in any iterable I at the end of L in-place (like an in-place +). Similar to L[len(L):] = I. Hint: use L[:0] = I to prepend all items in I. sort(key=None, reverse=False) Sorts L in-place, in ascending order by default.

The re‐ sult of 'a' + u'bc' is u'abc'). S. ASCII data (and raise an error for non-ASCII characters). The built-in str() and unicode() func‐ tions can be used to convert between normal and Unicode strings, and the encode() and decode() string methods apply and undo Unicode encodings. X’s built-in open() function files. Lists Lists are mutable (changeable) sequences of object references ac‐ cessed by offset (position). Literals and creation List literals are written as a comma-separated series of values en‐ closed in square brackets, and various operations construct lists dynamically: 46 | Python Pocket Reference [] An empty list.

Download PDF sample

Rated 4.89 of 5 – based on 44 votes