> My app should run on debian and windows platforms.
Hard lines :-(
> For storing the configuration data, I use the ConfigParser module.
> What I find difficult is to determine a place for my configuration
> file.
Config parser basically produces an .in file.
The rules that Windows uses to loca
On 8/3/06, Andre Roberge <[EMAIL PROTECTED]> wrote:
> On 8/3/06, Henry Finucane <[EMAIL PROTECTED]> wrote:
> > On 8/3/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> > > Hello!
> > >
> > > My app should run on debian and windows platforms. For storing the
> > > configuration data, I use the Con
On 8/3/06, Henry Finucane <[EMAIL PROTECTED]> wrote:
> On 8/3/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> > Hello!
> >
> > My app should run on debian and windows platforms. For storing the
> > configuration data, I use the ConfigParser module.
> >
> > What I find difficult is to determine
On 8/3/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> Hello!
>
> My app should run on debian and windows platforms. For storing the
> configuration data, I use the ConfigParser module.
>
> What I find difficult is to determine a place for my configuration file. On
> debian, it is simply
>
> o
Hello!
My app should run on debian and windows platforms. For storing the
configuration data, I use the ConfigParser module.
What I find difficult is to determine a place for my configuration file. On
debian, it is simply
os.path.join(os.path.expanduser("~")),"myconfig")
but what am I suppose
On Fri, 14 Jan 2005, Terry Carroll wrote:
> Is this for loop a safe technique, where the list you're enumerating over
> in the for statement is the same as the one being updated in the loop
> body?
Rather than cluttering the list by making three replies, I'd just like to
thank Danny, Alan and J
> > for n,v in enumerate(self.list):
> > self.list[n]=v+'\n'
>
>
> Is this for loop a safe technique, where the list you're enumerating
over
> in the for statement is the same as the one being updated in the
loop
> body? I always avoid things like that.
Its not changing the li
Danny Yoo wrote:
>Using the default parameter 'n' in the readline() method isn't safe:
all
>class instances will end up using the same 'n'. You may want to put
the
>current line number as part of an instance's state, since two
instances of
>a macroString should be able to keep track of their line
Terry Carroll wrote:
On Fri, 14 Jan 2005, Chad Crabtree wrote:
class _macroString(object):
def __init__(self,s):
self.macro=s
self.list=self.macro.split("\n")
for n,v in enumerate(self.list):
self.list[n]=v+'\n'
Is this for loop a safe technique, where the list
On Fri, 14 Jan 2005, Terry Carroll wrote:
> > class _macroString(object):
> > def __init__(self,s):
> > self.macro=s
> > self.list=self.macro.split("\n")
> > for n,v in enumerate(self.list):
> > self.list[n]=v+'\n'
>
> Is this for loop a safe technique, wh
On Fri, 14 Jan 2005, Chad Crabtree wrote:
> I have created a file-like object out of a triple quoted string. I was
> wondering if there is a better way to implement readline than what I
> have below? It just doesn't seem like a very good way to do this.
>
> class _macroString(object):
> def
On Fri, 14 Jan 2005, Chad Crabtree wrote:
> class _macroString(object):
> def __init__(self,s):
> self.macro=s
> self.list=self.macro.split("\n")
> for n,v in enumerate(self.list):
> self.list[n]=v+'\n'
Is this for loop a safe technique, where the list you
> class _macroString(object):
> def __init__(self,s):
> self.macro=s
> self.list=self.macro.split("\n")
> for n,v in enumerate(self.list):
> self.list[n]=v+'\n'
> def readline(self,n=[-1]):
> n[0]+=1
> return self.list[n[0]]
Why not just
Thank you KentBot. That was what I wanted.
Kent Johnson wrote:
> Best: use the StringIO or cStringIO module instead, this is exactly
> what it is for. If you really need len() you could maybe subclass
> StringIO to do what you want.
>
> Next best: Use an iterator. Something like this (Warning!
Best: use the StringIO or cStringIO module instead, this is exactly what it is for. If you really
need len() you could maybe subclass StringIO to do what you want.
Next best: Use an iterator. Something like this (Warning! not tested!):
class _macroString(object):
def __init__(self,s):
I have created a file-like object out of a triple quoted string. I
was
wondering if there is a better way to implement readline than what I
have below? It just doesn't seem like a very good way to do this.
class _macroString(object):
def __init__(self,s):
self.macro=s
self.l
16 matches
Mail list logo