PHP5 programmer learning Python

R

romiro

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.
 
D

darren kirby

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
 
G

Gabriel Genellina

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.
 
7

7stud

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.
 
C

Cameron Laird

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.
.
.
.
Along with accurate advice others have already given you here ("Dive into
Python" would be my preferred starting point), it occurs to me you might
want <URL: http://www.unixreview.com/documents/s=7822/ur0303j/ > at your
side. Also, back in the PHP world, <URL:
http://www.unixreview.com/documents/s=10102/ur0611c/ > might interest
you, if you're not already familiar with it.
 
?

=?iso-8859-1?q?Luis_M=2E_Gonz=E1lez?=

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top