473,561 Members | 3,259 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1761
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*******@gmai l.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...@gmai l.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************ *************** ************@py thon.org>,
Gabriel Genellina <ga*******@yaho o.com.arwrote:
>En Sun, 27 May 2007 12:41:36 -0300, romiro <rr*******@gmai l.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...@gmai l.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
1812
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 production software - they are not throwaway toy projects, but will actually have real world application. I've spent years writing C++ and Perl code, but I would like to try "this Python language"...
15
10516
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. As I write more and larger and complex programs, I need to code better. By better I mean clearer, cleaner, more efficient and maintainable. As the subject states, I want to become a really good...
10
1413
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 learn programming and Python. Any recommendations?
8
1517
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 learning more about it. I've read the tutorial, and some books (core python programming is one), but there's one thing that's still missing: how to use Python the "Python" way. I found learning C#...
22
2454
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 = "test.txt"; if (!file_exists($filename)) touch($filename); if (is_writable($filename)) $myfile = fopen( $filename,'w+');
14
1644
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 compelling reason to really learn the language. Programming in Tkinter seemed redundant to me since I already have direct access to that toolkit via Tcl, and the other Python GUI toolkits I tried--PyQt...
65
5226
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. However, those articles were no more objective than the descriptions of OOP I've read in making a case. Ie., what objective data/studies/research indicates that a particular problem can be...
5
1503
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 experience with dynamic programming languages such as Python or Ruby. I have started with basics at http://docs.python.org, but I'm more interested in learning philosophies in programming...
14
1704
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 will I have with the existing PHP code base? I see: Local Master
0
7570
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7859
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8088
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7618
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
1
5472
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3617
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2068
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1181
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
896
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.