Python 201: Intermediate Python by Michael Driscoll

By Michael Driscoll

Python 201 is the sequel to my first booklet, Python one zero one. in the event you already be aware of the fundamentals of Python and now you must visit the subsequent point, then this is often the ebook for you! This booklet is for intermediate point Python programmers in basic terms. There will not be any newbie chapters right here. This booklet is predicated onPython three.

Show description

Read or Download Python 201: Intermediate Python PDF

Similar python books

Essential SQLAlchemy

Essential SQLAlchemy introduces a high-level open-source code library that makes it more uncomplicated for Python programmers to entry relational databases resembling Oracle, DB2, MySQL, PostgreSQL, and SQLite. SQLAlchemy has develop into more and more renowned due to the fact its unlock, however it nonetheless lacks strong offline documentation. This functional ebook fills the space, and since a developer wrote it, you get an aim examine SQLAlchemy's instruments instead of an advocate's description of all of the "cool" features.

SQLAlchemy contains either a database server-independent SQL expression language and an object-relational mapper (ORM) that permits you to map "plain outdated Python objects" (POPOs) to database tables with out considerably altering your current Python code. crucial SQLAlchemy demonstrates how you can use the library to create an easy database software, walks you thru easy queries, and explains how one can use SQLAlchemy to hook up with a number of databases at the same time with an identical Metadata. you furthermore may find out how to:

* Create customized varieties for use on your schema, and whilst it's beneficial to exploit customized instead of integrated varieties
* Run queries, updates, and deletes with SQLAlchemy's SQL expression language
* construct an item mapper with SQLAlchemy, and comprehend the variations among this and energetic checklist styles utilized in different ORMs
* Create items, store them to a consultation, and flush them to the database
* Use SQLAlchemy to version item orientated inheritance
* offer a declarative, energetic checklist trend to be used with SQLAlchemy utilizing the Elixir extension
* Use the SQLSoup extension to supply an automated metadata and item version according to database mirrored image

In addition, you'll find out how and while to exploit different extensions to SQLAlchemy, together with AssociationProxy, OrderingList, and more.

Essential SQLAlchemy is the much-needed consultant for each Python developer utilizing this code library. rather than a feature-by-feature documentation, this booklet takes an "essentials" process that provides you precisely what you want to turn into effective with SQLAlchemy correct away.

Mastering Regular Expressions (3rd Edition)

Regular expressions are a really robust software for manipulating textual content and knowledge. they're now general good points in quite a lot of languages and renowned instruments, together with Perl, Python, Ruby, Java, VB. web and C# (and any language utilizing the . web Framework), personal home page, and MySQL.

if you happen to don't use usual expressions but, you will find during this publication an entire new international of mastery over your facts. in the event you already use them, you'll get pleasure from this book's exceptional aspect and breadth of insurance. if you happen to imagine you recognize all you must find out about commonplace expressions, this booklet is a beautiful eye-opener.

As this e-book indicates, a command of standard expressions is a useful ability. common expressions let you code complicated and refined textual content processing that you just by no means imagined will be automatic. normal expressions can prevent time and aggravation. they are often used to craft dependent suggestions to a variety of difficulties. as soon as you've mastered typical expressions, they'll develop into a useful a part of your toolkit. you'll ask yourself the way you ever bought via with out them.

but regardless of their huge availability, flexibility, and exceptional energy, typical expressions are often underutilized. but what's energy within the palms of knowledgeable may be fraught with peril for the unwary. learning common Expressions can help you navigate the minefield to turning into knowledgeable and assist you optimize your use of normal expressions.

gaining knowledge of general Expressions, 3rd variation, now encompasses a complete bankruptcy dedicated to personal home page and its robust and expressive suite of normal expression services, as well as greater Hypertext Preprocessor insurance within the imperative "core" chapters. additionally, this variation has been up to date all through to mirror advances in different languages, together with extended in-depth insurance of Sun's java. util. regex package deal, which has emerged because the commonplace Java regex implementation. issues include:
* A comparability of gains between diversified types of many languages and instruments
* How the normal expression engine works
* Optimization (major discount rates to be had right here! )
* Matching simply what you will have, yet now not what you don't wish
* Sections and chapters on person languages

Written within the lucid, enjoyable tone that makes a posh, dry subject turn into crystal-clear to programmers, and sprinkled with ideas to complicated real-world difficulties, studying common Expressions, 3rd variation bargains a wealth info so that you can placed to speedy use.

Reviews of this new version and the second one edition:

"There isn't a greater (or extra helpful) e-book to be had on common expressions. "

--Zak Greant, handling Director, eZ Systems

"A genuine tour-de-force of a e-book which not just covers the mechanics of regexes in remarkable aspect but additionally talks approximately potency and using regexes in Perl, Java, and . internet. .. in the event you use ordinary expressions as a part of your specialist paintings (even for those who have already got an excellent publication on no matter what language you're programming in) i might strongly suggest this booklet to you. "

--Dr. Chris Brown, Linux Format

"The writer does an exceptional task major the reader from regex amateur to grasp. The ebook is intensely effortless to learn and chock packed with necessary and suitable examples. .. typical expressions are worthwhile instruments that each developer must have of their toolbox. studying common Expressions is the definitive consultant to the topic, and a very good source that belongs on each programmer's bookshelf. Ten out of Ten Horseshoes. "

--Jason Menard, Java Ranch

Python Developer's Handbook

The Python Developer's instruction manual is designed to show skilled builders to Python and its makes use of. starting with a short creation to the language and its syntax, the ebook strikes speedy into extra complicated programming subject matters, together with embedding Python, community programming, GUI toolkits, JPython, net improvement, Python/C API, and extra.

Python 201: Intermediate Python

Python 201 is the sequel to my first publication, Python one zero one. in the event you already comprehend the fundamentals of Python and now you need to visit the following point, then this is often the booklet for you! This ebook is for intermediate point Python programmers purely. There will not be any newbie chapters the following. This ebook relies onPython three.

Additional resources for Python 201: Intermediate Python

Sample text

Now we’re ready to move on to the defaultdict! defaultdict The collections module has a handy tool called defaultdict. The defaultdict is a subclass of Python’s dict that accepts a default_factory as its primary argument. The default_factory is usually a Python type, such as int or list, but you can also use a function or a lambda too. split(' ') 3 4 reg_dict = {} 5 for word in words: 6 if word in reg_dict: 7 reg_dict[word] += 1 8 else: 9 reg_dict[word] = 1 10 11 print(reg_dict) If you run this code, you should see output that is similar to the following: 1 {'The': 1, 2 'and': 1, 3 'fence': 1, 4 'food': 1, 5 'for': 2, 6 'jumped': 1, 7 'over': 1, 8 'ran': 1, 9 'red': 1, 10 'the': 2, 11 'to': 1, 12 'zoo': 1} Now let’s try doing the same thing with defaultdict!

Counter The collections module also provides us with a neat little tool that supports convenient and fast tallies. This tool is called Counter. You can run it against most iterables. Let’s try it out with a string! 1 >>> from collections import Counter 2 >>> Counter('superfluous') 3 Counter({'u': 3, 's': 2, 'e': 1, 'l': 1, 'f': 1, 'o': 1, 'r': 1, 'p': 1}) 4 >>> counter = Counter('superfluous') 5 >>> counter['u'] 6 3 In this example, we import Counter from collections and then pass it a string. This returns a Counter object that is a subclass of Python’s dictionary.

Another way to put it is that partial creates a new function with some defaults. Let’s look at an example! 1 >>> from functools import partial 2 >>> def add(x, y): 3 ... return x + y 4 ... 5 >>> p_add = partial(add, 2) 6 >>> p_add(4) 7 6 Here we create a simple adding function that returns the result of adding its arguments, x and y. Next we create a new callable by creating an instance of partial and passing it our function and an argument for that function. In other words, we are basically defaulting the x parameter of our add function to the number 2.

Download PDF sample

Rated 4.90 of 5 – based on 9 votes