472,325 Members | 1,500 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,325 software developers and data experts.

PHP5 programmer learning Python

Hi all,

I'm a PHP5 developer looking to "broaden my horizons" so to speak by
learning a new language. I emphasize the 5 in PHP since I have fully
engrossed myself in the full OOP of version 5 with my own ground-up
projects as well as some work with PRADO (http://pradosoft.com)

I've dabbled with a number of languages in the past, Python being no
exception, but always ended up coming back to PHP due to being
comfortable with it. Python has stuck to me as a language I _really_
think I should know more about. I've recently tried C#, a very short
lived re-attempt at C++ and Java, and Ruby. None of those seemed
"fun" except for Ruby, although from what I've seen the syntax between
Ruby and Python are very similar to each other compared to the other
languages.

Anyway, my first question was if anyone knows of a tutorial that
focuses on PHP -Python learning, in such that there might be a block
of PHP code alongside an example of how to do the same thing in
Python. One example of something I've already mapped a comparison to
thanks to standard tutorials is a PHP numeric indexed array being
similar to a list and a PHP associative array being similar to a
dictionary. Of course finding such of a tutorial isn't a deal breaker
by any means, but I figured that having it available would be a boon
for me to actually make some headway in my Python learning adventure.

If there's anything else that could be said about the migration
between the two languages, I'm all ears. I also don't really need to
hear about how "disgusting" php is as a language...I am aware of the
contained chaos that is PHP4, which is why I develop strictly in 5
using its OOP to the extent my feeble brain allows, a wariness toward
the insecure pitfalls the language has begat in the past, and an
attempt to produce as clean of a syntax as the language can allow.

Thanks in advance for any help.

May 27 '07 #1
5 1684
quoth the romiro:
Hi all,
....
Anyway, my first question was if anyone knows of a tutorial that
focuses on PHP -Python learning, in such that there might be a block
of PHP code alongside an example of how to do the same thing in
Python. One example of something I've already mapped a comparison to
thanks to standard tutorials is a PHP numeric indexed array being
similar to a list and a PHP associative array being similar to a
dictionary. Of course finding such of a tutorial isn't a deal breaker
by any means, but I figured that having it available would be a boon
for me to actually make some headway in my Python learning adventure.
Not a tutorial, and the code is not alongside each other, but the PLEAC [1]
website may serve as a decent code comparison between PHP and Python.
As for a tutorial, if you are already experienced you will probably want to
check out "Dive into Python. [2]

Have fun,
-d

[1] http://pleac.sourceforge.net/
[2] http://diveintopython.org/toc/index.html

--
darren kirby :: Part of the problem since 1976 :: http://badcomputer.org
"...the number of UNIX installations has grown to 10, with more expected..."
- Dennis Ritchie and Ken Thompson, June 1972
May 27 '07 #2
En Sun, 27 May 2007 12:41:36 -0300, romiro <rr*******@gmail.comescribió:
Anyway, my first question was if anyone knows of a tutorial that
focuses on PHP -Python learning, in such that there might be a block
of PHP code alongside an example of how to do the same thing in
I don't know of a specific PHP->Python tutorial, but "Instant Python"
would give you a brief tour, and "Dive into Python" is a good book for
people with some previous programming background. Both should be easy to
find using Google.

--
Gabriel Genellina

May 27 '07 #3
On May 27, 9:41 am, romiro <rroger...@gmail.comwrote:
Hi all,

I'm a PHP5 developer looking to "broaden my horizons" so to speak by
learning a new language. I emphasize the 5 in PHP since I have fully
engrossed myself in the full OOP of version 5 with my own ground-up
projects as well as some work with PRADO (http://pradosoft.com)

I've dabbled with a number of languages in the past, Python being no
exception, but always ended up coming back to PHP due to being
comfortable with it. Python has stuck to me as a language I _really_
think I should know more about. I've recently tried C#, a very short
lived re-attempt at C++ and Java, and Ruby. None of those seemed
"fun" except for Ruby, although from what I've seen the syntax between
Ruby and Python are very similar to each other compared to the other
languages.

Anyway, my first question was if anyone knows of a tutorial that
focuses on PHP -Python learning, in such that there might be a block
of PHP code alongside an example of how to do the same thing in
Python. One example of something I've already mapped a comparison to
thanks to standard tutorials is a PHP numeric indexed array being
similar to a list and a PHP associative array being similar to a
dictionary. Of course finding such of a tutorial isn't a deal breaker
by any means, but I figured that having it available would be a boon
for me to actually make some headway in my Python learning adventure.

If there's anything else that could be said about the migration
between the two languages, I'm all ears. I also don't really need to
hear about how "disgusting" php is as a language...I am aware of the
contained chaos that is PHP4, which is why I develop strictly in 5
using its OOP to the extent my feeble brain allows, a wariness toward
the insecure pitfalls the language has begat in the past, and an
attempt to produce as clean of a syntax as the language can allow.

Thanks in advance for any help.
Read "Learning Python(2nd ed)" and do all the exercises. If you have
questions, post them.

May 27 '07 #4
In article <ma***************************************@python. org>,
Gabriel Genellina <ga*******@yahoo.com.arwrote:
>En Sun, 27 May 2007 12:41:36 -0300, romiro <rr*******@gmail.comescribió:
>Anyway, my first question was if anyone knows of a tutorial that
focuses on PHP -Python learning, in such that there might be a block
of PHP code alongside an example of how to do the same thing in

I don't know of a specific PHP->Python tutorial, but "Instant Python"
would give you a brief tour, and "Dive into Python" is a good book for
people with some previous programming background. Both should be easy to
find using Google.
May 27 '07 #5
On May 27, 12:41 pm, romiro <rroger...@gmail.comwrote:
Hi all,

I'm a PHP5 developer looking to "broaden my horizons" so to speak by
learning a new language. I emphasize the 5 in PHP since I have fully
engrossed myself in the full OOP of version 5 with my own ground-up
projects as well as some work with PRADO (http://pradosoft.com)

I've dabbled with a number of languages in the past, Python being no
exception, but always ended up coming back to PHP due to being
comfortable with it. Python has stuck to me as a language I _really_
think I should know more about. I've recently tried C#, a very short
lived re-attempt at C++ and Java, and Ruby. None of those seemed
"fun" except for Ruby, although from what I've seen the syntax between
Ruby and Python are very similar to each other compared to the other
languages.

Anyway, my first question was if anyone knows of a tutorial that
focuses on PHP -Python learning, in such that there might be a block
of PHP code alongside an example of how to do the same thing in
Python. One example of something I've already mapped a comparison to
thanks to standard tutorials is a PHP numeric indexed array being
similar to a list and a PHP associative array being similar to a
dictionary. Of course finding such of a tutorial isn't a deal breaker
by any means, but I figured that having it available would be a boon
for me to actually make some headway in my Python learning adventure.

If there's anything else that could be said about the migration
between the two languages, I'm all ears. I also don't really need to
hear about how "disgusting" php is as a language...I am aware of the
contained chaos that is PHP4, which is why I develop strictly in 5
using its OOP to the extent my feeble brain allows, a wariness toward
the insecure pitfalls the language has begat in the past, and an
attempt to produce as clean of a syntax as the language can allow.

Thanks in advance for any help.

I don't know of anything like a PHP to Python migration guide.
But I think that you should just forget about PHP for awhile an
inmerse yourself into learning Python, which is a general purpose
programming language suitable for many tasks, and not only for the
web.

Start with the official tutorial or, if you want something more
advanced, read "Dive into Python".
Once you get a rough idea of all the cool things you can do with
Python, you can concentrate again in web development.

You'll be able to write more complex web sites with less code and a
cleaner syntax, although you will have to spend some time deciding how
to use Python in a web development context.

There are many frameworks to choose from, and trying them all can be a
daunting task...
The choices range from the so called "full stack frameworks" (such as
Django or TurboGears) that give you everything you need to build
complex web sites and even more (templates, dispatching mechanisms,
object-relational mappers, etc, etc) to minimalist solutions such as
webpy.
But this is something to evaluate after you have a good grasp of the
language itself.

Be warned: Python is highly addictive and it can make you a hopeless
junkie...

Good luck!
Luis

May 28 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Michael L. Labbe | last post by:
Hello. I'm an experienced programmer who is evaluating learning Python if it is applicable to a few projects. The programs I am going to list are...
15
by: Randall Smith | last post by:
I've been programming in Python for about 2 years. I think it offers the best combination of simplicity and power of any language I have explored....
10
by: PMD96 | last post by:
I'm new to programming and have been recommended to start with Python. I've reviewed the tutorial and am looking for additional learning tools to...
8
by: Ray | last post by:
Hello there, I've been programming in Java for about 8 years now, but lately I've been hearing a lot about Python and I'm really interested in...
22
by: Matthias Braun | last post by:
Help! I am using SuSE 9.3, php5 and Apache2 on Linux. I try to write files to the hard drive using the following command: $filename =...
14
by: Kevin Walzer | last post by:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I'm a Tcl/Tk developer who has been dabbling with Python for some time, but had not seen a...
65
by: Chris Carlen | last post by:
Hi: From what I've read of OOP, I don't get it. I have also found some articles profoundly critical of OOP. I tend to relate to these articles....
5
by: Nirav Thaker | last post by:
Yo Group, I'm excited to learn Python as new language coming year, I consider myself good Java developer and, not so unusually, with very limited...
14
by: Jeff | last post by:
I'm working on a server that is running PHP4. I'd like to upgrade this so I can use the PHP5 code I have already. What kind, if any, problems...
0
by: tammygombez | last post by:
Hey fellow JavaFX developers, I'm currently working on a project that involves using a ComboBox in JavaFX, and I've run into a bit of an issue....
0
by: tammygombez | last post by:
Hey everyone! I've been researching gaming laptops lately, and I must say, they can get pretty expensive. However, I've come across some great...
0
by: concettolabs | last post by:
In today's business world, businesses are increasingly turning to PowerApps to develop custom business applications. PowerApps is a powerful tool...
0
by: teenabhardwaj | last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
0
by: CD Tom | last post by:
This happens in runtime 2013 and 2016. When a report is run and then closed a toolbar shows up and the only way to get it to go away is to right...
0
by: CD Tom | last post by:
This only shows up in access runtime. When a user select a report from my report menu when they close the report they get a menu I've called Add-ins...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.