473,396 Members | 2,016 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Can I compile Python for the web?

Dear sirs,

I'm doing some investigations on the Python language.
I'd like to know if it is possible to compile Python code made for the web
(an online database for instance), and to run it using mod_python. How is
it possible? I think it would be very fast to execute the code if it were
compiled.
Thanks,

--
Charles.

Desenvolvimento e criação de sites: www.auriance.com
Hospedagem de sites e servidores dedicados: www.auriance.net
Sep 24 '05 #1
2 1670
Charles wrote:
I'm doing some investigations on the Python language.
I'd like to know if it is possible to compile Python code made for the
web (an online database for instance), and to run it using mod_python.
How is it possible? I think it would be very fast to execute the code
if it were compiled.


Python code is already compiled, specifically to .pyc files, though this
is clearly not what you meant by the above. (The .pyc files contain
"bytecode" which is executed by the Python virtual machine, much like a
CPU executes its native opcodes, or like Java executes its own bytecode
instructions.)

What you appear to be asking is if it's possible to create *native
machine code* from Python source in order to achieve a significant
increase in performance. The short answer is "no, not really", and
longer answers include "yes, sort of, using something like Psyco", and
"who cares because it wouldn't give you much better performance for a
web-based application where you're probably either I/O-bound or limited
by the speed of the non-Python database solution you are using in the
first place?".

-Peter
Sep 24 '05 #2
On Friday 23 September 2005 07:53 pm, Peter Hansen wrote:
What you appear to be asking is if it's possible to create *native
machine code* from Python source in order to achieve a significant
increase in performance. The short answer is "no, not really", and
longer answers include "yes, sort of, using something like Psyco", and
"who cares because it wouldn't give you much better performance for a
web-based application where you're probably either I/O-bound or limited
by the speed of the non-Python database solution you are using in the
first place?".


All pretty true of course, but I think I did read about some tests of
running Zope with psyco. Zope uses a pretty massive amount of Python
code on each access, so there's probably a lot to optimize. Unfortunately
I don't remember what the results were.

But I'd recommend search the zope-user mailing list archives or just
google for "psyco site:zope.org"

Terry
--
Terry Hancock ( hancock at anansispaceworks.com )
Anansi Spaceworks http://www.anansispaceworks.com

Sep 24 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Grzegorz Dostatni | last post by:
Cheers. First what I am trying to do: I am trying to create a version of pytho23.dll that contains everything inside of it. It is staticaly linked. It also needs to contain the qt library. For...
1
by: vincent delft | last post by:
I've a module written in C and the associated setup.py. Work fine (and compile fine with mvc) with Python 2.3.x Now I've installed Python 2.4 (all the rest unchanged) When I try to compile it,...
8
by: janeaustine50 | last post by:
Python's InteractiveInterpreter uses the built-in compile function. According to the ref. manual, it doesn't seem to concern about the encoding of the source string. When I hand in an unicode...
4
by: Jari Aalto | last post by:
Please suggest comments how can I make this script to work from bash. Also how can I skip better the argument from command line without hte extra variable i? #!/bin/bash function compile ()...
4
by: livin | last post by:
my log... INFO urllib.urlopen('http://192.168.1.11/hact/kitchen.asp', urllib.urlencode({'Action': 'hs.ExecX10ByName+Kitchen+Lights%2C+On %2C+100&x=4&y=6'})) INFO INFO File...
4
by: nickpreiser | last post by:
Hi Everyone, I trying to get a build of Python together to run on an Embedded Linux / Mips machine. I run the ./configure --host= XXXmips(my mips proc) --build=XXX x86(my pc). and the...
0
by: Fuzzyman | last post by:
Hello all, The following is a copy of a blog entry. It's asking a question about future statements and the built in compile function. I'd appreciate any pointers or comments about possible...
14
by: mistral | last post by:
Need compile python code, source is in html and starts with parameters: #!/bin/sh - "exec" "python" "-O" "$0" "$@" I have installed ActivePython for windows.
0
by: Martijn de Munnik | last post by:
Hi, I'm trying to build/install pysqlite on a Solaris 10 platform. I've got Sun Studio 11 on a AMD 64 platform and got this error. I'm a python newbie and just want to install trac. I've got...
2
by: jmtulloss | last post by:
Hello all, I've been trying to get Python to cross compile to linux running on an ARM. I've been fiddling with the cross compile patches here:...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.