Migrating from PHP to Python...

Rick Shin rick at slaveware.com
Sun Sep 2 19:12:00 EDT 2001


Hi,

I'm a PHP man looking to migrate to Python for a change of scenery. I've
skimmed over the specs, but missed a few PHP constructs that I find
essential. Can anyone tell me the Python equivalents for:

1. include()/require()  (is the import function meant for all file
includes?)
2. header()  (for redirecting)
3. variable variables  (or dynamic variables)
4. PHPlib's template.inc  (this isn't a construct, but a templating class I
find indispensable)

Finally, as someone who develops web apps exclusively, can anyone give me
any compelling reasons why I should learn Python? From what I've read, PHP
is faster, less resource intensive, and more prevalent (especially with web
hosts). I've had, on the other hand, no formal training but recently read
Code Complete, and wish to transcend the ranks of hackers. Python seems like
an ideal language for instilling good, modular programming practices. Plus,
it sounds cool. I like the idea of telling people "I program Python!".

Thanks for reading this,

Rick





More information about the Python-list mailing list