Beginning Python is the python, network programming, programming and computer science book which takes students to step by step to become master in python. Description of Beginning Python by Magnus Lie Hetland PDF Beginning Python is computer science, programming, python and network programming book which teaches the student about python language from basic to expert. Magnus Lie Hetland is the author of this superb book. This guide offers the fundamental knowledge about the python syntax and features.

Author:Mikashura Akirg
Language:English (Spanish)
Published (Last):21 January 2013
PDF File Size:1.73 Mb
ePub File Size:10.76 Mb
Price:Free* [*Free Regsitration Required]

Ten accompanying projects will ensure you can get your hands dirty in no time. Table of Contents Chapter 1. In this chapter, you learn how to take control of your computer by speaking a language it understands: Python.

Nothing here is particularly difficult, so if you know the basic principles of how your computer works, you should be able to follow the examples and try them out yourself. Magnus Lie Hetland Chapter 2. Lists and Tuples Abstract This chapter introduces a new concept: data structures. A data structure is a collection of data elements such as numbers or characters, or even other data structures that is structured in some way, such as by numbering the elements.

The most basic data structure in Python is the sequence. Each element of a sequence is assigned a number—its position, or index. The first index is zero, the second index is one, and so forth. Some programming languages number their sequence elements starting with one, but the zero-indexing convention has a natural interpretation of an offset from the beginning of the sequence, with negative indexes wrapping around to the end. Magnus Lie Hetland Chapter 3.

In this chapter, you see how to use them to format other values for printing, for example and take a quick look at the useful things you can do with string methods, such as splitting, joining, searching, and more. Magnus Lie Hetland Chapter 4. In this chapter, you learn about a data structure in which you can refer to each value by name.

This type of structure is called a mapping. The only built-in mapping type in Python is the dictionary. Magnus Lie Hetland Chapter 5. Magnus Lie Hetland Chapter 6. Magnus Lie Hetland Chapter 7. Now, only one thing seems to be missing—making your own objects. Magnus Lie Hetland Chapter 8. Such exceptional events might be errors such as trying to divide a number by zero or simply something you might not expect to happen very often.

To handle such exceptional events, you might use conditionals everywhere the events might occur for example, have your program check whether the denominator is zero for every division. However, this would not only be inefficient and inflexible but would also make the programs illegible.

Magnus Lie Hetland Chapter 9. Magic Methods, Properties, and Iterators Abstract In Python, some names are spelled in a peculiar manner, with two leading and two trailing underscores. This spelling signals that the name has a special significance—you should never invent such names for your own programs. One very prominent set of such names in the language consists of the magic or special method names.

If your object implements one of these methods, that method will be called under specific circumstances exactly which will depend on the name by Python. There is rarely any need to call these methods directly. Magnus Lie Hetland Chapter Batteries Included Abstract You now know most of the basic Python language. While the core language is powerful in itself, Python gives you more tools to play with. A standard installation includes a set of modules called the standard library.

You have already seen some of them math and cmath, for example , but there are many more. This chapter shows you a bit about how modules work and how to explore them and learn what they have to offer. Then the chapter offers an overview of the standard library, focusing on a few selected useful modules.

What little interaction our programs have had with the outside world has been through input and print. In this chapter, we go one step further and let our programs catch a glimpse of a larger world: the world of files and streams. The functions and objects described in this chapter will enable you to store data between program invocations and to process data from other programs.

Several other toolkits are available, however. Fortunately, there is no conflict between the various GUI toolkits available for Python, so you can install as many different GUI toolkits as you want.

Database Support Abstract Using simple, plain-text files can get you only so far. Yes, they can get you very far, but at some point, you may need some extra functionality. You may want some automated serialization, and you can turn to shelve see Chapter 10 and pickle a close relative of shelve. But you may want features that go beyond even this. For example, you might want to have automated support for concurrent access to your data, that is, to allow several users to read from and write to your disk-based data without causing any corrupted files or the like.

Or you may want to be able to perform complex searches using many data fields or properties at the same time, rather than the simple single-key lookup of shelve. There are plenty of solutions to choose from, but if you want this to scale to large amounts of data and you want the solution to be easily understandable by other programmers, choosing a relatively standard form of database is probably a good idea.

Network Programming Abstract In this chapter, I give you a sample of the various ways in which Python can help you write programs that use a network, such as the Internet, as an important component. Python is a very powerful tool for network programming. Many libraries for common network protocols and for various layers of abstractions on top of them are available, so you can concentrate on the logic of your program, rather than on shuffling bits across wires.

Python and the Web Abstract This chapter tackles some aspects of web programming with Python. Testing, Abstract How do you know that your program works? Can you rely on yourself to write flawless code all the time?

Python is meant to be easy to work with and to help make the development fast. The flexibility needed for this comes with a hefty price in terms of efficiency. Packaging Your Programs Abstract Once your program is ready for release, you will probably want to package it properly before distributing it.

If it consists of a single. Users normally want to simply double-click an installation program, follow some installation wizard, and then have your program ready to run. Playful Programming Abstract At this point, you should have a clearer picture of how Python works than when you started. Now the rubber hits the road, so to speak, and in the next ten chapters you put your newfound skills to work.

Each chapter contains a single do-it-yourself project with a lot of room for experimentation, while at the same time giving you the necessary tools to implement a solution. The goal of this project is to generate a full web site from a single XML file that describes the various web pages and directories.

Project 4: In the News Abstract The Internet is replete with news sources in many forms, including newspapers, video channels, blogs and podcasts, to name a few. Some of these also provide services, such as RSS or Atom feeds, that let you retrieve the latest news using relatively simple code, without having to parse their web pages.

There are many ways to create such a beast in Python. The specific application is remote editing—editing a document on another machine via the Web.

This can be useful in collaboration systems groupware , for example, where several people may be working on the same document. It can also be useful for updating your web pages.

In this chapter, you will implement another such system: a web-based discussion forum. While the functionality is a far cry from complex social media platforms, it does implement the basics needed for comment systems, for example.

Abstract This is a relatively short project because much of the functionality you need has already been written—in Chapter In this chapter, you see how easy it can be to add a GUI to an existing Python program. Magnus Lie Hetland.


Beginning Python: From Novice to Professional, 3rd Edition by Magnus Lie Hetland



Beginning Python: From Novice to Professional



Beginning Python: From Novice to Professional, 3rd Edition



Beginning Python by Magnus Lie Hetland PDF Download


Related Articles