Table that contains the results that meet the search criteria.
Discover Python, Part 8: Reading and writing data using Python's input and output functionality
In this article, you learn how to work with files. First, we review a simple way to output data in Python, using the print statement, then learn about the file object, which is used by Python programs to read and write data to a file. The different modes with which a file can be opened are demonstrated, and the article concludes by showing how to read and write a binary file.
Articles
03 Jan 2006
Discover Python, Part 7: Explore the Python type hierarchy
This article returns to the exploration of the Python type hierarchy and introduces the Python dictionary container type. Unlike the Python tuple, string, and list container types discussed in previous articles, the dictionary type is an unordered container that relies on a key-to-value mapping. As a result, items in a dictionary are accessed by a key value and not by their location within a sequence. The unique features of the dictionary type may seem unusual, but they provide a great deal of power when used properly.
Articles
06 Dec 2005
Discover Python, Part 6: Programming in Python
This article explores the Python for loop. The for loop is used to iterate through the items in a Python collection, including the Python tuple, string, and list container types discussed in previous "Discover Python" articles. The for loop can also be used to access elements from a container type by using the range (or xrange) method. In addition, you can use the range method to execute a group of statements a specific number of times within a for loop.
Articles
25 Oct 2005
Discover Python, Part 5: Programming in Python
This article begins to demonstrate how to do things in Python by focusing on flow control, which is one of the simplest methods for writing programs. In this programming model, data is manipulated -- perhaps from a user interface, sensors, or a file; depending on the value of the data or resulting expressions, different actions are taken. Python provides several flow control mechanisms. This article discusses the if statement, and the while and for loops.
Articles
20 Sep 2005
Discover Python, Part 2: Explore the Python type hierarchy
The Python programming language is a simple yet powerful language. This article explores the object nature of the language, initially for the built-in simple types. The Python tuple class is also introduced and used to demonstrate the concept of a container type.
Articles
31 May 2005
Discover Python, Part 1: Python's built-in numerical types
The flexible nature of the Python programming language supports multiple programming philosophies, including procedural, object-oriented, and functional. But most importantly, programming in Python is fun. The language supports rather than hinders the development process. This article, the first in a series on Python programming, introduces Python and its built-in numerical types.
Articles
03 May 2005
Discover Python, Part 4: Explore the Python type hierarchy
Python provides a number of useful features, of which the list class is one of the most important. This article introduces the list class and demonstrates some of the many ways in which you can use it to simplify difficult programming tasks.
Articles
30 Aug 2005
Discover Python, Part 3: Explore the Python type hierarchy
Unlike many other programming languages, the Python language does not include a special data type to handle a single character, such as "a" or "z." In contrast, Python takes a different approach: It uses a class designed especially for holding sequences of characters. This article introduces the string class and demonstrates different ways in which you can use a string within Python.
Articles
02 Aug 2005
Discover Python, Part 9: Putting it all together
Previous articles in this Discover Python series have discussed a number of topics that confront beginning Python programmers, including variables, container objects, and compound statements. This article builds on these concepts to construct a complete Python program. It introduces Python functions and modules and shows how to build a Python program, store it in a file, and run it from the command line.
Articles
31 Jan 2006
Deploying Django applications to a production server
Django is a Python-based open source Web application framework that
focuses on making the process of creating database-driven Web sites and Web
applications easier. Getting started with developing Django applications is
simple, as a development Web server is included with the framework. However,
this server is not suitable for use in a production environment, so further
steps are required to deploy your Django application to the Web. In
this article, you will learn about the Django framework and how to install it
on your local machine. Discover how a Django application is made and
about the automatic administration interface created for your application. You
will then find out how to deploy your Django application to the Web on a
server running Apache and mod_python. Finally, learn how Django
applications can and should be scaled as your application's requirements
grow.
Articles
07 Apr 2009
Python 3 primer, Part 2: Advanced topics
Python 3 is the latest version of Guido van Rossum's powerful
general-purpose programming language. It breaks backwards compatibility with
the 2.x line but has cleaned up some syntax issues. This second article builds
on the previous article. In Part 2 of this two-part series, discover more new Python features
and details on more advanced topics such as changes in abstract base classes,
metaclasses, and decorators.