15.html ( File view )
- By 2010-08-21
- View(s):12
- Download(s):0
- Point(s): 1
Safari | Python Developer's Handbook -> Main Technical Features
See All Titles |
![]() ![]() Main Technical FeaturesNow that you already know many reasons why you should use Python, let's focus on some of its main technical features. Automatic Memory ManagementPython objects are collected whenever they become unreachable. Python identifies the "garbage," taking the responsibility from you. Exception HandlingThe exception handling support helps you to catch errors without adding a lot of error checking statements to the code. By the way, it is said that Python programs never crash; they always return a traceback message. Rich Core LibraryMany extension modules were already developed and became part of The Standard Python Library of tools, which can be used by programmers in any Python application. Besides those generic modules, we have others that are specific for particular platforms or environments. The Standard Python Library makes the tasks that are simple in theory also simple in practice. In a short time, programmers can make their Python programs speak to HTTP, FTP, SMTP, Telnet, POP, and many other services because Python modules perform all the common daily tasks. You can download a Web page, parse HTML files, show windows on the screen, and even useas part of your programsbuilt-in interfaces that were created to handle many operational system services. Web Scripting Support and Data HandlingPython enables you to write CGI programs that work fine in several environments. Have you ever imagined switching platforms without changing the code? All right, it's possible if Python is the choice. There is even more: You can parse XML, HTML, SGML, and every other kind of text by using Python built-in classes and regular expression methods. Built-In ElementsPython provides a huge list of useful built-in elements (the language's basic data structure) along with many special operations that are required to correctly process them. This list is as follows:
Development FlowEven though it doesn't have any compilation or linking process, Python supports byte compilation. The compiled code is saved in an intermediate language called bytecode that can be accessed by any system that has a Python virtual machine. This feature offers a kind of portability similar to the one that Java also offers. Applications can be used in several different systems without the need for compilation. Furthermore, you can create a standalone executable and securely distribute your applications. Clear Syntax and a Diversity of Useful Lexical ElementsThe way Python is organized seems to encourage object-oriented programming because everything is an object. In addition to that, it has various helpful lexical elements, such as the following:
Embeddable and ExtendablePython can be embedded in applications written in many other programming and scripting languages. Whenever you need to have a programmable interface for your applications, give Python a chance. Python is well known for easily gluing everything. Python also enables you to add low-level modules to the interpreter. Those built-in modules are easily written in C and C++. Extension modules are easily created and maintained using Python. For tasks like this, you can develop components in C and run them through Python subclasses. Objects DistributionPython can be used to implement routines that need to talk to objects in other applications. For example, Python is a great tool to glue Windows COM components. Besides that, Python also has a few CORBA implementations that enable you to use cross-platform distributed objects, as well. DatabasesPython has interfaces to all major commercial databases, provides several facilities to handle flat-file databases, and implements object-persistence systems that can save entire objects to files. But the greatest database feature is that Python defines a standard database API, which makes it easy to port applications to different databases. GUI ApplicationYou can create applications that implement graphical user interfaces (GUIs), which are portable to many system calls, libraries, and windowing systems such as Windows MFC, Macintosh, Motif, and UNIX's X Window System. This is possible because many GUI bindings were developed for Python. The Python distribution is bundled with Tkinter, a standard object-oriented interface to the Tk GUI API that has become the official GUI development platform for Python. IntrospectionYou can develop programs in Python to help in the creation of other programs in Python. The most important examples are the Debugger and the Profiler. And there is even more: Python has an Integrated Development Environment (IDLE) developed using Python for use with Python. Third-Party Projects IntegrationThe Python Extension NumPy (Numerical Extensions to Python) along with the Python Library PIL (Python Imaging Library) prove that everyone who contributes to the language can make his projects almost a required complement to the standard Python distribution.
Sponsored links
Need
1 point
Your Point(s)
Your Point isn't enough. Get point immediately by PayPal More(Debit card / Credit card / PayPal Credit / Online Banking) |