Perl to Python conversion

zeph zephjc at gmail.com
Wed Dec 9 16:05:33 EST 2009


Python and Perl often have different design idioms - learning to write
*well* in a language involves understanding those idioms, and being
able to translate between languages involves understanding the source
language well enough to understand the intent of the program's code
(even if its poorly written), and understanding the target language
well enough to translate the intent into a design fitting the
language.

Perl and Python have enough syntactic similarities that you could, if
you wanted, just translate the program verbatim.

Overall, I would recommend adding your imperial->metric functionality
to the Perl code for now, and on your free time work on translating to
Python, so you don't feel rushed to get it finished.  You will
probably come to understand the Perl code better after having worked
with it and been involved in a hands-on way with it.  Likewise, you
will become even more familiar with it and with Python as you learn
how to translate the application.



More information about the Python-list mailing list