views:

163

answers:

1

Alright, I only know some basic python but if I can get help with this then I am considering making it open source.

What I am trying to do: - (Done) Ajax send for init content - Python server recv command "init" to send most recent content - (Done) Ajax recv content and then immediately calls back to python server - Python server recv command "wait", sets up child, and waits for command "new" from ajax - (Done) Ajax sends "new" command - Python server wakes up all waiting children and sends newest content - (Done) Ajax sends "wait", and so forth

I have already written the Python Server part in php but it uses 100% CPU so I knew I had to use forking socket daemon to be able to have multi processes sitting there waiting. Now, I could write this with PHP but the extensions it needs have to be manually installed which can be a problem with asking host to install it on shared accounts and so forth. So I turned to Python which would also give more flexability and run faster. Plus more people could user it.

So, if anyone could help with this, or give some direction, that would be great.

I am working on the code myself just just do not know it well enough. I can add the if statements in for the different commands and add in mysql connection myself. If I end up having any problems, I will ask here. I love this site.

+1  A: 

Look at subprocess.

Read all of these related questions on StackOverflow: http://stackoverflow.com/search?q=%5Bpython%5D+web+subprocess

S.Lott