Changes between Initial Version and Version 1 of PythonGuidelines

Mar 2, 2010 1:01:39 AM (12 years ago)
Chris Jerdonek

Created Python page.


  • PythonGuidelines

    v1 v1  
     1= WebKit Python Guidelines and Tips =
     3Here is an overview of WebKit's use of Python.
     5 * Most of the Python code is in [ WebKitTools/Scripts/webkitpy].
     6 * [ WebKitTools/Scripts] also contains some Python code in the form of end-user scripts.  Generally, we try to keep as much of the code in webkitpy as possible since this allows the code to be organized more nicely, for unit tests to be in companion files, etc.
     7 * Unit test files are in correspondence with modules.  A unit test module has the name, if is the name of the module.
     8 * Informally, we try to follow [ PEP8].
     9 * We put all third-party Python code in [ webkitpy/thirdparty].
     10 * [ Scripts/test-webkitpy] unit tests the Python code.
     11 * WebKit uses Python 2.4.
     13== Mac OS X Snow Leopard ==
     15Python 2.4 is not officially installed or supported on Snow Leopard (Mac OS X 10.6).  Because of this, you may need to install Python 2.4 yourself.  After installing [ MacPorts], you should be able to install Python 2.4 and python_select as follows (roughly).  python_select allows you to quickly go back and forth between Python versions:
     17 * Type `sudo port install python24`
     18 * Type `sudo port install python_select`
     19 * Then you should be able to type select Python 2.4 using, for example,`sudo python_select python24`.
     20 * Use `python_select -l` to find out what versions are available on your machine.