Re: double import protection - how to ?

2008-11-29 Thread Steven D'Aprano
On Sat, 29 Nov 2008 13:43:45 +0100, Helmut Jarausch wrote: > How can I achieve that all/some statements within that module get > executed only at the very first import? (the statement which must be > executed only once, initializes another OS-thread (java in my case)) Python already enforces tha

double import protection - how to ?

2008-11-29 Thread Helmut Jarausch
Hi, sorry if this is a FAQ (I couldn't find an answer) I have a module which gets imported at several different places not all of which are under my control. How can I achieve that all/some statements within that module get executed only at the very first import? (the statement which must be e

Re: Debugging in Python

2008-11-29 Thread Colin J. Williams
Vicent Giner wrote: Hello again. Thank you for the answers I got to my previous question. All of them were very useful to me. I want to know if I have understood well the way I can work with Python. As far as I've understood, [the free version of] ActivePython is just a [good, ready-to-work] P

Re: Exhaustive Unit Testing

2008-11-29 Thread Steven D'Aprano
On Sat, 29 Nov 2008 11:36:56 +0100, Roel Schroeven wrote: > Fuzzyman schreef: >> By the way, to reduce the number of independent code paths you need to >> test you can use mocking. You only need to test the logic inside the >> methods you create (testing behaviour), and not every possible >> combi

Re: Making directories with python

2008-11-29 Thread Stef Mientki
Robert Singer wrote: I've been looking in the archives, but can't find anything similar. I'm trying to write a script which would make directories (winxp platform, py2.5) - actually, just one - a new directory with a date name. That is it would be called, for example: 2008112

Re: HELP!...Google SketchUp needs a Python API

2008-11-29 Thread Дамјан Георгиевски
> Fight with me for Glory not riches. Fight with me and > you shall be free. FREDOM! SketchUp is not free -- дамјан ( http://softver.org.mk/damjan/ ) war is peace freedom is slavery restrictions are enablement -- http://mail.python.org/mailman/listinfo/python-list

Making directories with python

2008-11-29 Thread Robert Singer
I've been looking in the archives, but can't find anything similar. I'm trying to write a script which would make directories (winxp platform, py2.5) - actually, just one - a new directory with a date name. That is it would be called, for example: 20081129 (today's date). A

Re: Using thread in an asyncronous application

2008-11-29 Thread Giampaolo Rodola'
On 29 Nov, 02:24, Aaron Brady <[EMAIL PROTECTED]> wrote: > On Nov 27, 9:03 am, "Giampaolo Rodola'" <[EMAIL PROTECTED]> wrote: > > > > > > > Hi, > > I'm the maintainer of an asynchronous FTP server implementation based > > on asyncore. > > Some days ago I thought it would be interesting to add a cla

Re: Unicode regex and Hindi language

2008-11-29 Thread Martin v. Löwis
> Huh? I thought it was settled. Read Terry Ready's latest message. Read > the bug report it points to (http://bugs.python.org/issue1693050), > especially the contribution from MvL. To paraphrase a remark by the > timbot, Martin reads Unicode tech reports so that we don't have to. > However if you

Re: Exhaustive Unit Testing

2008-11-29 Thread Roel Schroeven
Fuzzyman schreef: By the way, to reduce the number of independent code paths you need to test you can use mocking. You only need to test the logic inside the methods you create (testing behaviour), and not every possible combination of paths. I don't understand that. This is part of something I

Re: HELP!...Google SketchUp needs a Python API

2008-11-29 Thread Aaron Brady
On Nov 28, 10:42 pm, r <[EMAIL PROTECTED]> wrote: > Arron, i give you an A++ just for writing a longer post than me =D Hey wow, lucky me. Maybe someone will read it too. -- http://mail.python.org/mailman/listinfo/python-list

Re: Unicode regex and Hindi language

2008-11-29 Thread John Machin
On Nov 29, 10:51 am, MRAB <[EMAIL PROTECTED]> wrote: > John Machin wrote: > > On Nov 29, 2:47 am, Shiao <[EMAIL PROTECTED]> wrote: > >> The regex below identifies words in all languages I tested, but not in > >> Hindi: > > >> pat = re.compile('^(\w+)$', re.U) > >> ... > >>    m = pat.search(l.decod

Re: Python docs and enumeration of sections

2008-11-29 Thread Kay Schluehr
On 29 Nov., 09:47, Robert Kern <[EMAIL PROTECTED]> wrote: > Kay Schluehr wrote: > > Is there a reason why enumeration of sections and subsections has been > > dropped after the switch to the Sphinx documentation tool? > > > It doesn't really make quoting library sections easier or do you know > > w

Debugging in Python

2008-11-29 Thread Vicent Giner
Hello again. Thank you for the answers I got to my previous question. All of them were very useful to me. I want to know if I have understood well the way I can work with Python. As far as I've understood, [the free version of] ActivePython is just a [good, ready-to-work] Python distribution. Al

Re: Python docs and enumeration of sections

2008-11-29 Thread Robert Kern
Kay Schluehr wrote: Is there a reason why enumeration of sections and subsections has been dropped after the switch to the Sphinx documentation tool? It doesn't really make quoting library sections easier or do you know what I mean when I refer to "How It Works"? If you hover the mouse over th

Re: python.org coming back as unreachable in Dillo (IPv6 routing error?)

2008-11-29 Thread Martin v. Löwis
> Have any network changes taken place at python.org (particularly IPv6 or > DNS related) recently? Yes, python.org has IPv6 connectivity now, and many systems (except for mail) have IPv6 DNS entries (). > Some of the configuration details from my machine: > > [EMAIL PROTECTED]:~$ ip -f inet

Re: Best way to dynamically get an attribute from a module from within the same module

2008-11-29 Thread Gabriel Genellina
En Mon, 24 Nov 2008 02:11:49 -0200, Rafe <[EMAIL PROTECTED]> escribió: What are the pros and cons of these two patterns (and are there any other)? Which is the best way to dynamically get an attribute from a module from within the same module? 1) Using the name of the module this_module = s

Python docs and enumeration of sections

2008-11-29 Thread Kay Schluehr
Is there a reason why enumeration of sections and subsections has been dropped after the switch to the Sphinx documentation tool? It doesn't really make quoting library sections easier or do you know what I mean when I refer to "How It Works"? -- http://mail.python.org/mailman/listinfo/python-list

Re: Confused about class relationships

2008-11-29 Thread Carl Banks
On Nov 26, 11:20 pm, John O'Hagan <[EMAIL PROTECTED]> wrote: > Apologies if this is a D.Q., I'm still learning to use classes, and this > little problem has proved too specific to find in the tutorials. > > I have two classes with a relationship that I find confusing. > > One is called Engine, and

<    1   2