Project source code layout?

2009-06-03 Thread Allen Fowler
Hello, I'm new to Python, and am looking for some suggestions as to the source code layout for a new project. The project will be a tg/pylons daemon, a static website, and a collection of other scripts that will interact with the app and DB. Here is what I am thinking so far: root_folder/ -

Re: Project source code layout?

2009-06-03 Thread Allen Fowler
> > I'm new to Python, and am looking for some suggestions as to the source > > code layout for a new project. > > Is this the development layout or the deployment layout? The two need not > bear any resemblance. > Looking for suggestions on both. I was hoping to keep the dev layout as clo

Re: Project source code layout?

2009-06-04 Thread Allen Fowler
> > I was hoping to keep the dev layout as close to deployment possible. > > Completely different purposes. For example, the actual production database > and config files form no part of your development project, do they? And > conversely, utility scripts that might be used, for example, to

unicode-to-ascii: replace with space, not "?"

2009-10-14 Thread Allen Fowler
Hello, I've been using "data.encode('ascii','replace')" to force an ASCII string out of Unicode data, with "?" in the place of non-ASCII letters. However, now I want to use a blank space (or maybe a dash) instead of a question mark. How do I do this? Thank you, :) -- http://mail.py

XML(JSON?)-over-HTTP: How to define API?

2009-07-02 Thread Allen Fowler
I have an (in-development) python system that needs to shuttle events / requests around over the network to other parts of itself. It will also need to cooperate with a .net application running on yet a different machine. So, naturally I figured some sort of HTTP event / RPC type of would be

Re: XML(JSON?)-over-HTTP: How to define API?

2009-07-02 Thread Allen Fowler
> I have an (in-development) python system that needs to shuttle events / > requests > around over the network to other parts of itself. It will also need to > cooperate with a .net application running on yet a different machine. > > So, naturally I figured some sort of HTTP event / RPC t

multiprocessing: Correct usage of pool & queue?

2009-09-04 Thread Allen Fowler
Hello, I have a list of tasks/items that I want handed off to threads/processes to complete. (I would like to stick with process if I could, since there is some CPU work here. ) Each task involves some calculations and a call to a remote server over urllib2/HTTP. The time to complete each ta

Scheduling algorithm: Suggestions?

2009-09-07 Thread Allen Fowler
Hello, I have a batch of "rpc style" calls that I must make to an external server via HTTP in a multi threaded fashion. (Return vales must be saved.) Problem is, I need to throttle the rate at which I do this. Each HTTP call takes between 0.2 and several seconds to complete. I need to contr

multiproccess: What is the Dameon flag?

2009-09-15 Thread Allen Fowler
Hello, What is the Daemon flag and when/why would I want to use it? Thank you, AF -- http://mail.python.org/mailman/listinfo/python-list

Re: multiproccess: What is the Dameon flag?

2009-09-15 Thread Allen Fowler
> > > > What is the Daemon flag and when/why would I want to use it? > > > From the documentation: "When a process exits, it attempts to terminate > all of its daemonic child processes.". > > Sometimes you want the main process to wait for its worker processes to > terminate before terminating