473,513 Members | 2,275 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Simple Python App Server

I use the pyGTD script to manage my todo lists and such. From Vim, I
shell out a call to the gtd.py script, which updates my todo.txt file
after update one of the related pyGTD files. Since I make a lot of
updates to the related pyGTD files, I execute the gtd.py script dozens
of times a day.

The problem is that this script can be a little slow. It usually takes
at least 5 seconds to run, time that I can't use Vim (and running it in
the background from Vim isn't a usable option for me). I tried making
it run faster by adding the following lines at the top of the __main__
method:

import psyco
psyco.full()

This change, however, didn't shave off any noticeable amount of time.

I was wondering if there was a way in which I could run the python
interpreter all of the time so that I wouldn't have to invoke it each
time that I want to run the gtd.py script. Is there a way to do this?o

Thanks in advance!

Tom Purl

Aug 18 '06 #1
2 2250
On 2006-08-18, tom.purl <to******@gmail.comwrote:
I use the pyGTD script to manage my todo lists and such. From
Vim, I shell out a call to the gtd.py script, which updates my
todo.txt file after update one of the related pyGTD files.
Since I make a lot of updates to the related pyGTD files, I
execute the gtd.py script dozens of times a day.
Was your Vim compiled with the +python feature (this enables
several Vim commands to run python code directly in Vim)? I
don't know if that would speed things up or not, but it's worth a
try.

If the feature is present, you can run a Python script with the
:pyfile command.

--
Neil Cerutti
Aug 18 '06 #2
tom.purl schrieb:
I use the pyGTD script to manage my todo lists and such. From Vim, I
shell out a call to the gtd.py script, which updates my todo.txt file
after update one of the related pyGTD files. Since I make a lot of
updates to the related pyGTD files, I execute the gtd.py script dozens
of times a day.

The problem is that this script can be a little slow. It usually takes
at least 5 seconds to run, time that I can't use Vim (and running it in
the background from Vim isn't a usable option for me). I tried making
it run faster by adding the following lines at the top of the __main__
method:

import psyco
psyco.full()

This change, however, didn't shave off any noticeable amount of time.

I was wondering if there was a way in which I could run the python
interpreter all of the time so that I wouldn't have to invoke it each
time that I want to run the gtd.py script. Is there a way to do this?o

Sure. Just enter a loop. Incidentially, common application server
frameworks as SimpleXMLRPC or pyro come with a main event loop which
will of course prevent the interpreter to stop.

Together with the daemonize-recipe from apsn, you have your server.

I suggest you use pyro - that will most probably cause the least fuss.

Diez
Aug 18 '06 #3

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

Similar topics

1
9012
by: Johannes Eble | last post by:
Hello Python community, I am trying the echo-client and echo-server examples in Chapter 10, "Programming Python" by Mark Lutz. It is probably the most simple sockets sample: A socket server just...
1
3248
by: Bowen Chiu | last post by:
Dears: I use a 4KBytes HTML content to do this benchmark, it is just a simple test of python based web server. mod_python with Apache Lifting the server siege... done. Transactions: ...
4
1952
by: Fuzzyman | last post by:
I'm looking to build a simple database application for use on the desktop (customer contact and feedback database). Anyone able to reccomend a simple module / package I can use... ? I've never...
0
1106
by: Mike | last post by:
Hey! Im starting up a new python based project, its a very simple file tracker for our network. Some people would most likely call this a kind of asset management system but its much simplier...
2
11219
by: Gelo Ilzi | last post by:
I'm trying to implement a very simple http server with cgi functionality. The code is simple: import CGIHTTPServer, BaseHTTPServer httpd = BaseHTTPServer.HTTPServer(('',8000),...
1
2055
by: Thomas | last post by:
Hi, Sorry for the stupid subject, but here it goes: I need a simple Webserver which can 1. serve xmlrpc-methods 2. send multicast packets on local network to get response from a similar...
1
1680
by: David Bear | last post by:
I would like some advice on what crypto lib to use. I am writing a cgi app that will store sensative data in a backend postgresql server. I have some simple numeric data I would like to make as...
2
1699
by: nephish | last post by:
Hey there, i have been spending some time learning python. i do enjoy it so. Heres the deal. i need some dirrection advice. i have a friend that wants me to set up a customer database for him....
14
2589
by: robert | last post by:
For testing purposes I'm looking for a simple DAV server - best a python thing serving a folder tree. Don't want to install/change/setup the complex apache dav .. Found PyDav...
2
324
by: bigodines | last post by:
Hi guys! I'm a complete newbie in Python and I'm trying to make a small software to watch my network. It will be a simple snmpget report for a specific machine. I would like to make a small...
0
7265
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
7171
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7388
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7541
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...
0
5693
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5098
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
1607
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
807
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
461
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.