Python Questions - July 25, 2015

Laura Creighton lac at
Mon Jul 27 11:15:40 CEST 2015

In a message of Sun, 26 Jul 2015 18:58:14 -0500, "E.D.G." writes:

>       This is an indirect URL for a potentially important computer program 
>that I feel needs to be developed.  Unfortunately, although Python could be 
>used to create PC or Mac versions of the program I don't think that those 
>programs would run on Internet server computers.  But I don't yet know 
>enough about Python to be able to tell if that is the case or not.

Sure they will.  That thing about the Affordable Health Care Act
you mentioned -- do you know how this got _fixed_?  People in this
community, notably Alex Gaynor went and turned the lot into a
Django Python app.  He's now working for the US department of
Veteran Affairs, turning more things into Django apps so that
veterans can get their claims processed in weeks (they are aiming
for days) rather than 6-8 months which was the norm before he
got their.  His plan is to speed up the US government with Python
one agency at a time.

There are many techniques you can use to make your Python code fast.
I think we are much better off in that regard than the Perl users are.
If you need better than CPython performance, you might be able to just
use numpy numerical arrays and get the improvement you need.  Or you
might just stop using CPython, and use PyPy, which is a completely
different implementation and which has a JIT that gives
rather good performance, often on the order of pure C code.

Or you can use Cython to make C extensions out of
the part of your python code you would like to run faster.  Or maybe
there already is a C or Fortran library that already does what you
want, you just want to use it in your code.  There are techniques for
just doing this -- and if the library is well known then chances are
somebody else has already made python bindings for it so you can just
use it with CPython.

I wouldn't worry about speed.

If you want to reimplement your webscraping Perl program in Python, I
suggest you start with this library rather than
reinventing things from scratch.  The scrapy community is very happy to
get code with new techniques which they add to the library, and then
we all benefit.


More information about the Python-list mailing list