CRM Newsletter
 
NEWSLETTERS
 

CIO.com updates, insights and advice on technology, management and your career.

 CIO BlackBerry News and Tips
 CIO Research and Analysis
 CIO Microsoft
 CIO Insider
 
 
 
LEADERSHIP
 
CIO Executive Programs
The Leader in Face-to-Face Education for Senior Executives

Offering regional and national programs, CIO (and CSO) events bring together some of the most respected names and thought leaders in information technology and security. Presented by CIOs and other senior level executives, these invitation-only programs offer timely topics and strong networking. Learn More »

 
CIO Executive Council
A Peer-Advisory Service and Professional Association for CIOs

Public Council Teleconference: Application Rationalization — Hidden Costs and Smart Decisions

November 17 at 11:00 am US/Eastern (GMT-5)

Join Honorio Padrón, of The Hackett Group, who will share the drivers for companies to tackle application rationalization and the results of research that define the hidden cost of complexity. Additionally, we will discuss key decision milestones—to start or not, holding the course steady and fulfilling expectations.

Virtual Desktop Cost-Benefit Analysis — Michael Jacobs, Catlin Group

The analysis contained in this presentation measures the cost of everything from the machines and licenses to the infrastructure for virtual vs. traditional desktop environments.

Honor your best senior team members - Apply for the CIO Ones to Watch Award

Get well-earned public recognition for your top up-and-coming team members, your IT organization and your enterprise. Award winners will be announced, publicized and feted in May 2010, great timing to help attract new IT recruits to your company.

More / Register »

Learn more about the CIO Executive Council »



 
 
RESOURCE CENTER
 
 
 
 

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, 2008CIO

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.

 
 
Loading...
 
WHITE PAPERS

Vantage Java and .NET Monitoring

Discover key Java/.NET monitoring strategies to ensure IT Operations can maintain the level of performance and availability that your end users demand.
 

Web Filtering: Selecting a Vendor

Read this in-depth evaluation of Web filtering vendors, based on 53 criteria.
 

Top 10 Business Drivers

The restructuring of Wall Street that took place in 2008 will have a major impact on the investment management business in 2009.
 

How is open source changing the face of enterprise software?

Learn how open source and business intelligence ignite enterprises to reach new levels of performance excellence.
 

Red Hat Open Source Security

The rapid innovation and collaboration of open source development helps Red Hat provide industry-leading security tools and processes.
 

Now is the Time for Open Source

In today's economy, we are all trying to do more with less. Another modern business necessity is flexible, mobile data and systems-complex IT.
 

WEBCASTS

Smart techniques for application security: whitebox + blackbox security testing.

Whitebox & blackbox application security testing are two approaches for detecting vulnerabilities in Web-based and ...
 

Lower the Cost and Complexity of a Mobile Workforce through Automation

Lower the Cost and Complexity of a Mobile Workforce
 

Extending Client Refresh - 11 Steps to Maximize Savings

11 Steps to Maximize Savings
 

Consolidate Your Servers and Storage to Lower Costs with Oracle Database 11g

Live Webcast
Tuesday, December 8, 2009
2:00pm ET/ 11:00am PT

Oracle Database 11g and Oracle Real A...
 

The Last Software You'll Ever Buy? The Platform Approach to Development

Torn between "buy" and "build"? There is a third option that can give you the custom fit of an in-house build and t...
 

Profit from Power Savings

Cut Costs & Green Your IT Operations with PC Power Management

Find out how and why 400 organizations have d...
 

Resource Alerts

Get instant email notifications by topic when white papers, webcasts, and case studies are added to our library.

 
FEATURED SPONSORS
 
 
 
SPONSORED LINKS
 

Disciplined Autonomy: Resolving the Tension Between Flexibility and Control

Enterprise Capture: Your Onramp to Business Process Automation

Seven Technologies for Advanced Mail Protection

Server Consolidation: Leveraging the Benefits of Virtualization

AT&T Synaptic Storage as a Service. Expand on demand

Trend Micro ranked #1 against real-world malware. Read more.

Webinar: Jump-start your in-house e-discovery with Ringtail QuickCull from FTI Technology

Top Five CIO Challenges

Read the RSA report: Security for Business Innovation

64-page prescriptive guide to security, compliance, and IT operations.

Increase UPS efficiency without sacrificing protection.

eZine: A Roadmap to Reducing IT Complexity

Reduce risk, gain agility. See how Progress can help your business.

Virtualization Technology as a Business Solution

eZine: A Roadmap to Reducing IT Complexity

World-class trading technology solutions from NYSE Technologies.

If You're Paying for Telecom, You're Paying Too Much. Contact Asentinel Today.

Trade-In your old printer and save up to $1,000 plus free recycling!

infoBOOM! - The Mid-Sized Company CIO's Exclusive Community

Live Webinar: Applying Business Analytics. Click here to learn more

Removing Barriers To Better Server Virtualization Efficiency

4G Revisited. The Continued Evolution of Wireless Mobility.

What's Next for Enterprise Resource Planning?

Maximizing website Return on Information with high-quality search

Gartner Magic Quadrant, Application Delivery Controllers 2009

Tolly Group Lab Test Results: Cisco vs. ShoreTel

SETLabs: The Impact of Performance Engineering

Top to Bottom Performance Management Excellence at the City of Chicago

Return on Information: Google Enterprise Search pays you back. Get the facts.

VMware. The source for Business Infrastructure Virtualization.

ShoreTel tells businesses to untangle from competitors' complexity and turn to its brilliantly simple UC solution

See how AT&T can help protect your network.

Streamline IT Costs. Boost Performance with WAN Optimization.

Build your 1st app FREE with Force.com

TDWI checklist helps define data readiness for analytics. Download report.

A Clear View Toward Virtualization

Virtualization Technology as a Business Solution

The rules of infrastructure management just changed.

A Clear View Toward Virtualization

Interactive Q&A helps you discover key ways to maximize IT assets.

Ready to virtualize tier one applications? Check your virtualization maturity.

Think you can't afford a Cisco Switch? Cisco Catalyst Switches are now more affordable.

Five minute business analytics assessment. Immediate results.

The Case for Investing in Business Analytics Technology. Read white paper.

Upgrading to VMware vSphere with vWire

Top 10 Lessons Learned for Corporate 3G Mobile Broadband Deployments

CRM Built for IT: The Executive Guide to Selecting CRM that Meets IT Needs

Return on Information: Google Enterprise Search pays you back

ROI of Application Delivery Controllers

Making Consumer Two-Factor Authentication Simple and Cost-Effective