Sinisterly
PHP to Python - Printable Version

+- Sinisterly (https://sinister.ly)
+-- Forum: Coding (https://sinister.ly/Forum-Coding)
+--- Forum: Python (https://sinister.ly/Forum-Python)
+--- Thread: PHP to Python (/Thread-PHP-to-Python)



PHP to Python - webbiz - 08-01-2013

Are there any PHP to Python convertors that manage version changes across PHP versions?


RE: PHP to Python - The Alchemist - 08-02-2013

I dont think so.
These types of stuff cannot be done by bots.


RE: PHP to Python - lady_godiva - 08-02-2013

It is not actually possible as far as i know


RE: PHP to Python - Deque - 08-04-2013

Of course it can be done with a program. It is just a compiler, but one that converts from one high level language to another high level language instead of translating to machine code.
@webbiz: I am sorry, but I can't help you with your specific request. Did you try to find one using Google?


RE: PHP to Python - Psycho_Coder - 08-04-2013

(08-04-2013, 08:56 AM)Deque Wrote: Of course it can be done with a program. It is just a compiler, but one that converts from one high level language to another high level language instead of translating to machine code.
@webbiz: I am sorry, but I can't help you with your specific request. Did you try to find one using Google?

I found these

https://gist.github.com/reusee/1035975

http://sourceforge.net/projects/php2py/


RE: PHP to Python - lady_godiva - 08-04-2013

What Deque wrote is correct but i would highly suggest to avoid such programs as the result is a mess.


RE: PHP to Python - Anima Templi - 08-04-2013

Why use such tools? It makes you stand out as a skid! Learn PHP instead and program the tools you need instead of trying to convert them. There's a reason why don't only have one programming language. The language is the tool, we don't hammer nails with screwdrivers, do we?


RE: PHP to Python - zomgwtfbbq - 08-04-2013

(08-04-2013, 01:44 PM)Anima Templi Wrote: we don't hammer nails with screwdrivers, do we?
Unless we have no other option, sometimes it's just about getting things done whether elegant or not.

In some cases this might be efficient, time is money and if you can do something quickly w/o learning a new language then I don't see a reason why not. But as lady_godiva already stated the output can be extremely messy with language to language converters.


RE: PHP to Python - Anima Templi - 08-04-2013

Any company will under all circumstances choose a re-coded version in PHP than trying to convert a Python program. You see, in the long end it will earn them more money. Converted source code tends to be messy and buggy and they would have to use a lot of time on solving those bugs.

Pull yourself together and show the mindset every true programmer/hacker should have and show some interest in learning. Show that you actually care about what you do instead of only thinking about fictional money and budgets. This is the time for everyone to study as much as they can before they have to think more about the finances. I know that the average member here isn't living by him/herself nor use what they do here as a job. You do this for personal interests not a boss that you have to deliver a product for.

I can't see any positive thing about converting source code from one language to another. Learn to program in the other programming language and code it from scratch. This will both insure a better product/program but also develop your skills which you might need in the future.


RE: PHP to Python - lady_godiva - 08-06-2013

A company should never choose to convert code, it can lead to misfunction, new security flaws and more. That's also a bad programming practice. I wouldn't recommend this even if it was for personal use, for a low importance task.