473,382 Members | 1,814 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,382 software developers and data experts.

Lowest hassle Python web server?

I keep telling my friends that Python rocks. Now it's time to put my
money where my mouth is. I'm about to start writing a server for a
phone based game. It needs to handle simlpe requests from some Java
code running on the phone at a fairly low transaction rate. There will
also be a simple web site allowing users to edit preferences and so
forth. I have just enough Python experience to decide that I prefer it
over Java for this job. It'll be on a Linux box that I have full
control over.

I can see from FAQs that there are several possible ways of doing web
server work in Python, e.g. Twisted or mod_python in Apache, etc. So
I'm wondering:

- Could you recommend a solution you've found to be the most
convenient?
- Does threading cause any more of a hassle in Python than Java?
- Is there anything similar to JSP in Java?

Thanks,
KanZen

Jul 18 '05 #1
7 1484
kanzen wrote:
- Does threading cause any more of a hassle in Python than Java?
What hassles have you had? I thought threads in Java
were pretty straightforward. In any case, in Python
they are generally very easy to use, provided you have
a basic knowledge of thread safety issues and/or provided
you restrict all interaction between threads to use
the Queue module.
- Is there anything similar to JSP in Java?


Snakelets? Google will find it for you.

-Peter
Jul 18 '05 #2
kanzen wrote:
I keep telling my friends that Python rocks. Now it's time to put my
money where my mouth is. I'm about to start writing a server for a
phone based game. It needs to handle simlpe requests from some Java
code running on the phone at a fairly low transaction rate. There will
also be a simple web site allowing users to edit preferences and so
forth. I have just enough Python experience to decide that I prefer it
over Java for this job. It'll be on a Linux box that I have full
control over.

I can see from FAQs that there are several possible ways of doing web
server work in Python, e.g. Twisted or mod_python in Apache, etc. So
I'm wondering:

- Could you recommend a solution you've found to be the most
convenient?
- Does threading cause any more of a hassle in Python than Java?
- Is there anything similar to JSP in Java?

Thanks,
KanZen


You can look into CherryPy http://www.cherrypy.org/

Hope this helps
Adonis
Jul 18 '05 #3
kanzen wrote:
I keep telling my friends that Python rocks. Now it's time to put my
money where my mouth is. I'm about to start writing a server for a
phone based game. It needs to handle simlpe requests from some Java
code running on the phone at a fairly low transaction rate. There will
also be a simple web site allowing users to edit preferences and so
forth. I have just enough Python experience to decide that I prefer it
over Java for this job. It'll be on a Linux box that I have full
control over.

I can see from FAQs that there are several possible ways of doing web
server work in Python, e.g. Twisted or mod_python in Apache, etc. So
I'm wondering:

- Could you recommend a solution you've found to be the most
convenient?
I've tested a few, and when it finally came that I wanted and needed to
do web application development in Python for real, I decided to use
Snakelets.

So far, I find it a very convenient way to write web applications. It's
also very close to how Java servlets/JSP pages work.

FWIW, the other frameworks I've tested thoroughly were Quixote and WebWare.
- Does threading cause any more of a hassle in Python than Java?
- Is there anything similar to JSP in Java?


Snakelets Ypages come close to JSP.

-- Gerhard
Jul 18 '05 #4
<snip>
- Does threading cause any more of a hassle in Python than Java?
<snip>

Hello,

From the python docs, it states that the threading design is loosely
based upon the java module. Certainly, coming from Java I had little
trouble getting used to python threading. However heres some gotchyas :

- The thing to beware of there is something in Python called the GIL.
Read up about that before you start threading stuff - this will explain
to you why there is no volatile keyword - this got me confused at first.
- There is no synchronize keyword, instead you have to use locks which
can be obtained from the threading module
- There are no methods such as wait on an object (there is an event
object you can get to call wait upon - again threading)
- The handy concurrent stuff which has been introduced in J2SE5.0
mainly isn't in python - through you do get Queues in Python (maybe
more, I dunno?)

The GIL thing makes it easier to do threading with Python (there are
disadvantages to the GIL but I won't get into that here - if you're
interested read through the history on this group) but it's still
threading so beware!

Cheers,

Neil

--

Neil Benn
Senior Automation Engineer
Cenix BioScience
BioInnovations Zentrum
Tatzberg 46
D-01307
Dresden
Germany

Tel : +49 (0)351 4173 154
e-mail : be**@cenix-bioscience.com
Cenix Website : http://www.cenix-bioscience.com

Jul 18 '05 #5
Okay, thanks for your suggestions. Are there any further
recommendations as to what Python framework to use if the web server is
Apache with mod_python?

Jul 18 '05 #6
kanzen wrote:
I keep telling my friends that Python rocks. Now it's time to put my
money where my mouth is. I'm about to start writing a server for a
phone based game. It needs to handle simlpe requests from some Java
code running on the phone at a fairly low transaction rate. There will
also be a simple web site allowing users to edit preferences and so
forth. I have just enough Python experience to decide that I prefer it
over Java for this job. It'll be on a Linux box that I have full
control over.

I can see from FAQs that there are several possible ways of doing web
server work in Python, e.g. Twisted or mod_python in Apache, etc. So
I'm wondering:

- Could you recommend a solution you've found to be the most
convenient?
- Does threading cause any more of a hassle in Python than Java?
- Is there anything similar to JSP in Java?

Thanks,
KanZen

You might want to take a look a Medusa. It is the basis for the
web server that is bundled in Zope.

http://www.nightmare.com/medusa/

Larry Bates
Jul 18 '05 #7
Larry Bates wrote:
[...] You might want to take a look a Medusa. It is the basis for the
web server that is bundled in Zope.


Medusa is just an asyncore framework, and not something you can develop
web apps with.

-- Gerhard
Jul 18 '05 #8

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

Similar topics

41
by: Matt Alanzo | last post by:
Our SOHO 2 person compay sells furniture (not programmers). In '98 we paid $,$$$ for a VBA -Access '97 accounting application, including VBA source code .... an huge investment for us then (and...
11
by: ex laguna | last post by:
How do I find the lowest bit position of a mask using only macros? I want to do everything in compile time. That mean, there cannot be control statements such as if, while, for, etc. in the...
26
by: pamelafluente | last post by:
Hi , I have a DIV element in a page with a lot of other stuff (the page can scroll several times) absolutely positioned: <div id="MyDIV" <br<brFooter </div> Just after the page load, I...
5
by: owz | last post by:
Hi again had some more problems, all help welcome. Access 2000, SQL My problem is as stated in the title. I want 2 display the highest and lowest priced car sold for this month. This is what I...
17
by: rhitz1218 | last post by:
Hi, I'm trying to create a function that will sort a number's digits from highest to lowest. For example 1000 - will become 0001 or 1234 to 4321
13
by: td0g03 | last post by:
Hello again guys. I have a question. I'm working on a program for my class and I'm stuck on how to find the lowest and highest number of a user input. We aren't at arrays yet so that's out of the...
54
namcintosh
by: namcintosh | last post by:
First of all, here is my program: #include <iostream> #include <conio> using namespace std; //Function prototype void getscore(int&, int&, int&, int&, int&); void findLowest (int, int,...
0
by: 1 | last post by:
Dear friend, we sell all kinds of laptops and guitars . our product is a quantity best, the price is the lowest in the world, i think you will be interested in our product . thanks a lot! Our...
5
by: davenet | last post by:
Hi, I'm new to Python and working on a school assignment. I have setup a dictionary where the keys point to an object. Each object has two member variables. I need to find the smallest value...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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...

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.