Re: [Tutor] Python 2.2... os.exec catch stdout

2009-06-05 Thread ALAN GAULD
If vim is just an unfortunate example then it might be possible but I think we need to know a bit more about what exactly you are trying to do. > It's actually a stand alone program; which opens up a $EDITOR; an > then prints to stdout the results of some db munging. ... > what I'm wanting to g

Re: [Tutor] Mapping to an equivalent / similar object?

2009-06-05 Thread Walker Hale IV
On Thu, May 28, 2009 at 5:41 PM, Allen Fowler wrote: > How should the mapping between the CanonicalFlavor('Vanilla') object and > ManufAFlavor('Vanilla') / ManufBFlavor('Vanilla') objects be handled. Create a dict. The keys are either CannonicalFlavor objects or just strings containing the cano

Re: [Tutor] split or replace

2009-06-05 Thread Chris Fuller
On Friday 05 June 2009 06:18, Norman Khine wrote: > Hello, > What is the way to group each value so that I get a list, from a string > like: > > dir = '/expert/forum/expert/expert' > list = ['/expert', '/forum', '/expert', '/expert'] > > I've tried: > >>> dir = '/expert/forum' > >>> dir.split('/')

Re: [Tutor] split or replace

2009-06-05 Thread Kent Johnson
On Fri, Jun 5, 2009 at 7:18 AM, Norman Khine wrote: > Hello, > What is the way to group each value so that I get a list, from a string like: > > dir = '/expert/forum/expert/expert' > list = ['/expert', '/forum', '/expert', '/expert'] Here is one way using re.split(): In [28]: import re In [29]: [

Re: [Tutor] split or replace

2009-06-05 Thread W W
On Fri, Jun 5, 2009 at 6:18 AM, Norman Khine wrote: > Hello, > What is the way to group each value so that I get a list, from a string > like: > > dir = '/expert/forum/expert/expert' > list = ['/expert', '/forum', '/expert', '/expert'] > > I've tried: > >>> dir = '/expert/forum' > >>> dir.split('

[Tutor] split or replace

2009-06-05 Thread Norman Khine
Hello, What is the way to group each value so that I get a list, from a string like: dir = '/expert/forum/expert/expert' list = ['/expert', '/forum', '/expert', '/expert'] I've tried: >>> dir = '/expert/forum' >>> dir.split('/') ['', 'expert', 'forum'] >>> dir.replace("/expert","") '/forum' >>> d

Re: [Tutor] Python 2.2... os.exec catch stdout

2009-06-05 Thread Alan Gauld
"Chris Mueller" wrote This would be simple; if I did not need to interact with my sub-program. I currently have.. pid = os.fork() if not pid: os.execvp(program, (program,) + tuple(arguments)) os.wait()[0] This works fine; lets me interact with "vim" fine; and return to the python script

[Tutor] unified way or cookbook to access cheetah from other frameworks django/webpy/pylons

2009-06-05 Thread mobiledreamers
can you or tavis or one of the cheetah masters please show us how to use cheetah from webpy the only useful thing webpy cheetah.py does is replace the #include with the content of the files Can you share a simple snippet/cookbook example on how to hook up cheetah from other frameworks such as djan