Basic Python Questions - Oct. 31, 2013

Roy Smith roy at panix.com
Thu Oct 31 09:20:03 EDT 2013


In article <UdGdnaDGa6n9vu_PnZ2dnUVZ_umdnZ2d at earthlink.com>,
 "E.D.G." <edgrsprj at ix.netcom.com> wrote:
 
> 1.  How fast can Python do math calculations compared with other languages 
> such as Fortran and fast versions of Basic.  I would have to believe that it 
> is much faster than Perl for doing math calculations.

Getting a handle on Python's execution speed is not easy.  The problem 
is that the core library is mostly written in C, so operations that 
happen inside the core library are fast.  Operations that happen in 
user-written Python code are slow.  How fast your overall program will 
run is largely determined by how much you're executing user code and how 
much you're executing library calls.

People have done lots of comparisons of language execution speed over 
the years.  If you google for "python speed comparison", you'll find 
plenty of more detailed answers than you'll get here.

> 2.  Can Python be used to create CGI programs?  These are the ones that run 
> on Internet server computers and process data submitted through Web site 
> data entry screens etc.  I know that Perl CGI programs will do that.

Yes, they can.  However, CGI is largely an obsolete interface, partly 
because it's so inefficient.  If you're worried about execution speed, 
CGI is not what you should be looking at.

> 3.  If Python can be used for CGI programming, can it draw charts such as 
> .png files that will then display on Web pages at a Web site?

Yes.  There are a number of modules out there for doing this.  Again, 
google is your friend.  Search for "python charting module", or 
variations on that.



More information about the Python-list mailing list