mozilla

Revision 62288 of Python

  • Revision slug: Python
  • Revision title: Python
  • Revision id: 62288
  • Created:
  • Creator: Sayrer
  • Is current revision? No
  • Comment

Revision Content

Python is an interpreted scripting language available on a wide variety of platforms, including Linux, Mac OS X, and Microsoft Windows.

Learning Python

Dive Into Python is the best introduction available. It provides good coverage on all the language basics, and common tasks such as web requests and file operations. For more advanced topics, Text Processing In Python is an excellent reference and tutorial.

Python in Mozilla

Mozilla is (largely) built on top of XPCOM. Similarly, the Python XPCOM package is the low-level glue that ties Python and Mozilla together.

Python is also bound to the DOM (starting with Mozilla 1.9). Mozilla chrome (e.g., XUL or trusted HTML) can use Python. The PyDOM page has more information. More information is available on the Python XPCOM page.

Python Web Software

Pylons is one recommended Web framework (there are many). The Socorro Breakpad server uses it. Pylons is based on WSGI, a common Python web interface, so many libraries work with it.

Pylons provides a very productive development environment, similar to Ruby On Rails, by providing its own HTTP server. This means all development dependencies can be downloaded with a few commands, pages are automatically reloaded after editing Python files or templates, and there's even an AJAX debugger on the 500 screens. When an error occurs, you see a traceback like this:

Image:Pylons.gif

By expanding one of the '+' symbols, a text box appears that functions as a Python console.

Image:Pylons-debugger1.gif

This feature allows you to inspect each frame of the Python backtrace, and even modify your application's state.

Image:Pylons-debugger2.gif

Useful Web Libraries

AuthKit is a plugin useful for authentication.

SQLAlchemy is an excellent SQL/ORM library.

Genshi is a powerful templating language that provides an XML-based template syntax as well as one geared toward plain text. It can generate HTML4 from XML, resulting in maximum compatibility for clients, while maintaining a tight XML pipeline on the server.

Revision Source

<p><a class="external" href="http://www.python.org">Python</a> is an interpreted scripting language available on a wide variety of platforms, including Linux, Mac OS X, and Microsoft Windows.
</p>
<h2 name="Learning_Python"> Learning Python </h2>
<p><a class="external" href="http://www.diveintopython.org/toc/index.html">Dive Into Python</a> is the best introduction available. It provides good coverage on all the language basics, and common tasks such as web requests and file operations. For more advanced topics, <a class="external" href="http://gnosis.cx/TPiP/">Text Processing In Python</a> is an excellent reference and tutorial.
</p>
<h2 name="Python_in_Mozilla"> Python in Mozilla </h2>
<p>Mozilla is (largely) built on top of <a href="en/XPCOM">XPCOM</a>. Similarly, the <a href="en/PyXPCOM">Python XPCOM package</a> is the low-level glue that ties <a class="external" href="http://www.python.org">Python</a> and Mozilla together.
</p><p>Python is also bound to the DOM (starting with Mozilla 1.9). Mozilla chrome (e.g., <a href="en/XUL">XUL</a> or trusted HTML) can use Python. The <a href="en/PyDOM">PyDOM</a> page has more information. More information is available on the <a href="en/PyXPCOM">Python XPCOM</a> page.
</p>
<h2 name="Python_Web_Software"> Python Web Software </h2>
<p><a class="external" href="http://www.pylonshq.com">Pylons</a> is one recommended Web framework (there are many). The <a class="external" href="http://code.google.com/p/socorro/">Socorro</a> Breakpad server uses it. Pylons is based on WSGI, a common Python web interface, so many libraries work with it.
</p><p>Pylons provides a very productive development environment, similar to Ruby On Rails, by providing its own HTTP server. This means all development dependencies can be downloaded with a few commands, pages are automatically reloaded after editing Python files or templates, and there's even an AJAX debugger on the 500 screens. When an error occurs, you see a traceback like this:
</p><p><img alt="Image:Pylons.gif" src="File:en/Media_Gallery/Pylons.gif">
</p><p>By expanding one of the '+' symbols, a text box appears that functions as a Python console.
</p><p><img alt="Image:Pylons-debugger1.gif" src="File:en/Media_Gallery/Pylons-debugger1.gif">
</p><p>This feature allows you to inspect each frame of the Python backtrace, and even modify your application's state.
</p><p><img alt="Image:Pylons-debugger2.gif" src="File:en/Media_Gallery/Pylons-debugger2.gif">
</p>
<h3 name="Useful_Web_Libraries"> Useful Web Libraries </h3>
<p><a class="external" href="http://authkit.org/">AuthKit</a> is a plugin useful for authentication.
</p><p><a class="external" href="http://sqlalchemy.org">SQLAlchemy</a> is an excellent SQL/ORM library.
</p><p><a class="external" href="http://genshi.edgewall.org">Genshi</a> is a powerful templating language that provides an XML-based template syntax as well as one geared toward plain text. It can generate HTML4 from XML, resulting in maximum compatibility for clients, while maintaining a tight XML pipeline on the server.
</p>
Revert to this revision