Feed Sign in with OpenID OpenID

Simon Willison’s Weblog

Python in PHP

Python in PHP (via HarryF on the SitePoint Forums):

As both a Python and PHP enthusiast, I wanted to bring these two systems together to promote even greater and more interesting development opportunities.

To that end, I’ve written a Python extension for PHP. In short, this extensions allows the Python interpretter to be embedded inside of PHP (think of PHP as the parent language with Python as its child). This allows native Python objects to be instantiated and manipulated from within PHP. There is also initial support for accessing PHP functions and data from within the embedded Python environment.

This is currently only an early proof of concept available as source code but it could turn in to something very cool indeed.

This is Python in PHP by Simon Willison, posted on 15th July 2002.

View blog reactions

Next: Accessible fonts

Previous: Fifty two projects

4 comments

  1. Looks like a good reason for me to really get into Python. Hope this project develops into more than proof of concept - think it will be good for both languages.

    HarryF - 15th July 2002 04:27 - #

  2. Interesting idea, that one, given PHP's ubiquity. I probably ought to wave the flag for my own Castalian, which lets you embed Python directly into HTML (as PHP does) but provides the ASP object model. Enough of blowing my own trumpet, though. :-)

    sil - 15th July 2002 09:37 - #

  3. Interesting idea, that one, given PHP's ubiquity. I probably ought to wave the flag for my own Castalian (at http://www.kryogenix.org/code/castalian/), which lets you embed Python directly into HTML (as PHP does) but provides the ASP object model. Enough of blowing my own trumpet, though. :-)

    sil - 15th July 2002 09:38 - #

  4. I'm glad to see this. I wrote an application in PHP, but now I'd rather code in Python. This way, I can have the best of both worlds.

    Randall Smith - 2nd January 2004 16:45 - #

Comments are closed.

Previously hosted at http://simon.incutio.com/archive/2002/07/15/pythonInPHP

A django site