[CPyUG:41044] You Used Python to Write WHAT?

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

[CPyUG:41044] You Used Python to Write WHAT?

Qutr
一片文章,大家看看!
http://www.cio.com/article/185350/You_Used_Python_to_Write_WHAT_

--
软件以程序员为本,程序员以技术为本!

--~--~---------~--~----~------------~-------~--~----~
'''邮件来自Groups "python-cn"--China Py User Group
详情: http://groups-beta.google.com/group/python-cn
发言: [hidden email]
退订: [hidden email]
维基: http://wiki.woodpecker.org.cn/moin/CPUG
珠江事务: http://groups.google.com/group/zpug
东南事务: http://groups.google.com/group/cpug-eastchina
北京事务: http://groups.google.com/group/bpug
中国事务: http://groups.google.com/group/CPUG
同质列表: http://python.cn/mailman/listinfo/python-chinese
'''
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

[CPyUG:41221] Re: You Used Python to Write WHAT?

A.TNG
连不上,能不能贴过来。

2008/2/25 Qutr <[hidden email]>:
一片文章,大家看看!
http://www.cio.com/article/185350/You_Used_Python_to_Write_WHAT_

--
软件以程序员为本,程序员以技术为本!




--
-------------------------------------------
Best Regard,
Tang, Jiyu (Joey)
--~--~---------~--~----~------------~-------~--~----~
'''邮件来自Groups "python-cn"--China Py User Group
详情: http://groups-beta.google.com/group/python-cn
发言: [hidden email]
退订: [hidden email]
维基: http://wiki.woodpecker.org.cn/moin/CPUG
珠江事务: http://groups.google.com/group/zpug
东南事务: http://groups.google.com/group/cpug-eastchina
北京事务: http://groups.google.com/group/bpug
中国事务: http://groups.google.com/group/CPUG
同质列表: http://python.cn/mailman/listinfo/python-chinese
'''
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

[CPyUG:41245] Re: You Used Python to Write WHAT?

drivel-2

You Used Python to Write WHAT?
Python is a powerful, easy-to-use scripting language suitable for use
in the enterprise, although it is not right for absolutely every use.
Python expert Martin Aspeli identifies when Python is the right
choice, and when another language might be a better option.
February 19, 2008 -- CIO -- Programming language decisions often come
down to personal preference and experience. Most modern languages are
capable of performing the majority of programming tasks and include
the necessary libraries to be useful day to day. Sometimes,
interoperability concerns can dictate a particular platform, but
nowadays, interoperability is commonly best achieved through XML
interchange, shared SQL databases or Web services.

Therefore, when choosing a language for a particular purpose, it is
often more important to look at how a language is designed, what it
makes particularly easy, and what it makes more difficult. If features
or performance do not detract, intangibles such as "feel," "elegance"
and a sense of programmer productivity should be given serious
weight.

Python is a powerful, opinionated and idiosyncratic scripting
language, loved (and hated) by programmers the world over for its
style, syntax and attention to whitespace. It excels as a "glue"
language for putting together applications quickly, and many Python
developers feel more productive in Python than in other languages.
This article shows you why, and also points out situations when Python
is perhaps not such a good choice.

First, let's take a quick look at the way Python works: a very short
technical overview (suitable even for nontechnical managers).

To give you a feel for how Python looks, here is a short code snippet:

def say_hello(name):
      """ Issue a familiar greeting
      """
      print "Hello %s" % name

  say_hello("Guido")

You may not know much about Python, but you can probably guess what's
going on. This is Python's single best feature: Things generally work
the way you expect. This obviousness in syntax makes the language
relatively easy to learn for new programmers and easy to remember for
occasional ones. However, the fact that it differs substantially from
most other languages can be a barrier.

Programming the Way Guido Indented It
Python was created by Guido van Rossum, its "Benevolent Dictator for
Life." The language and its standard library are developed by a
thriving open-source community, but under Guido's watchful eye,
Python's consistency and spirit remain intact. First released in the
1990s, Python is still evolving today.

Python is fully object oriented and includes a few functional
programming constructs. It also has built-in support for commonly used
data structures such as lists, dictionaries and sets. Its creators
emphasize readability, consistency and simplicity; they believe that
programming languages should be concise, but not too clever for their
own good.

The main implementation of Python is written in C and runs on
virtually any modern platform. There are also implementations that run
inside a Java Virtual Machine (Jython, JPype), on the .Net platform
(IronPython) and even one written in Python itself, called PyPy.

The C implementation is highly optimized, and is usually more than
fast enough for normal programming tasks. However, if raw speed is
your primary priority, look to a compiled language such as C. For
embedded systems with limited memory, Python's runtime overhead may
also be a problem.

Python as a General-Purpose Language
Python is the default choice of scripting language for many
developers. In the words of one Pythonista, it is rare to start a
project with Python and discover that it was an entirely inappropriate
choice as it grows, because Python scales both in project size and
performance. That said, the degree of freedom that the language grants
developers means they sometimes have to be a little more disciplined
in how they structure their code.

It takes almost no effort to get started with Python. At its simplest,
you can just launch the python interpreter and type away in
interactive mode. The results of your statements are printed to the
console immediately:

$ python
>>> price = 30.0
>>> quantity = 2
>>> print "Total: %f" % round(price * quantity)
The total cost is 60.0

Of course, this is useful only for very simple tasks, but save those
statements to a file with a .py file, run that file through the
interpreter and the script is executed.

As programs grow more complex, developers may define functions and
classes and split code across multiple modules, or source files that
make up the same program. Modules can be organized into packages,
which can be turned into distributable, self-contained bundles (known
as eggs).

You can find thousands of free Python packages at the Python Package
Index. For day-to-day tasks, Python's standard library includes
everything from shell interaction to file management, XML and CSV
manipulation, and much more.

Python has a strong role in business computing, particularly in Web
and enterprise development. Let's take a look at when it's the best
(and not-so-best) choice.

Python on the Desktop
You can write desktop applications in Python using frameworks such as
WxPython or PyGTK. However, most desktop applications are still
written in compiled languages such as C, C++ or C#. The frameworks for
these languages tend to have more sophisticated development tools and
the resulting programs are often easier to distribute, as they do not
require the user to have Python installed.

Python has good graphical development tools, including Wing IDE and
the Eclipse PyDev extensions. However, most Python developers work
"Unix style" with standalone text editors and terminals. On platforms
like Java or .Net, environments such as Microsoft's Visual Studio will
always offer tighter integration with the programming language.
Whether this is a blessing or a curse depends on what type of
developer you speak to.

Python for the Web
Much has been made recently of an alleged exodus of Java programmers,
who, fed up with Java's overhead and its enterprise frameworks, are
making the leap to Ruby on Rails and "lightweight" rapid Web
development. The Rails proponents are very good at marketing, but most
of the same benefits can be found in the Python world.

In fact, several successful rapid Web application frameworks are
available for Python, each with its own slant. Many also share
components. The most popular include Django, Pylons, TurboGears,
CherryPy, Zope and Grok (which is based on Zope).

These frameworks are all suitable for serious applications. Zope, for
example, was a pioneering open-source application server that helped
prove Python's viability in the enterprise (although many Python
developers these days feel it is a little "unPythonic"). Plone, a
popular open-source content management system--to which the author is a
contributor--runs on Zope and has been implemented in organizations
such as Novell and Oxfam. The high-traffic Reddit.com runs Pylons. The
Revver.com video sharing site uses Django.

Deploying a Python Web application is usually straightforward,
although not quite as easy as deploying a PHP application in Apache.
Database connectivity is very well catered to by object/relational
mappers such as SQLAlchemy. However, most Python Web frameworks have
yet to catch up to enterprise-grade application servers for Java
or .Net in terms of support for high-availability clustering, failover
and server management.

Python in the Enterprise
Many large organizations have standardized their development on one of
the two main "enterprise" platforms, Java or .Net, believing that
doing so will improve interoperability and lower maintenance costs.
Although Python does not quite operate with the same ubiquity or
scale, it is a very useful complement, and Python is a solid
alternative when such platforms are inappropriate.

The traditional enterprise platforms are by necessity large and
complex. They depend on elaborate tools to manage code, builds and
deployments. For many purposes, this is overkill. Any programmer
should be able to reach for her favorite language when inspiration
hits her, and Python's immediacy makes it well suited for simple
automation tasks and quick prototyping. Developers usually also feel
that Python gives them the headroom to move beyond a prototype without
throwing away their previous work.

Indeed, Python can be used for large and complex software systems.
YouTube, for instance, runs mainly on Python, and it is an oft-
preferred language at organizations including Google, NASA and
Industrial Light and Magic. Specialized Python libraries and
frameworks exist for scientific programming, data manipulation, Web
services, XML interchange and many other things.

The main disadvantage of using Python in an enterprise setting is that
Python programmers can be harder to find than, say, Java developers.
Python is easy to pick up for an experienced programmer, but the
plethora of books, training courses and certifications in the Java
world cannot be matched by Python.

Furthermore, the power and expressivity that Python offers means that
it may require more skilled developers. Java or C# are more
restrictive by design, forcing programmers to adhere to stricter rules
around type safety and interface compliance. For some, that hinders
productivity. For others, it reduces mistakes or accidents of design.

Finally, application integration concerns may dictate a certain
language or platform. However, in today's service-oriented,
heterogeneous systems landscape, it is entirely possible to--for example
--write a Web service in Python that plugs into a Java service bus and
is ultimately consumed by a Visual Basic program.

The Flying Circus
Python has a long history, but a program written for Python 1.0 still
runs under the latest version, Python 2.5. New features and
improvements continue to be added, following a structured proposal and
review process.

In 2006, van Rossum began an effort he coyly dubbed "Python 3000."
This aimed to look at how the language could be improved if absolute
backwards compatibility was dropped. This effort is now coming to
fruition, producing the first alpha releases of Python 3.0.

Naturally, the premise of a backwards-incompatible version of the
language has caused some concern. It remains to be seen how larger
Python projects manage a transition to Python 3.0, and how the rate of
adoption of Python 3.0 impacts the pool of third-party libraries and
frameworks.

However, Python core developers are committed to supporting existing
language users. A 2.6 version of Python is due imminently, and the 2.x
line is likely to continue with a 2.7 and maybe a 2.8. Conversion
tools are also being made available that can analyze a Python 2.x code
base and transform it for 3.0 compatibility, often without manual
intervention. In the author's opinion, the Python community is large
and vibrant enough to withstand some pressure, when in the long run
the changes are likely to benefit everyone.

When to Consider Python
In this article, we discussed Python's strengths and weaknesses -
particularly for enterprise environments. Briefly, you should consider
Python when you (or your programmers):

Need a general-purpose, proven and reliable scripting language that
comes with a rich standard library

Want a language that is useful across a range of programming tasks,
from shell automation to Web applications

Like Python's philosophy and syntax

Find the language fun and productive.

Python may not be an appropriate choice if you:

Are building embedded or massively parallel systems for which a
scripting language would be an inappropriate choice (due to concerns
about execution speed)

Build primarily desktop applications, especially for Windows.
Platforms like .Net usually offer more sophisticated tools and easier
distribution of the final software.

Rely on teams of less-experienced programmers. These developers may
benefit from the wider availability of training for languages like
Java and are less likely to make mistakes with a compile-time, type-
checked language.

Have specialized needs better served by other languages that you
already know. For example, if you want to do a lot of text processing
and you have a basement full of Perl programmers, there's no
compelling reason to switch.

Martin Aspeli is a business consultant, software engineer, songwriter
and émigré in London. He contributes vocally and prolifically to the
Plone open-source CMS, and has written a book called Professional
Plone Development (Packt, 2007). He sometimes blogs at http://martinaspeli.net.


(c) 2007 CXO Media Inc.

On 2月25日, 下午10时52分, Joey <[hidden email]> wrote:

> 连不上,能不能贴过来。
>
> 2008/2/25 Qutr <[hidden email]>:
>
> > 一片文章,大家看看!
> >http://www.cio.com/article/185350/You_Used_Python_to_Write_WHAT_
>
> > --
> > 软件以程序员为本,程序员以技术为本!
>
> --
> -------------------------------------------
> Best Regard,
> Tang, Jiyu (Joey)
--~--~---------~--~----~------------~-------~--~----~
'''邮件来自Groups "python-cn"--China Py User Group
详情: http://groups-beta.google.com/group/python-cn
发言: [hidden email]
退订: [hidden email]
维基: http://wiki.woodpecker.org.cn/moin/CPUG
珠江事务: http://groups.google.com/group/zpug
东南事务: http://groups.google.com/group/cpug-eastchina
北京事务: http://groups.google.com/group/bpug
中国事务: http://groups.google.com/group/CPUG
同质列表: http://python.cn/mailman/listinfo/python-chinese
'''
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

[CPyUG:41247] Re: You Used Python to Write WHAT?

Mr Shore

不想看
因为我觉得python可以do所有thing
2008/2/26, drivel <[hidden email]>:

You Used Python to Write WHAT?
Python is a powerful, easy-to-use scripting language suitable for use
in the enterprise, although it is not right for absolutely every use.
Python expert Martin Aspeli identifies when Python is the right
choice, and when another language might be a better option.
February 19, 2008 -- CIO -- Programming language decisions often come
down to personal preference and experience. Most modern languages are
capable of performing the majority of programming tasks and include
the necessary libraries to be useful day to day. Sometimes,
interoperability concerns can dictate a particular platform, but
nowadays, interoperability is commonly best achieved through XML
interchange, shared SQL databases or Web services.

Therefore, when choosing a language for a particular purpose, it is
often more important to look at how a language is designed, what it
makes particularly easy, and what it makes more difficult. If features
or performance do not detract, intangibles such as "feel," "elegance"
and a sense of programmer productivity should be given serious
weight.

Python is a powerful, opinionated and idiosyncratic scripting
language, loved (and hated) by programmers the world over for its
style, syntax and attention to whitespace. It excels as a "glue"
language for putting together applications quickly, and many Python
developers feel more productive in Python than in other languages.
This article shows you why, and also points out situations when Python
is perhaps not such a good choice.

First, let's take a quick look at the way Python works: a very short
technical overview (suitable even for nontechnical managers).

To give you a feel for how Python looks, here is a short code snippet:

def say_hello(name):
      """ Issue a familiar greeting
      """
      print "Hello %s" % name

  say_hello("Guido")

You may not know much about Python, but you can probably guess what's
going on. This is Python's single best feature: Things generally work
the way you expect. This obviousness in syntax makes the language
relatively easy to learn for new programmers and easy to remember for
occasional ones. However, the fact that it differs substantially from
most other languages can be a barrier.

Programming the Way Guido Indented It
Python was created by Guido van Rossum, its "Benevolent Dictator for
Life." The language and its standard library are developed by a
thriving open-source community, but under Guido's watchful eye,
Python's consistency and spirit remain intact. First released in the
1990s, Python is still evolving today.

Python is fully object oriented and includes a few functional
programming constructs. It also has built-in support for commonly used
data structures such as lists, dictionaries and sets. Its creators
emphasize readability, consistency and simplicity; they believe that
programming languages should be concise, but not too clever for their
own good.

The main implementation of Python is written in C and runs on
virtually any modern platform. There are also implementations that run
inside a Java Virtual Machine (Jython, JPype), on the .Net platform
(IronPython) and even one written in Python itself, called PyPy.

The C implementation is highly optimized, and is usually more than
fast enough for normal programming tasks. However, if raw speed is
your primary priority, look to a compiled language such as C. For
embedded systems with limited memory, Python's runtime overhead may
also be a problem.

Python as a General-Purpose Language
Python is the default choice of scripting language for many
developers. In the words of one Pythonista, it is rare to start a
project with Python and discover that it was an entirely inappropriate
choice as it grows, because Python scales both in project size and
performance. That said, the degree of freedom that the language grants
developers means they sometimes have to be a little more disciplined
in how they structure their code.

It takes almost no effort to get started with Python. At its simplest,
you can just launch the python interpreter and type away in
interactive mode. The results of your statements are printed to the
console immediately:

$ python
>>> price = 30.0
>>> quantity = 2
>>> print "Total: %f" % round(price * quantity)
The total cost is 60.0

Of course, this is useful only for very simple tasks, but save those
statements to a file with a .py file, run that file through the
interpreter and the script is executed.

As programs grow more complex, developers may define functions and
classes and split code across multiple modules, or source files that
make up the same program. Modules can be organized into packages,
which can be turned into distributable, self-contained bundles (known
as eggs).

You can find thousands of free Python packages at the Python Package
Index. For day-to-day tasks, Python's standard library includes
everything from shell interaction to file management, XML and CSV
manipulation, and much more.

Python has a strong role in business computing, particularly in Web
and enterprise development. Let's take a look at when it's the best
(and not-so-best) choice.

Python on the Desktop
You can write desktop applications in Python using frameworks such as
WxPython or PyGTK. However, most desktop applications are still
written in compiled languages such as C, C++ or C#. The frameworks for
these languages tend to have more sophisticated development tools and
the resulting programs are often easier to distribute, as they do not
require the user to have Python installed.

Python has good graphical development tools, including Wing IDE and
the Eclipse PyDev extensions. However, most Python developers work
"Unix style" with standalone text editors and terminals. On platforms
like Java or .Net, environments such as Microsoft's Visual Studio will
always offer tighter integration with the programming language.
Whether this is a blessing or a curse depends on what type of
developer you speak to.

Python for the Web
Much has been made recently of an alleged exodus of Java programmers,
who, fed up with Java's overhead and its enterprise frameworks, are
making the leap to Ruby on Rails and "lightweight" rapid Web
development. The Rails proponents are very good at marketing, but most
of the same benefits can be found in the Python world.

In fact, several successful rapid Web application frameworks are
available for Python, each with its own slant. Many also share
components. The most popular include Django, Pylons, TurboGears,
CherryPy, Zope and Grok (which is based on Zope).

These frameworks are all suitable for serious applications. Zope, for
example, was a pioneering open-source application server that helped
prove Python's viability in the enterprise (although many Python
developers these days feel it is a little "unPythonic"). Plone, a
popular open-source content management system--to which the author is a
contributor--runs on Zope and has been implemented in organizations
such as Novell and Oxfam. The high-traffic Reddit.com runs Pylons. The
Revver.com video sharing site uses Django.

Deploying a Python Web application is usually straightforward,
although not quite as easy as deploying a PHP application in Apache.
Database connectivity is very well catered to by object/relational
mappers such as SQLAlchemy. However, most Python Web frameworks have
yet to catch up to enterprise-grade application servers for Java
or .Net in terms of support for high-availability clustering, failover
and server management.

Python in the Enterprise
Many large organizations have standardized their development on one of
the two main "enterprise" platforms, Java or .Net, believing that
doing so will improve interoperability and lower maintenance costs.
Although Python does not quite operate with the same ubiquity or
scale, it is a very useful complement, and Python is a solid
alternative when such platforms are inappropriate.

The traditional enterprise platforms are by necessity large and
complex. They depend on elaborate tools to manage code, builds and
deployments. For many purposes, this is overkill. Any programmer
should be able to reach for her favorite language when inspiration
hits her, and Python's immediacy makes it well suited for simple
automation tasks and quick prototyping. Developers usually also feel
that Python gives them the headroom to move beyond a prototype without
throwing away their previous work.

Indeed, Python can be used for large and complex software systems.
YouTube, for instance, runs mainly on Python, and it is an oft-
preferred language at organizations including Google, NASA and
Industrial Light and Magic. Specialized Python libraries and
frameworks exist for scientific programming, data manipulation, Web
services, XML interchange and many other things.

The main disadvantage of using Python in an enterprise setting is that
Python programmers can be harder to find than, say, Java developers.
Python is easy to pick up for an experienced programmer, but the
plethora of books, training courses and certifications in the Java
world cannot be matched by Python.

Furthermore, the power and expressivity that Python offers means that
it may require more skilled developers. Java or C# are more
restrictive by design, forcing programmers to adhere to stricter rules
around type safety and interface compliance. For some, that hinders
productivity. For others, it reduces mistakes or accidents of design.

Finally, application integration concerns may dictate a certain
language or platform. However, in today's service-oriented,
heterogeneous systems landscape, it is entirely possible to--for example
--write a Web service in Python that plugs into a Java service bus and
is ultimately consumed by a Visual Basic program.

The Flying Circus
Python has a long history, but a program written for Python 1.0 still
runs under the latest version, Python 2.5. New features and
improvements continue to be added, following a structured proposal and
review process.

In 2006, van Rossum began an effort he coyly dubbed "Python 3000."
This aimed to look at how the language could be improved if absolute
backwards compatibility was dropped. This effort is now coming to
fruition, producing the first alpha releases of Python 3.0.

Naturally, the premise of a backwards-incompatible version of the
language has caused some concern. It remains to be seen how larger
Python projects manage a transition to Python 3.0, and how the rate of
adoption of Python 3.0 impacts the pool of third-party libraries and
frameworks.

However, Python core developers are committed to supporting existing
language users. A 2.6 version of Python is due imminently, and the 2.x
line is likely to continue with a 2.7 and maybe a 2.8. Conversion
tools are also being made available that can analyze a Python 2.x code
base and transform it for 3.0 compatibility, often without manual
intervention. In the author's opinion, the Python community is large
and vibrant enough to withstand some pressure, when in the long run
the changes are likely to benefit everyone.

When to Consider Python
In this article, we discussed Python's strengths and weaknesses -
particularly for enterprise environments. Briefly, you should consider
Python when you (or your programmers):

Need a general-purpose, proven and reliable scripting language that
comes with a rich standard library

Want a language that is useful across a range of programming tasks,
from shell automation to Web applications

Like Python's philosophy and syntax

Find the language fun and productive.

Python may not be an appropriate choice if you:

Are building embedded or massively parallel systems for which a
scripting language would be an inappropriate choice (due to concerns
about execution speed)

Build primarily desktop applications, especially for Windows.
Platforms like .Net usually offer more sophisticated tools and easier
distribution of the final software.

Rely on teams of less-experienced programmers. These developers may
benefit from the wider availability of training for languages like
Java and are less likely to make mistakes with a compile-time, type-
checked language.

Have specialized needs better served by other languages that you
already know. For example, if you want to do a lot of text processing
and you have a basement full of Perl programmers, there's no
compelling reason to switch.

Martin Aspeli is a business consultant, software engineer, songwriter
and émigré in London. He contributes vocally and prolifically to the
Plone open-source CMS, and has written a book called Professional
Plone Development (Packt, 2007). He sometimes blogs at http://martinaspeli.net.


(c) 2007 CXO Media Inc.


On 2月25日, 下午10时52分, Joey <[hidden email]> wrote:
> 连不上,能不能贴过来。
>

> 2008/2/25 Qutr <[hidden email]>:

>
> > 一片文章,大家看看!
> >http://www.cio.com/article/185350/You_Used_Python_to_Write_WHAT_
>
> > --
> > 软件以程序员为本,程序员以技术为本!
>
> --
> -------------------------------------------
> Best Regard,
> Tang, Jiyu (Joey)

--~--~---------~--~----~------------~-------~--~----~
'''邮件来自Groups "python-cn"--China Py User Group
详情: http://groups-beta.google.com/group/python-cn
发言: [hidden email]
退订: [hidden email]
维基: http://wiki.woodpecker.org.cn/moin/CPUG
珠江事务: http://groups.google.com/group/zpug
东南事务: http://groups.google.com/group/cpug-eastchina
北京事务: http://groups.google.com/group/bpug
中国事务: http://groups.google.com/group/CPUG
同质列表: http://python.cn/mailman/listinfo/python-chinese
'''
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

[CPyUG:41328] Re: You Used Python to Write WHAT?

Wan Li
视频和3D呢?

On Tue, Feb 26, 2008 at 12:39 AM, Mr Shore <[hidden email]> wrote:

不想看
因为我觉得python可以do所有thing
2008/2/26, drivel <[hidden email]>:

You Used Python to Write WHAT?
Python is a powerful, easy-to-use scripting language suitable for use
in the enterprise, although it is not right for absolutely every use.
Python expert Martin Aspeli identifies when Python is the right
choice, and when another language might be a better option.
February 19, 2008 -- CIO -- Programming language decisions often come
down to personal preference and experience. Most modern languages are
capable of performing the majority of programming tasks and include
the necessary libraries to be useful day to day. Sometimes,
interoperability concerns can dictate a particular platform, but
nowadays, interoperability is commonly best achieved through XML
interchange, shared SQL databases or Web services.

Therefore, when choosing a language for a particular purpose, it is
often more important to look at how a language is designed, what it
makes particularly easy, and what it makes more difficult. If features
or performance do not detract, intangibles such as "feel," "elegance"
and a sense of programmer productivity should be given serious
weight.

Python is a powerful, opinionated and idiosyncratic scripting
language, loved (and hated) by programmers the world over for its
style, syntax and attention to whitespace. It excels as a "glue"
language for putting together applications quickly, and many Python
developers feel more productive in Python than in other languages.
This article shows you why, and also points out situations when Python
is perhaps not such a good choice.

First, let's take a quick look at the way Python works: a very short
technical overview (suitable even for nontechnical managers).

To give you a feel for how Python looks, here is a short code snippet:

def say_hello(name):
      """ Issue a familiar greeting
      """
      print "Hello %s" % name

  say_hello("Guido")

You may not know much about Python, but you can probably guess what's
going on. This is Python's single best feature: Things generally work
the way you expect. This obviousness in syntax makes the language
relatively easy to learn for new programmers and easy to remember for
occasional ones. However, the fact that it differs substantially from
most other languages can be a barrier.

Programming the Way Guido Indented It
Python was created by Guido van Rossum, its "Benevolent Dictator for
Life." The language and its standard library are developed by a
thriving open-source community, but under Guido's watchful eye,
Python's consistency and spirit remain intact. First released in the
1990s, Python is still evolving today.

Python is fully object oriented and includes a few functional
programming constructs. It also has built-in support for commonly used
data structures such as lists, dictionaries and sets. Its creators
emphasize readability, consistency and simplicity; they believe that
programming languages should be concise, but not too clever for their
own good.

The main implementation of Python is written in C and runs on
virtually any modern platform. There are also implementations that run
inside a Java Virtual Machine (Jython, JPype), on the .Net platform
(IronPython) and even one written in Python itself, called PyPy.

The C implementation is highly optimized, and is usually more than
fast enough for normal programming tasks. However, if raw speed is
your primary priority, look to a compiled language such as C. For
embedded systems with limited memory, Python's runtime overhead may
also be a problem.

Python as a General-Purpose Language
Python is the default choice of scripting language for many
developers. In the words of one Pythonista, it is rare to start a
project with Python and discover that it was an entirely inappropriate
choice as it grows, because Python scales both in project size and
performance. That said, the degree of freedom that the language grants
developers means they sometimes have to be a little more disciplined
in how they structure their code.

It takes almost no effort to get started with Python. At its simplest,
you can just launch the python interpreter and type away in
interactive mode. The results of your statements are printed to the
console immediately:

$ python
>>> price = 30.0
>>> quantity = 2
>>> print "Total: %f" % round(price * quantity)
The total cost is 60.0

Of course, this is useful only for very simple tasks, but save those
statements to a file with a .py file, run that file through the
interpreter and the script is executed.

As programs grow more complex, developers may define functions and
classes and split code across multiple modules, or source files that
make up the same program. Modules can be organized into packages,
which can be turned into distributable, self-contained bundles (known
as eggs).

You can find thousands of free Python packages at the Python Package
Index. For day-to-day tasks, Python's standard library includes
everything from shell interaction to file management, XML and CSV
manipulation, and much more.

Python has a strong role in business computing, particularly in Web
and enterprise development. Let's take a look at when it's the best
(and not-so-best) choice.

Python on the Desktop
You can write desktop applications in Python using frameworks such as
WxPython or PyGTK. However, most desktop applications are still
written in compiled languages such as C, C++ or C#. The frameworks for
these languages tend to have more sophisticated development tools and
the resulting programs are often easier to distribute, as they do not
require the user to have Python installed.

Python has good graphical development tools, including Wing IDE and
the Eclipse PyDev extensions. However, most Python developers work
"Unix style" with standalone text editors and terminals. On platforms
like Java or .Net, environments such as Microsoft's Visual Studio will
always offer tighter integration with the programming language.
Whether this is a blessing or a curse depends on what type of
developer you speak to.

Python for the Web
Much has been made recently of an alleged exodus of Java programmers,
who, fed up with Java's overhead and its enterprise frameworks, are
making the leap to Ruby on Rails and "lightweight" rapid Web
development. The Rails proponents are very good at marketing, but most
of the same benefits can be found in the Python world.

In fact, several successful rapid Web application frameworks are
available for Python, each with its own slant. Many also share
components. The most popular include Django, Pylons, TurboGears,
CherryPy, Zope and Grok (which is based on Zope).

These frameworks are all suitable for serious applications. Zope, for
example, was a pioneering open-source application server that helped
prove Python's viability in the enterprise (although many Python
developers these days feel it is a little "unPythonic"). Plone, a
popular open-source content management system--to which the author is a
contributor--runs on Zope and has been implemented in organizations
such as Novell and Oxfam. The high-traffic Reddit.com runs Pylons. The
Revver.com video sharing site uses Django.

Deploying a Python Web application is usually straightforward,
although not quite as easy as deploying a PHP application in Apache.
Database connectivity is very well catered to by object/relational
mappers such as SQLAlchemy. However, most Python Web frameworks have
yet to catch up to enterprise-grade application servers for Java
or .Net in terms of support for high-availability clustering, failover
and server management.

Python in the Enterprise
Many large organizations have standardized their development on one of
the two main "enterprise" platforms, Java or .Net, believing that
doing so will improve interoperability and lower maintenance costs.
Although Python does not quite operate with the same ubiquity or
scale, it is a very useful complement, and Python is a solid
alternative when such platforms are inappropriate.

The traditional enterprise platforms are by necessity large and
complex. They depend on elaborate tools to manage code, builds and
deployments. For many purposes, this is overkill. Any programmer
should be able to reach for her favorite language when inspiration
hits her, and Python's immediacy makes it well suited for simple
automation tasks and quick prototyping. Developers usually also feel
that Python gives them the headroom to move beyond a prototype without
throwing away their previous work.

Indeed, Python can be used for large and complex software systems.
YouTube, for instance, runs mainly on Python, and it is an oft-
preferred language at organizations including Google, NASA and
Industrial Light and Magic. Specialized Python libraries and
frameworks exist for scientific programming, data manipulation, Web
services, XML interchange and many other things.

The main disadvantage of using Python in an enterprise setting is that
Python programmers can be harder to find than, say, Java developers.
Python is easy to pick up for an experienced programmer, but the
plethora of books, training courses and certifications in the Java
world cannot be matched by Python.

Furthermore, the power and expressivity that Python offers means that
it may require more skilled developers. Java or C# are more
restrictive by design, forcing programmers to adhere to stricter rules
around type safety and interface compliance. For some, that hinders
productivity. For others, it reduces mistakes or accidents of design.

Finally, application integration concerns may dictate a certain
language or platform. However, in today's service-oriented,
heterogeneous systems landscape, it is entirely possible to--for example
--write a Web service in Python that plugs into a Java service bus and
is ultimately consumed by a Visual Basic program.

The Flying Circus
Python has a long history, but a program written for Python 1.0 still
runs under the latest version, Python 2.5. New features and
improvements continue to be added, following a structured proposal and
review process.

In 2006, van Rossum began an effort he coyly dubbed "Python 3000."
This aimed to look at how the language could be improved if absolute
backwards compatibility was dropped. This effort is now coming to
fruition, producing the first alpha releases of Python 3.0.

Naturally, the premise of a backwards-incompatible version of the
language has caused some concern. It remains to be seen how larger
Python projects manage a transition to Python 3.0, and how the rate of
adoption of Python 3.0 impacts the pool of third-party libraries and
frameworks.

However, Python core developers are committed to supporting existing
language users. A 2.6 version of Python is due imminently, and the 2.x
line is likely to continue with a 2.7 and maybe a 2.8. Conversion
tools are also being made available that can analyze a Python 2.x code
base and transform it for 3.0 compatibility, often without manual
intervention. In the author's opinion, the Python community is large
and vibrant enough to withstand some pressure, when in the long run
the changes are likely to benefit everyone.

When to Consider Python
In this article, we discussed Python's strengths and weaknesses -
particularly for enterprise environments. Briefly, you should consider
Python when you (or your programmers):

Need a general-purpose, proven and reliable scripting language that
comes with a rich standard library

Want a language that is useful across a range of programming tasks,
from shell automation to Web applications

Like Python's philosophy and syntax

Find the language fun and productive.

Python may not be an appropriate choice if you:

Are building embedded or massively parallel systems for which a
scripting language would be an inappropriate choice (due to concerns
about execution speed)

Build primarily desktop applications, especially for Windows.
Platforms like .Net usually offer more sophisticated tools and easier
distribution of the final software.

Rely on teams of less-experienced programmers. These developers may
benefit from the wider availability of training for languages like
Java and are less likely to make mistakes with a compile-time, type-
checked language.

Have specialized needs better served by other languages that you
already know. For example, if you want to do a lot of text processing
and you have a basement full of Perl programmers, there's no
compelling reason to switch.

Martin Aspeli is a business consultant, software engineer, songwriter
and émigré in London. He contributes vocally and prolifically to the
Plone open-source CMS, and has written a book called Professional
Plone Development (Packt, 2007). He sometimes blogs at http://martinaspeli.net.


(c) 2007 CXO Media Inc.


On 2月25日, 下午10时52分, Joey <[hidden email]> wrote:
> 连不上,能不能贴过来。
>

> 2008/2/25 Qutr <[hidden email]>:

>
> > 一片文章,大家看看!
> >http://www.cio.com/article/185350/You_Used_Python_to_Write_WHAT_
>
> > --
> > 软件以程序员为本,程序员以技术为本!
>
> --
> -------------------------------------------
> Best Regard,
> Tang, Jiyu (Joey)





--
>: ~
--~--~---------~--~----~------------~-------~--~----~
'''邮件来自Groups "python-cn"--China Py User Group
详情: http://groups-beta.google.com/group/python-cn
发言: [hidden email]
退订: [hidden email]
维基: http://wiki.woodpecker.org.cn/moin/CPUG
珠江事务: http://groups.google.com/group/zpug
东南事务: http://groups.google.com/group/cpug-eastchina
北京事务: http://groups.google.com/group/bpug
中国事务: http://groups.google.com/group/CPUG
同质列表: http://python.cn/mailman/listinfo/python-chinese
'''
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

[CPyUG:41341] Re: You Used Python to Write WHAT?

Mr Shore
也可以 艘一下就行了
不过昨天调tinyp2p很诡异
经常xml.parsers.expat.ExpatError: not well-formed (invalid token)

2008/2/26, Question <[hidden email]>:
视频和3D呢?


On Tue, Feb 26, 2008 at 12:39 AM, Mr Shore <[hidden email]> wrote:

不想看
因为我觉得python可以do所有thing
2008/2/26, drivel <[hidden email]>:

You Used Python to Write WHAT?
Python is a powerful, easy-to-use scripting language suitable for use
in the enterprise, although it is not right for absolutely every use.
Python expert Martin Aspeli identifies when Python is the right
choice, and when another language might be a better option.
February 19, 2008 -- CIO -- Programming language decisions often come
down to personal preference and experience. Most modern languages are
capable of performing the majority of programming tasks and include
the necessary libraries to be useful day to day. Sometimes,
interoperability concerns can dictate a particular platform, but
nowadays, interoperability is commonly best achieved through XML
interchange, shared SQL databases or Web services.

Therefore, when choosing a language for a particular purpose, it is
often more important to look at how a language is designed, what it
makes particularly easy, and what it makes more difficult. If features
or performance do not detract, intangibles such as "feel," "elegance"
and a sense of programmer productivity should be given serious
weight.

Python is a powerful, opinionated and idiosyncratic scripting
language, loved (and hated) by programmers the world over for its
style, syntax and attention to whitespace. It excels as a "glue"
language for putting together applications quickly, and many Python
developers feel more productive in Python than in other languages.
This article shows you why, and also points out situations when Python
is perhaps not such a good choice.

First, let's take a quick look at the way Python works: a very short
technical overview (suitable even for nontechnical managers).

To give you a feel for how Python looks, here is a short code snippet:

def say_hello(name):
      """ Issue a familiar greeting
      """
      print "Hello %s" % name

  say_hello("Guido")

You may not know much about Python, but you can probably guess what's
going on. This is Python's single best feature: Things generally work
the way you expect. This obviousness in syntax makes the language
relatively easy to learn for new programmers and easy to remember for
occasional ones. However, the fact that it differs substantially from
most other languages can be a barrier.

Programming the Way Guido Indented It
Python was created by Guido van Rossum, its "Benevolent Dictator for
Life." The language and its standard library are developed by a
thriving open-source community, but under Guido's watchful eye,
Python's consistency and spirit remain intact. First released in the
1990s, Python is still evolving today.

Python is fully object oriented and includes a few functional
programming constructs. It also has built-in support for commonly used
data structures such as lists, dictionaries and sets. Its creators
emphasize readability, consistency and simplicity; they believe that
programming languages should be concise, but not too clever for their
own good.

The main implementation of Python is written in C and runs on
virtually any modern platform. There are also implementations that run
inside a Java Virtual Machine (Jython, JPype), on the .Net platform
(IronPython) and even one written in Python itself, called PyPy.

The C implementation is highly optimized, and is usually more than
fast enough for normal programming tasks. However, if raw speed is
your primary priority, look to a compiled language such as C. For
embedded systems with limited memory, Python's runtime overhead may
also be a problem.

Python as a General-Purpose Language
Python is the default choice of scripting language for many
developers. In the words of one Pythonista, it is rare to start a
project with Python and discover that it was an entirely inappropriate
choice as it grows, because Python scales both in project size and
performance. That said, the degree of freedom that the language grants
developers means they sometimes have to be a little more disciplined
in how they structure their code.

It takes almost no effort to get started with Python. At its simplest,
you can just launch the python interpreter and type away in
interactive mode. The results of your statements are printed to the
console immediately:

$ python
>>> price = 30.0
>>> quantity = 2
>>> print "Total: %f" % round(price * quantity)
The total cost is 60.0

Of course, this is useful only for very simple tasks, but save those
statements to a file with a .py file, run that file through the
interpreter and the script is executed.

As programs grow more complex, developers may define functions and
classes and split code across multiple modules, or source files that
make up the same program. Modules can be organized into packages,
which can be turned into distributable, self-contained bundles (known
as eggs).

You can find thousands of free Python packages at the Python Package
Index. For day-to-day tasks, Python's standard library includes
everything from shell interaction to file management, XML and CSV
manipulation, and much more.

Python has a strong role in business computing, particularly in Web
and enterprise development. Let's take a look at when it's the best
(and not-so-best) choice.

Python on the Desktop
You can write desktop applications in Python using frameworks such as
WxPython or PyGTK. However, most desktop applications are still
written in compiled languages such as C, C++ or C#. The frameworks for
these languages tend to have more sophisticated development tools and
the resulting programs are often easier to distribute, as they do not
require the user to have Python installed.

Python has good graphical development tools, including Wing IDE and
the Eclipse PyDev extensions. However, most Python developers work
"Unix style" with standalone text editors and terminals. On platforms
like Java or .Net, environments such as Microsoft's Visual Studio will
always offer tighter integration with the programming language.
Whether this is a blessing or a curse depends on what type of
developer you speak to.

Python for the Web
Much has been made recently of an alleged exodus of Java programmers,
who, fed up with Java's overhead and its enterprise frameworks, are
making the leap to Ruby on Rails and "lightweight" rapid Web
development. The Rails proponents are very good at marketing, but most
of the same benefits can be found in the Python world.

In fact, several successful rapid Web application frameworks are
available for Python, each with its own slant. Many also share
components. The most popular include Django, Pylons, TurboGears,
CherryPy, Zope and Grok (which is based on Zope).

These frameworks are all suitable for serious applications. Zope, for
example, was a pioneering open-source application server that helped
prove Python's viability in the enterprise (although many Python
developers these days feel it is a little "unPythonic"). Plone, a
popular open-source content management system--to which the author is a
contributor--runs on Zope and has been implemented in organizations
such as Novell and Oxfam. The high-traffic <a href="http://Reddit.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">Reddit.com runs Pylons. The
<a href="http://Revver.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">Revver.com video sharing site uses Django.

Deploying a Python Web application is usually straightforward,
although not quite as easy as deploying a PHP application in Apache.
Database connectivity is very well catered to by object/relational
mappers such as SQLAlchemy. However, most Python Web frameworks have
yet to catch up to enterprise-grade application servers for Java
or .Net in terms of support for high-availability clustering, failover
and server management.

Python in the Enterprise
Many large organizations have standardized their development on one of
the two main "enterprise" platforms, Java or .Net, believing that
doing so will improve interoperability and lower maintenance costs.
Although Python does not quite operate with the same ubiquity or
scale, it is a very useful complement, and Python is a solid
alternative when such platforms are inappropriate.

The traditional enterprise platforms are by necessity large and
complex. They depend on elaborate tools to manage code, builds and
deployments. For many purposes, this is overkill. Any programmer
should be able to reach for her favorite language when inspiration
hits her, and Python's immediacy makes it well suited for simple
automation tasks and quick prototyping. Developers usually also feel
that Python gives them the headroom to move beyond a prototype without
throwing away their previous work.

Indeed, Python can be used for large and complex software systems.
YouTube, for instance, runs mainly on Python, and it is an oft-
preferred language at organizations including Google, NASA and
Industrial Light and Magic. Specialized Python libraries and
frameworks exist for scientific programming, data manipulation, Web
services, XML interchange and many other things.

The main disadvantage of using Python in an enterprise setting is that
Python programmers can be harder to find than, say, Java developers.
Python is easy to pick up for an experienced programmer, but the
plethora of books, training courses and certifications in the Java
world cannot be matched by Python.

Furthermore, the power and expressivity that Python offers means that
it may require more skilled developers. Java or C# are more
restrictive by design, forcing programmers to adhere to stricter rules
around type safety and interface compliance. For some, that hinders
productivity. For others, it reduces mistakes or accidents of design.

Finally, application integration concerns may dictate a certain
language or platform. However, in today's service-oriented,
heterogeneous systems landscape, it is entirely possible to--for example
--write a Web service in Python that plugs into a Java service bus and
is ultimately consumed by a Visual Basic program.

The Flying Circus
Python has a long history, but a program written for Python 1.0 still
runs under the latest version, Python 2.5. New features and
improvements continue to be added, following a structured proposal and
review process.

In 2006, van Rossum began an effort he coyly dubbed "Python 3000."
This aimed to look at how the language could be improved if absolute
backwards compatibility was dropped. This effort is now coming to
fruition, producing the first alpha releases of Python 3.0.

Naturally, the premise of a backwards-incompatible version of the
language has caused some concern. It remains to be seen how larger
Python projects manage a transition to Python 3.0, and how the rate of
adoption of Python 3.0 impacts the pool of third-party libraries and
frameworks.

However, Python core developers are committed to supporting existing
language users. A 2.6 version of Python is due imminently, and the 2.x
line is likely to continue with a 2.7 and maybe a 2.8. Conversion
tools are also being made available that can analyze a Python 2.x code
base and transform it for 3.0 compatibility, often without manual
intervention. In the author's opinion, the Python community is large
and vibrant enough to withstand some pressure, when in the long run
the changes are likely to benefit everyone.

When to Consider Python
In this article, we discussed Python's strengths and weaknesses -
particularly for enterprise environments. Briefly, you should consider
Python when you (or your programmers):

Need a general-purpose, proven and reliable scripting language that
comes with a rich standard library

Want a language that is useful across a range of programming tasks,
from shell automation to Web applications

Like Python's philosophy and syntax

Find the language fun and productive.

Python may not be an appropriate choice if you:

Are building embedded or massively parallel systems for which a
scripting language would be an inappropriate choice (due to concerns
about execution speed)

Build primarily desktop applications, especially for Windows.
Platforms like .Net usually offer more sophisticated tools and easier
distribution of the final software.

Rely on teams of less-experienced programmers. These developers may
benefit from the wider availability of training for languages like
Java and are less likely to make mistakes with a compile-time, type-
checked language.

Have specialized needs better served by other languages that you
already know. For example, if you want to do a lot of text processing
and you have a basement full of Perl programmers, there's no
compelling reason to switch.

Martin Aspeli is a business consultant, software engineer, songwriter
and émigré in London. He contributes vocally and prolifically to the
Plone open-source CMS, and has written a book called Professional
Plone Development (Packt, 2007). He sometimes blogs at <a href="http://martinaspeli.net" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://martinaspeli.net.


(c) 2007 CXO Media Inc.


On 2月25日, 下午10时52分, Joey <[hidden email]> wrote:
> 连不上,能不能贴过来。
>

> 2008/2/25 Qutr <[hidden email]>:

>
> > 一片文章,大家看看!
> ><a href="http://www.cio.com/article/185350/You_Used_Python_to_Write_WHAT_" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://www.cio.com/article/185350/You_Used_Python_to_Write_WHAT_
>
> > --
> > 软件以程序员为本,程序员以技术为本!
>
> --
> -------------------------------------------
> Best Regard,
> Tang, Jiyu (Joey)





--
>: ~

--~--~---------~--~----~------------~-------~--~----~
'''邮件来自Groups "python-cn"--China Py User Group
详情: http://groups-beta.google.com/group/python-cn
发言: [hidden email]
退订: [hidden email]
维基: http://wiki.woodpecker.org.cn/moin/CPUG
珠江事务: http://groups.google.com/group/zpug
东南事务: http://groups.google.com/group/cpug-eastchina
北京事务: http://groups.google.com/group/bpug
中国事务: http://groups.google.com/group/CPUG
同质列表: http://python.cn/mailman/listinfo/python-chinese
'''
-~----------~----~----~----~------~----~------~--~---