Perl to Python conversion

r0g aioe.org at technicalbloke.com
Sun Dec 13 16:08:50 EST 2009


Martin Schöön wrote:
> Thanks all, great response!
> 
> A little more background:
> 
> I am not a programmer but I have done some programming in the past.
> This was all humble number crunching as part of my PhD project using
> FORTRAN. I also did some Rocky Mountain Basic coding for programs
> manipulating measurement instruments. And I did a minute amount
> of Turbo Pascal code, too little and too many years ago to count.
> 
> Since then I have done some stuff in Matlab and (very basic) UNIX
> scripts.
> 
> Does HTML, css and LaTeX count?
> 
> So why Python? Well, I thought it would be fun to learn a little
> about GUI programming and a friend who is a real programmer recommended
> Python + PyQt. I have bought some books and lurked here for about
> a year but haven't managed to get going yet. I figured I needed
> some kind of project for that and now I have two.
> 
> Learning Python and PyQt is spare time killer/brain teaser activity.
> 
> The thermal contact conductance stuff is something that come in
> handy at work.
> 
> So here is what I plan to do based on your kind advice and some
> thinking of my own.
> 
> 1) I fix the unit thing by adding a conversion to the results
> presentation routine.
> 
> 2) Recreating the functionality of the program in Python and PyQt
> will be a 'long term' educational project at home. There are
> various bits and pieces there: data base handling, GUI design, math,
> logic, error/exception handling...
> 
> We have long, dark winters where I live :-)
> 
> All the best,
> 
> /Martin


I'd recommend you start from scratch and refer to the perl version if
and when you need to. You'll probably find the majority of code in a GUI
app is boring window handling stuff rather, often this is machine
generated (by progs like glade) rather than hand coded anyway so it will
probably provide little insight. Also, they probably didn't make it with
QT which is fairly different from GTK. It's like the housing industry,
demolition + newbuild is almost always cheaper than renovation. If you
can spare yourself the ordeal of learning perl and the chore of
interpreting somebody else's perl then grasp it with both hands!

Good luck. I'm sure you'll be fine - python is a deeply pleasing
language to work in :)

Roger.



More information about the Python-list mailing list