Using PHP in Python

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Tgone

    #1

    Using PHP in Python

    Hello,

    I've come across sites that discuss embedding Python in PHP, but is it
    possible to access PHP functions in Python?

  • Diez B. Roggisch

    #2
    Re: Using PHP in Python

    Tgone wrote:
    [color=blue]
    > Hello,
    >
    > I've come across sites that discuss embedding Python in PHP, but is it
    > possible to access PHP functions in Python?[/color]

    I'm not aware of a generic wrapper thingy. Which doesn't mean there is none.
    But which functions are you interested in? I can't believe there is much
    that PHP can do that python _can't_ do, so maybe we can point you in the
    right direction.

    Diez

    Comment

    • Tgone

      #3
      Re: Using PHP in Python


      Diez B. Roggisch wrote:[color=blue]
      > Tgone wrote:
      >[color=green]
      > > Hello,
      > >
      > > I've come across sites that discuss embedding Python in PHP, but is it
      > > possible to access PHP functions in Python?[/color]
      >
      > I'm not aware of a generic wrapper thingy. Which doesn't mean there is none.
      > But which functions are you interested in? I can't believe there is much
      > that PHP can do that python _can't_ do, so maybe we can point you in the
      > right direction.
      >
      > Diez[/color]

      I have some custom PHP functions that I didn't want to re-write in
      Python. But maybe I should just rewrite them :)

      Comment

      • Diez B. Roggisch

        #4
        Re: Using PHP in Python

        [color=blue]
        > I have some custom PHP functions that I didn't want to re-write in
        > Python. But maybe I should just rewrite them :)[/color]

        Certainly yes. And you'd be amazed how easier it is in python, I believe.

        Diez

        Comment

        • Rene Pijlman

          #5
          Re: Using PHP in Python

          Tgone:[color=blue]
          >I have some custom PHP functions that I didn't want to re-write in
          >Python. But maybe I should just rewrite them :)[/color]

          Absolutely.

          The alternative is one of many IPC mechanisms that are available in both
          Python and PHP (such as XML-RPC). But that may require more effort than
          rewriting the functions.

          --
          René Pijlman

          Comment

          • Michel Claveau

            #6
            Re: Using PHP in Python

            Hi!

            Only in Windows, I can call PHP (more exactly PHP-script) from Python.
            I can, also, call, from Python, PHP-defined-functions, like a method of
            a Python-class.

            It's a combination of Active-scripting & dynamic method add to a class.

            --
            @-salutations

            Michel Claveau


            Comment

            Working...