ラベル python の投稿を表示しています。 すべての投稿を表示
ラベル python の投稿を表示しています。 すべての投稿を表示

2012年8月19日日曜日

Downside of Python

Execution speed
After using it for 17 years and teaching it for 12, the only downside to Python I’ve found is that, as currently implemented, its execution speed may not always be as fast as that of compiled languages such as C and C++.
We’ll talk about implementation concepts in detail later in this book. In short, the standard implementations of Python today compile (i.e., translate) source code statements to an intermediate format known as byte code and then interpret the byte code. Byte code provides portability, as it is a platform-independent format. However, because Python is not compiled all the way down to binary machine code (e.g., instructions for an Intel chip), some programs will run more slowly in Python than in a fully compiled language like C.

Managing multiple Python installation on Mac OS X

Managing multiple Python installation on Mac OS X

Step 2: Storing Record Persistently

To make our people persistent, they need to be stored in a file or some sort.

Using formatted files
One way to keep our data around between our program runs is to write all the data out to a simple text file, in a formatted way.

Data format script

2012年8月18日土曜日

Programming Python

The task
You need track the information of people.
You want write programs that keeps track of details about people.

Step 1: Representing record
What records in a data base look like?

built-in objects: lists, dictionaries


Step 2: Storing Records Persistently
They need to be stored to file or some sort.


Step 3: Stepping up OOP
Structure, encapsulation and customization.


Step 4:  Adding Console Interaction


Step 5: Adding GUI


Step 6: Adding Web Interface
Basic CGI script