RE: Last 4 Letters of String

2008-02-21 Thread James Newton
>>> "string whose last four letters are abcd"[-4:] 'abcd' From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Robert Rawlins - Think Blue Sent: 21 February 2008 11:36 To: python-list@python.org Subject: Last 4 Letters of String Hello Guys, I

RE: Globals or objects? (is: module as singleton)

2008-02-21 Thread James Newton
Duncan Booth wrote: > you can create additional module instances (by calling new.module) Hi Duncan, Could you provide a scenario where this would be useful (and the best practice)? > What you get with a module is support for locating a specific module > and ensuring that you don't get duplicate

RE: Globals or objects? (is: module as singleton)

2008-02-21 Thread James Newton
Mel wrote: >> James Newton wrote: >> Could you give a bare-bones demonstration of [implementing a singleton >> by using a module]? > > I had a club-membership application that ran for several years. > Default pathnames, etc. for the particular year came from a m

RE: Globals or objects?

2008-02-21 Thread James Newton
Duncan Booth wrote: > The easiest way in Python to implement a singleton is just to > use a module: all modules are singletons and there is a > defined mechanism (import) for accessing them. Hi Duncan, I'm intrigued by this idea. Could you give a bare-bones demonstration of it that the relative

RE: Is there a simple way to parse this string ?

2007-12-19 Thread James Newton
>I need to translate the following string >a = '(0, 0, 0, 255), (192, 192, 192, 255), True, 8' > >into the following list or tuple >b = [(0, 0, 0, 255), (192, 192, 192, 255), True, 8 ] >Is there a simple way to to this. >Stef Mientki >>> a = '(0, 0, 0, 255), (192, 192, 192, 255), True, 8