Any tool to translate PHP to Python?

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

    Any tool to translate PHP to Python?

    Hi,

    I have some PHP scripts I'm moving from my web server to the local PC.
    They just do file manipulation.

    Anybody know of a tool for translating PHP to Python? A partial
    translation would be hwlpful.

    Also, any tips or pritfalls to look out for?

    I'm mostly a Python / C / C++ programmer and do not have much experience
    with PHP.

    Thanks,

    Bruce

  • Bruno Desthuilliers

    #2
    Re: [joke] Any tool to translate PHP to Python?

    Bruce Dickey wrote:[color=blue]
    > Hi,
    >
    > I have some PHP scripts I'm moving from my web server to the local PC.
    > They just do file manipulation.
    >
    > Anybody know of a tool for translating PHP to Python?[/color]

    Er... What about a programmer ?-)

    (sorry, could not resist)
    Bruno

    Comment

    • Bruce Dickey

      #3
      Re: [joke] Any tool to translate PHP to Python?

      Bruno Desthuilliers wrote:[color=blue]
      > Bruce Dickey wrote:
      >[color=green]
      >> Hi,
      >>
      >> I have some PHP scripts I'm moving from my web server to the local PC.
      >> They just do file manipulation.
      >>
      >> Anybody know of a tool for translating PHP to Python?[/color]
      >
      >
      > Er... What about a programmer ?-)
      >
      > (sorry, could not resist)
      > Bruno
      >[/color]

      Heh heh. Point taken. I actually *was* assuming I would be the tool --
      I've been around Python long enough to have seen most of the resources
      for desktop apps.

      But Python web scripting I have not gotten into or read much about. It
      appears to me that Python is increasing in popularity, not only on the
      desktop, but also on the web server.

      It seems to me that for folks migrating from PHP to Python, a translator
      would be a handy tool. Especially if they have a large site to convert.
      It would be a tool useful to a large number of people.

      Bruce

      Comment

      • John J. Lee

        #4
        Re: [joke] Any tool to translate PHP to Python?

        Bruce Dickey <ceiesa@excite. com> writes:
        [...][color=blue]
        > It seems to me that for folks migrating from PHP to Python, a
        > translator would be a handy tool. Especially if they have a large site
        > to convert. It would be a tool useful to a large number of people.[/color]

        We look forward to the first release, Bruce. <0.5 wink>


        John

        Comment

        • Will Stuyvesant

          #5
          Re: [joke] Any tool to translate PHP to Python?

          > [Bruce Dickey][color=blue][color=green]
          > > [Bruno Desthuilliers]
          > > Bruce Dickey wrote:
          > >[color=darkred]
          > >> Hi,
          > >>
          > >> I have some PHP scripts I'm moving from my web server to the local PC.
          > >> They just do file manipulation.
          > >>
          > >> Anybody know of a tool for translating PHP to Python?[/color]
          > >
          > >
          > > Er... What about a programmer ?-)
          > >
          > > (sorry, could not resist)
          > > Bruno
          > >[/color]
          >
          > Heh heh. Point taken. I actually *was* assuming I would be the tool --
          > ...
          > It seems to me that for folks migrating from PHP to Python, a translator
          > would be a handy tool.[/color]

          Um, was the point was really taken? Translating programming languages
          is *very* hard. Otherwise, it would be possible to just translate
          Python to C, with all the obvious benefits.

          Perhaps automatic translation of some standard PHP patterns is
          possible? No, still too hard. Think about it.

          --
          The subspace _W inherits the other 8 properties of _V. And there
          aren't even any property taxes.
          -- J. MacKay, Mathematics 134b

          Comment

          • Bruno Desthuilliers

            #6
            Re: [joke] Any tool to translate PHP to Python?

            Bruce Dickey wrote:[color=blue]
            > Bruno Desthuilliers wrote:
            >[color=green]
            >> Bruce Dickey wrote:
            >>[color=darkred]
            >>> Hi,
            >>>
            >>> I have some PHP scripts I'm moving from my web server to the local
            >>> PC. They just do file manipulation.
            >>>
            >>> Anybody know of a tool for translating PHP to Python?[/color]
            >>
            >>
            >>
            >> Er... What about a programmer ?-)
            >>
            >> (sorry, could not resist)
            >> Bruno
            >>[/color]
            >
            > Heh heh. Point taken. I actually *was* assuming I would be the tool --
            > I've been around Python long enough to have seen most of the resources
            > for desktop apps.
            >
            > But Python web scripting I have not gotten into or read much about. It
            > appears to me that Python is increasing in popularity, not only on the
            > desktop, but also on the web server.
            >
            > It seems to me that for folks migrating from PHP to Python, a translator
            > would be a handy tool. Especially if they have a large site to convert.[/color]

            May be, but to which of the numerous Python-based dynamic web page
            generation / web framework / web application server would you convert
            your php source ?

            Bruno

            Comment

            • Bruce Dickey

              #7
              Re: [joke] Any tool to translate PHP to Python?


              "Bruno Desthuilliers" <bdesth.nospam@ removeme.free.f r> wrote in message
              news:3f775d15$0 $20178$626a54ce @news.free.fr.. .[color=blue]
              > Bruce Dickey wrote:[color=green]
              > > Bruno Desthuilliers wrote:
              > >[color=darkred]
              > >> Bruce Dickey wrote:
              > >>
              > >>> Hi,
              > >>>
              > >>> I have some PHP scripts I'm moving from my web server to the local
              > >>> PC. They just do file manipulation.
              > >>>
              > >>> Anybody know of a tool for translating PHP to Python?
              > >>
              > >>
              > >>
              > >> Er... What about a programmer ?-)
              > >>
              > >> (sorry, could not resist)
              > >> Bruno
              > >>[/color]
              > >
              > > Heh heh. Point taken. I actually *was* assuming I would be the tool --
              > > I've been around Python long enough to have seen most of the resources
              > > for desktop apps.
              > >
              > > But Python web scripting I have not gotten into or read much about. It
              > > appears to me that Python is increasing in popularity, not only on the
              > > desktop, but also on the web server.
              > >
              > > It seems to me that for folks migrating from PHP to Python, a translator
              > > would be a handy tool. Especially if they have a large site to convert.[/color]
              >
              > May be, but to which of the numerous Python-based dynamic web page
              > generation / web framework / web application server would you convert
              > your php source ?
              >
              > Bruno
              >[/color]

              I don't know... maybe never will. In my case, I only have a few small
              scripts and will translate by hand.

              Bruce


              Comment

              • Bruce Dickey

                #8
                Re: [joke] Any tool to translate PHP to Python?


                "Will Stuyvesant" <hwlgw@hotmail. com> wrote in message
                news:cb035744.0 309281309.267f4 d5c@posting.goo gle.com...[color=blue][color=green]
                > > [Bruce Dickey][color=darkred]
                > > > [Bruno Desthuilliers]
                > > > Bruce Dickey wrote:
                > > >
                > > >> Hi,
                > > >>
                > > >> I have some PHP scripts I'm moving from my web server to the local[/color][/color][/color]
                PC.[color=blue][color=green][color=darkred]
                > > >> They just do file manipulation.
                > > >>
                > > >> Anybody know of a tool for translating PHP to Python?
                > > >
                > > >
                > > > Er... What about a programmer ?-)
                > > >
                > > > (sorry, could not resist)
                > > > Bruno
                > > >[/color]
                > >
                > > Heh heh. Point taken. I actually *was* assuming I would be the tool --
                > > ...
                > > It seems to me that for folks migrating from PHP to Python, a translator
                > > would be a handy tool.[/color]
                >
                > Um, was the point was really taken? Translating programming languages
                > is *very* hard. Otherwise, it would be possible to just translate
                > Python to C, with all the obvious benefits.
                >
                > Perhaps automatic translation of some standard PHP patterns is
                > possible? No, still too hard. Think about it.
                >
                > --
                > The subspace _W inherits the other 8 properties of _V. And there
                > aren't even any property taxes.
                > -- J. MacKay, Mathematics 134b[/color]

                Yes, it was really taken. I know its hard, but not impossible. Source
                translators exist for a number of languages, such as Basic to Pascal, Pascal
                to C, C to Pascal, VB to Python, Java to C++....
                Some are only partial, but that provides a good start.

                That people have created compilers for that pathological language C++ shows
                what can be done with determination. PHP is a (much) simpler language.

                I have no plans to write a PHP to Python translator, however. I have only a
                few small scripts to convert.

                Bruce



                Comment

                Working...