Python

Only available on StudyMode
  • Download(s) : 178
  • Published : May 1, 2013
Open Document
Text Preview
yhPython
Introduction Python is an interpreted, object-oriented, high level scripting and programming language. Python was first introduced in 1991 by Guido van Rossum, a Dutch computer programmer who wanted to develop a language that could be used by anyone. The main goal of Python was to reduce the learning curve by choosing a syntax that is understandable as plain English. Python has a very simple programming philosophy, "there should be one and preferably only one obvious way to do it". This is a characteristic that sets Python apart from its competitors such as Perl. Python rejects exuberant syntax and favors sparse, less cluttered syntax. Perl on the other hand sees programming as, "there is more than one way to do it". This is evident in Perl's regular expressions. The numerous backslashes, quotations and variable notations can give a novice programmer a headache. Perl is still considered a powerful language; however, the syntax can be cryptic and hard to read. Python is a multi-paradigm programming language, which allows users to code in several different programming styles. A programmer can code in a functional, objectoriented or imperative format. Python supports cross platform development and is available through open source and the latest stable release is version 2.5.1. Uses for Python Python is an excellent answer to all those who cried out for a more modern version of Perl. After being introduced to Perl, the advantages become quite obvious; that being it is easy to code a small program in a short amount of time. After working with a Perl application for sometime though, like any other language, it starts to look cryptic and sloppy. Even worse, just like any command line tool a user needs to first understand which arguments need to be set for the program to run, and then know how to present them syntactically. A first view of a Python program shows a language that is not only readable, but read like English. It is easy to see quite quickly that advanced users would not only be able to pick it up quickly, but even those with little to no programming experience could as well. The second great feature of Python besides readability is the integration. Inevitably with any scripting language, complex operations might have to be made. Python's answer to this is its ease as an integration tool. The use of Python with SWIG is already of frequent use in the gaming industry. Starting from the second version of Sid Meier's Civilization series, Python has been used for scripting in game menu's effectively. In addition, the building of levels is often used by gaming companies since it is far cleaner to hard code level design as a series of scripts separate from program code. This has also allowed for avid users of these games to write their own Python code to create level

designs of their own. The most recent installment of Civilization has API for creating new scripts online. This creates further replay value for their customers. Another great use of the integration functionality is it allows companies who have grown tired of dealing with legacy code to be able to choose new programming languages without having to throw away old, still functioning code. With easy to read scripts, it allows for new programmers, coming on board, to not have to read through thousands of lines of code to get up to speed. This means the learning curve for legacy systems is less steep, and there is less reliance on having to pore over documents to understand code. This works great for updating user interface's for new versions of products without touching back-end code. The two main flavors of integration for Python is the C/C++ version dubbed CPython, and the pure integration language JPython or renamed Jython more recently. CPython does not actually act as a pure integration language. CPython must by integrated using a tool such as SWIG. Python allows ease of use of complicated C/C++ functions that are still useful. Well documented...
tracking img