Beginning Python: From Novice to Professional (2nd Edition) by Magnus Lie Hetland

By Magnus Lie Hetland

Achieve a basic knowing of Python's syntax and lines with the second one variation of starting Python, an up–to–date advent and useful reference. overlaying a wide range of Python–related programming subject matters, together with addressing language internals, database integration, community programming, and internet prone, you'll be guided by way of sound improvement rules. Ten accompanying initiatives will make sure you can get your arms soiled in no time.

Updated to mirror the most recent in Python programming paradigms and several other of the main the most important positive factors present in Python 3.0 (otherwise referred to as Python 3000), complex themes, corresponding to extending Python and packaging/distributing Python purposes, also are lined.

Show description

Read or Download Beginning Python: From Novice to Professional (2nd Edition) PDF

Similar python books

Essential SQLAlchemy

Essential SQLAlchemy introduces a high-level open-source code library that makes it more straightforward for Python programmers to entry relational databases corresponding to Oracle, DB2, MySQL, PostgreSQL, and SQLite. SQLAlchemy has turn into more and more well known because its liberate, however it nonetheless lacks sturdy 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 the entire "cool" features.

SQLAlchemy contains either a database server-independent SQL expression language and an object-relational mapper (ORM) that allows 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 program, walks you thru basic queries, and explains how one can use SQLAlchemy to hook up with a number of databases concurrently with an identical Metadata. you furthermore may find out how to:

* Create customized forms for use on your schema, and while it's beneficial to take advantage of customized instead of integrated kinds
* 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 list styles utilized in different ORMs
* Create items, shop them to a consultation, and flush them to the database
* Use SQLAlchemy to version item orientated inheritance
* offer a declarative, energetic list development to be used with SQLAlchemy utilizing the Elixir extension
* Use the SQLSoup extension to supply an automated metadata and item version in line with database mirrored image

In addition, you'll learn the way and while to take advantage of 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 ebook takes an "essentials" process that provides you precisely what you must turn into efficient with SQLAlchemy correct away.

Mastering Regular Expressions (3rd Edition)

Regular expressions are an exceptionally robust instrument for manipulating textual content and knowledge. they're now ordinary beneficial properties in a variety of languages and renowned instruments, together with Perl, Python, Ruby, Java, VB. web and C# (and any language utilizing the . web Framework), Hypertext Preprocessor, and MySQL.

in case you don't use commonplace expressions but, you will find during this e-book a complete new global of mastery over your information. for those who already use them, you'll take pleasure in this book's unparalleled aspect and breadth of assurance. in the event you imagine you recognize all you want to find out about common expressions, this ebook is a gorgeous eye-opener.

As this e-book indicates, a command of normal expressions is a useful ability. standard expressions let you code advanced and refined textual content processing that you simply by no means imagined might be automatic. general expressions can prevent time and aggravation. they are often used to craft based ideas to quite a lot of difficulties. as soon as you've mastered typical expressions, they'll develop into a useful a part of your toolkit. you are going to ask yourself the way you ever acquired by means of with no them.

but regardless of their huge availability, flexibility, and unprecedented strength, average expressions are often underutilized. but what's energy within the palms of knowledgeable might be fraught with peril for the unwary. studying normal Expressions may help you navigate the minefield to changing into a professional and assist you optimize your use of normal expressions.

studying usual Expressions, 3rd variation, now features a complete bankruptcy dedicated to Hypertext Preprocessor and its strong and expressive suite of standard expression services, as well as stronger personal home page assurance within the important "core" chapters. moreover, this version has been up to date all through to mirror advances in different languages, together with multiplied in-depth insurance of Sun's java. util. regex package deal, which has emerged because the usual Java regex implementation. subject matters include:
* A comparability of gains between various models of many languages and instruments
* How the ordinary expression engine works
* Optimization (major reductions on hand the following! )
* Matching simply what you will want, yet no longer what you don't wish
* Sections and chapters on person languages

Written within the lucid, enjoyable tone that makes a posh, dry subject develop into crystal-clear to programmers, and sprinkled with suggestions to advanced real-world difficulties, studying normal Expressions, 3rd variation bargains a wealth details for you to positioned to rapid use.

Reviews of this new version and the second one edition:

"There isn't a greater (or extra worthy) ebook on hand on usual expressions. "

--Zak Greant, dealing with Director, eZ Systems

"A actual tour-de-force of a booklet which not just covers the mechanics of regexes in striking aspect but additionally talks approximately potency and using regexes in Perl, Java, and . web. .. when you use commonplace expressions as a part of your specialist paintings (even in case you have already got a superb ebook on no matter what language you're programming in) i'd strongly suggest this e-book to you. "

--Dr. Chris Brown, Linux Format

"The writer does a superb activity prime the reader from regex amateur to grasp. The publication is very effortless to learn and chock filled with valuable and correct examples. .. usual expressions are beneficial instruments that each developer must have of their toolbox. learning average Expressions is the definitive consultant to the topic, and an exceptional 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 guide is designed to reveal skilled builders to Python and its makes use of. starting with a quick advent to the language and its syntax, the ebook strikes speedy into extra complex programming issues, 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 ebook, Python one hundred and one. for those who already understand the fundamentals of Python and now you must visit the following point, then this is often the e-book for you! This publication is for intermediate point Python programmers in basic terms. There will not be any newbie chapters right here. This publication relies onPython three.

Extra info for Beginning Python: From Novice to Professional (2nd Edition)

Sample text

After all, it doesn’t make any sense to use a variable if it doesn’t represent a value, does it? ■Note Variable names can consist of letters, digits, and underscore characters (_). A variable can’t begin with a digit, so Plan9 is a valid variable name, whereas 9Plan is not. Statements Until now we’ve been working (almost) exclusively with expressions, the ingredients of the recipe. But what about statements—the instructions? In fact, I’ve cheated. I’ve introduced two types of statements already: the print statement, and assignments.

It calculates the product of 2 and 2. However, the result isn’t kept anywhere or shown to the user; it has no side effects, beyond the calculation itself. 0, print is a function, which means you need to write print(42) instead of print 42, for example. Other than that, it works more or less like the statement, as described here. The difference between statements and expressions may be more obvious when dealing with assignments. Because they are not expressions, they have no values that can be printed out by the interactive interpreter: >>> x = 3 >>> As you can see, you get a new prompt immediately.

For instance, if you are simply interested in the fourth digit in a year entered by the user, you could do something like this: >>> fourth = raw_input('Year: ')[3] Year: 2005 >>> fourth '5' Listing 2-1 contains a sample program that asks you for a year, a month (as a number from 1 to 12), and a day (1 to 31), and then prints out the date with the proper month name and so on. Listing 2-1. Indexing Example # Print out a date, given year, month, and day as numbers months = [ 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December' ] 33 34 CHAPTER 2 ■ LISTS AND TUPLES # A list with one ending for each number from 1 to 31 endings = ['st', 'nd', 'rd'] + 17 * ['th'] \ + ['st', 'nd', 'rd'] + 7 * ['th'] \ + ['st'] year month day = raw_input('Year: ') = raw_input('Month (1-12): ') = raw_input('Day (1-31): ') month_number = int(month) day_number = int(day) # Remember to subtract 1 from month and day to get a correct index month_name = months[month_number-1] ordinal = day + endings[day_number-1] print month_name + ' ' + ordinal + ', ' + year An example of a session with this program might be as follows: Year: 1974 Month (1-12): 8 Day (1-31): 16 August 16th, 1974 The last line is the output from the program.

Download PDF sample

Rated 4.47 of 5 – based on 10 votes