Re: Tkinter Radio button on the second window

2008-09-05 Thread Dream
Thank you very much. Now I use "window2=Toplevel()" to create the second window, and it works well. -- http://mail.python.org/mailman/listinfo/python-list

Re: Understanding the pythonic way: why a.x = 1 is better than a.setX(1) ?

2008-09-05 Thread Terry Reedy
Marco Bizzarri wrote: I understand that Python is a balance between different forces (like any software object around the world) and I'm simply asking some pointers to the discussion leading to this balance. The original decisions by Guido were nearly 20 years ago and other discussions are

Re: Creating directories

2008-09-05 Thread david wright
--- On Fri, 9/5/08, srinivasan srinivas <[EMAIL PROTECTED]> wrote: > From: srinivasan srinivas <[EMAIL PROTECTED]> > Subject: Creating directories > To: python-list@python.org > Date: Friday, September 5, 2008, 1:44 AM > Can someone tell me is there any module available to create > directories?? >

derived classes and __getattr__

2008-09-05 Thread Alexandru Moșoi
i'm facing the following problem: class Base(object): def __getattr__(self, attr): return lambda x: attr + '_' + x def dec(callable): return lambda *args: 'dec_' + callable(*args) class Derived(Base): what_so_ever = dec(Base.what_so_ever) # wrong, base doesn't have what_so_ever mumu =

[ANN] final 2008 Python courses, San Francisco

2008-09-05 Thread wesley chun
Need to get up-to-speed with Python as quickly as possible? Come join me, Wesley Chun, author of Prentice-Hall's bestseller "Core Python Programming," for another comprehensive intro course plus a 1-day Internet programming course coming up in November in beautiful Northern California! I look forwa

atomic section in code

2008-09-05 Thread Ahmad Humayun
Hi there, I need to create an atomic section in Python code i.e. there is no context switch to any other thread during the running of that piece of code. Would would do the trick? thanks, -- http://mail.python.org/mailman/listinfo/python-list

Re: max(), sum(), next()

2008-09-05 Thread Manu Hack
On Thu, Sep 4, 2008 at 4:25 PM, castironpi <[EMAIL PROTECTED]> wrote: > On Sep 4, 2:42 pm, [EMAIL PROTECTED] wrote: >> David C. Ullrich: >> >> > At least in mathematics, the sum of the elements of >> > the empty set _is_ 0, while the maximum element of the >> > empty set is undefined. >> >> What do

Re: derived classes and __getattr__

2008-09-05 Thread Peter Otten
Alexandru Moșoi wrote: > i'm facing the following problem: > > class Base(object): > def __getattr__(self, attr): return lambda x: attr + '_' + x > > def dec(callable): > return lambda *args: 'dec_' + callable(*args) > > class Derived(Base): >what_so_ever = dec(Base.what_so_ever) # wron

Re: derived classes and __getattr__

2008-09-05 Thread Fredrik Lundh
Alexandru Mos,oi wrote: i'm facing the following problem: class Base(object): def __getattr__(self, attr): return lambda x: attr + '_' + x def dec(callable): return lambda *args: 'dec_' + callable(*args) class Derived(Base): what_so_ever = dec(Base.what_so_ever) # wrong, base doesn't h

Re: atomic section in code

2008-09-05 Thread Fredrik Lundh
Ahmad Humayun wrote: I need to create an atomic section in Python code i.e. there is no context switch to any other thread during the running of that piece of code. Would would do the trick? use a lock, and make sure that anyone that needs access to the shared state you're manipulating in tha

Re: ctypes error on Windows

2008-09-05 Thread Thomas Heller
Fredrik Lundh schrieb: > Fredrik Lundh wrote: > >>> I do have the tidy.dll installed (if I didn't, I couldn't even import >>> the tidy module). >> >> typing the following into the Python interpreter might give you some >> more clues: >> >> >>> import _tidy >> >>> _tidy.__file__ >>

Re: max(), sum(), next()

2008-09-05 Thread Ken Starks
David C. Ullrich wrote: In article <[EMAIL PROTECTED]>, Mensanator <[EMAIL PROTECTED]> wrote: On Sep 3, 2:18 pm, Laszlo Nagy <[EMAIL PROTECTED]> wrote: [EMAIL PROTECTED] wrote: Empty Python lists [] don't know the type of the items it will contain, so this sounds strange: sum([]) 0 Becaus

Re: Understanding the pythonic way: why a.x = 1 is better than a.setX(1) ?

2008-09-05 Thread Marco Bizzarri
On Thu, Sep 4, 2008 at 7:15 PM, Timothy Grant <[EMAIL PROTECTED]> wrote: > > I think the most obvious solution to the problem is effective unit > tests. If you type "a.y =1" and have a test that asserts a.x == 1 then > you would quite quickly discover that you made a typo. > > > -- > Stand Fast, >

Re: configure kdevelop for python

2008-09-05 Thread Kushal Das
On Sunday 31 August 2008 01:59:11 pm Sindhu wrote: > am a newbie to python language and kdevelop, so i would like to know > how to configure kdevelop for python programming? complete with a > debugger? Read here http://www.kde.in/index.php/Getting_started_with_KDevelop Kushal -- Fedora Ambassador

Re: derived classes and __getattr__

2008-09-05 Thread Alexandru Mosoi
On Sep 5, 11:47 am, Peter Otten <[EMAIL PROTECTED]> wrote: > Alexandru Moșoi wrote: > > i'm facing the following problem: > > > class Base(object): > >   def __getattr__(self, attr): return lambda x: attr + '_' + x > > > def dec(callable): > >   return lambda *args: 'dec_' + callable(*args) > > > c

Re: "Full" element tag listing possible with Elementtree?

2008-09-05 Thread Stefan Behnel
[EMAIL PROTECTED] wrote: > I have the unenviable task of turning about 20K strangely formatted > XML documents from different sources into something resembling a > clean, standard, uniform format. I like Elementtree and have been > using it to step through the documents to get a feel for their > s

Re: derived classes and __getattr__

2008-09-05 Thread Peter Otten
Alexandru Mosoi wrote: > On Sep 5, 11:47 am, Peter Otten <[EMAIL PROTECTED]> wrote: >> Alexandru Moșoi wrote: >> > i'm facing the following problem: >> >> > class Base(object): >> > def __getattr__(self, attr): return lambda x: attr + '_' + x >> >> > def dec(callable): >> > return lambda *args: '

Re: derived classes and __getattr__

2008-09-05 Thread Michele Simionato
On Sep 5, 11:46 am, Alexandru Mosoi <[EMAIL PROTECTED]> wrote: > I have another small problem. now, > d.third('blah') doesn't work because instance d doesn't have 'third' > attribute. I was expecting derived class to inherit the metaclass as > well, but it didn't. Yep, it is explained here: http

Re: atomic section in code

2008-09-05 Thread Ahmad Humayun
On Sep 5, 1:59 pm, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > Ahmad Humayun wrote: > > I need to create an atomic section in Python code i.e. there is no > > context switch to any other thread during the running of that piece of > > code. Would would do the trick? > > use a lock, and make sure that

newbie question: how to run a python file if it is in a package

2008-09-05 Thread neoedmund
for example: X.py is in aaa.bbb and it has a line like "import aaa.bbb.Y" how can I run X.py avoiding it saying such like "ImportError: No module named aaa.bbb"? Is all runnable script must be in the default package? thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: atomic section in code

2008-09-05 Thread Diez B. Roggisch
Ahmad Humayun schrieb: On Sep 5, 1:59 pm, Fredrik Lundh <[EMAIL PROTECTED]> wrote: Ahmad Humayun wrote: I need to create an atomic section in Python code i.e. there is no context switch to any other thread during the running of that piece of code. Would would do the trick? use a lock, and make

Re: newbie question: how to run a python file if it is in a package

2008-09-05 Thread Diez B. Roggisch
neoedmund schrieb: for example: X.py is in aaa.bbb and it has a line like "import aaa.bbb.Y" how can I run X.py avoiding it saying such like "ImportError: No module named aaa.bbb"? Is all runnable script must be in the default package? There is no such thing as a "default package" All import

Re: Case-insensitive string compare?

2008-09-05 Thread Maric Michaud
Le Friday 05 September 2008 08:30:44 Fredrik Lundh, vous avez écrit : > Maric Michaud wrote: > > You''ll often see for loops written like this : > > > > for i in (e for e in iterable if predicate(e)) : > > ... > > luckily, I don't. most people, when faced with that problem, writes it > in the

Re: atomic section in code

2008-09-05 Thread Michele Simionato
On Sep 5, 10:59 am, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > > 1) seehttp://effbot.org/zone/thread-synchronization.htm The page you link here is WAYS better than the standard documentation of the threading module. Generally speaking, the effbot zone contains a lot of improvements over the standa

Re: Python and Cyrillic characters in regular expression

2008-09-05 Thread phasma
string = u"Привет" (u'\u041f\u0440\u0438\u0432\u0435\u0442',) string = u"Hi.Привет" (u'Hi',) On Sep 4, 9:53 pm, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > phasma wrote: > > Hi, I'm trying extract all alphabetic characters from string. > > > reg = re.compile('(?u)([\w\s]+)', re.UNICODE) > > buf =

Re: Case-insensitive string compare?

2008-09-05 Thread Maric Michaud
Le Friday 05 September 2008 08:24:29 Fredrik Lundh, vous avez écrit : > Maric Michaud wrote: > > "premature optimization is the root of all evil" > > So is use by that statement by people who don't have the slightest idea > about what it actually means. > > The full version is > > "We should forget

Re: path slashes cleaning

2008-09-05 Thread Michael Wronna
Am 04.09.2008, 15:27 Uhr, schrieb Mike Driscoll <[EMAIL PROTECTED]>: On Sep 4, 8:25 am, "Mathieu Prevot" <[EMAIL PROTECTED]> wrote: Hi, for scripts that take arguments, I would like to remove the trailing slash if it's present. Is there something else than: a='/usr/local/lib/' if a[-1] == '/

Re: max(), sum(), next()

2008-09-05 Thread Ken Starks
David C. Ullrich wrote: I don't see why you feel the two should act the same. At least in mathematics, the sum of the elements of the empty set _is_ 0, while the maximum element of the empty set is undefined. And both for good reason: (i) If A and B are disjoint sets we certainly want to ha

Re: newbie question: how to run a python file if it is in a package

2008-09-05 Thread neoedmund
On Sep 5, 8:12 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > neoedmund schrieb: > > > for example: > > > X.py is in aaa.bbb and it has a line like "import aaa.bbb.Y" > > how can I run X.py avoiding it saying such like "ImportError: No > > module named aaa.bbb"? > > > Is all runnable script mu

Re: Case-insensitive string compare?

2008-09-05 Thread J. Clifford Dyer
On Thu, 2008-09-04 at 18:48 -0500, Robert Dailey wrote: > Thanks everyone for your help. I'm not opposed to using [key.lower() > for key in stage_map] at all, I was just curious to see if there were > any cleaner alternatives. It looks like that is what I'll be using. > I'm not familiar with how py

Re: derived classes and __getattr__

2008-09-05 Thread Alexandru Mosoi
On Sep 5, 1:13 pm, Peter Otten <[EMAIL PROTECTED]> wrote: > Alexandru  Mosoi wrote: > > On Sep 5, 11:47 am, Peter Otten <[EMAIL PROTECTED]> wrote: > >> Alexandru Moșoi wrote: > >> > i'm facing the following problem: > > >> > class Base(object): > >> > def __getattr__(self, attr): return lambda x: a

Regarding subprocess module

2008-09-05 Thread tarun
Hello all, I wrote the following code: import subprocess,time cmdExe = "C:\\WINDOWS\\system32\\cmd.exe" myProcess = subprocess.Popen(cmdExe,stdin=subprocess.PIPE) time.sleep(2) myProcess.stdin.write('cd Desktop\r\n') I copied the above lines of code to a file and tried executing the python file

Core dumped while interacting with OpenOffice.org via pyuno

2008-09-05 Thread Marco Bizzarri
Hi all. I'm experiencing a core dump while working in the following environment - debain etch - python2.3 - openoffice.org 2.4 - Zope 2.8.8 I was able to get a core dump, and the backtrace shows the following: Core was generated by `python2.3 tests/testActs.py'. Program terminated with signal 1

[ANN] PyDM 1.1

2008-09-05 Thread Mohamed Yousef
PyDM 1.1 is released and now available from http://sourceforge.net/projects/pycdm/ PyDM is a Multi-Threaded Download Manager in Python , this is the second release Features :- 1) Http handling at socket level no external http libs 2) Two interfaces with core , one in Qt and the other is Co

Re: derived classes and __getattr__

2008-09-05 Thread Bruno Desthuilliers
Alexandru Mosoi a écrit : (snip) i somehow fixed the problem using: def __getattr__(self, attr): return functools.partial(Base.__metaclass__.__getattr__(self.__class__, attr), self) however this looks ugly enough to look for another solution. i still have one more question: why do I h

int((9.2-9.0)*10) is 1, int((9.21-9.0)*10) is 2, why?

2008-09-05 Thread bcm
Python 2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 bit (Intel)] on win32 The following line of code describes an funny question: >>> int((9.2-9.0)*10) 1 >>> int((9.21-9.0)*10) 2 >>> int((9.1-9.0)*10) 0 >>> int((9.11-9.0)*10) 1 >>> int((8.2-8.0)*10) 1 >>> int((8.23-8.0)*10) 2 why? any

Re: Curious: 2134 2004-10-06 08:55:20Z fredrik

2008-09-05 Thread Akathorn Greyhat
2008/9/5 Gabriel Genellina <[EMAIL PROTECTED]> > > > I'd say the import mechanism got confused about the actual source of the > error. Probably it happened on line 3 in *another* module, but the traceback > got messed. Perhaps "core" is a package and contains "import data" at line > 3? > > The $Id:

‘A Byte of Python’ updated for Python 3.0

2008-09-05 Thread Kushal Das
Hi all, Swaroop just released the latest version of his book "A Byte of Python", the new version is for Python 3.0. Read the post at http://www.swaroopch.com/blog/book-updated-for-python-3000/ The book can be found at http://www.swaroopch.com/notes/Python Kushal -- http://fedoraproject.org http

Re: int((9.2-9.0)*10) is 1, int((9.21-9.0)*10) is 2, why?

2008-09-05 Thread John Machin
On Sep 5, 11:12 pm, bcm <[EMAIL PROTECTED]> wrote: > Python 2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 bit > (Intel)] on win32 > The following line of code describes an funny question:>>> int((9.2-9.0)*10) > 1 > >>> int((9.21-9.0)*10) > 2 > >>> int((9.1-9.0)*10) > 0 > >>> int((9.11-9

cx_oracle and commands

2008-09-05 Thread gaius hammond
Hi all, I am having a very strange problem with cx_Oracle, has anyone seen this kind of behavior before: ActivePython 2.5.2.2 (ActiveState Software Inc.) based on Python 2.5.2 (r252:60911, Mar 27 2008, 18:53:24) [C] on sunos5 Type "help", "copyright", "credits" or "license" for more informati

Re: int((9.2-9.0)*10) is 1, int((9.21-9.0)*10) is 2, why?

2008-09-05 Thread bcm
On Sep 5, 9:29 pm, John Machin <[EMAIL PROTECTED]> wrote: > On Sep 5, 11:12 pm, bcm <[EMAIL PROTECTED]> wrote: > > > > > Python 2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 bit > > (Intel)] on win32 > > The following line of code describes an funny question:>>> > > int((9.2-9.0)*10) >

Spring Python 0.6.0 has been released

2008-09-05 Thread Goldfish
Spring Python 0.6.0, the python offshoot of the Spring framework and Spring Security, has been released (http:// springpython.webfactional.com). See http://sourceforge.net/project/showfiles.php?group_id=184275&package_id=214366&release_id=624328 for more details. BTW, if you click on the release

Re: Core dumped while interacting with OpenOffice.org via pyuno

2008-09-05 Thread Maric Michaud
Le Friday 05 September 2008 15:04:22 Marco Bizzarri, vous avez écrit : > Hi all. > > I'm experiencing a core dump while working in the following environment > > - debain etch > - python2.3 > - openoffice.org 2.4 > - Zope 2.8.8 > > I was able to get a core dump, and the backtrace shows the following

Re: cx_oracle and commands

2008-09-05 Thread Edwin . Madari
gaius hammond Wrote: >Hi all, > > >I am having a very strange problem with cx_Oracle, has anyone >seen this kind of behavior before: > > > >ActivePython 2.5.2.2 (ActiveState Software Inc.) based on >Python 2.5.2 (r252:60911, Mar 27 2008, 18:53:24) [C] on sunos5 >Type "help", "copyright", "credits"

Re: Case-insensitive string compare?

2008-09-05 Thread J. Cliff Dyer
Please keep the discussion on-list. On Fri, 2008-09-05 at 15:36 +0200, Maric Michaud wrote: > Le Friday 05 September 2008 14:33:22 J. Clifford Dyer, vous avez écrit : > > On Thu, 2008-09-04 at 18:48 -0500, Robert Dailey wrote: > > > Thanks everyone for your help. I'm not opposed to using [key.lowe

Re: Case-insensitive string compare?

2008-09-05 Thread Maric Michaud
Le Friday 05 September 2008 14:33:22 J. Clifford Dyer, vous avez écrit : > On Thu, 2008-09-04 at 18:48 -0500, Robert Dailey wrote: > > Thanks everyone for your help. I'm not opposed to using [key.lower() > > for key in stage_map] at all, I was just curious to see if there were > > any cleaner alter

Re: Python and Cyrillic characters in regular expression

2008-09-05 Thread MRAB
On Sep 5, 12:28 pm, phasma <[EMAIL PROTECTED]> wrote: > string = u"ðÒÉ×ÅÔ" All the characters are letters. > (u'\u041f\u0440\u0438\u0432\u0435\u0442',) > > string = u"Hi.ðÒÉ×ÅÔ" The third character isn't a letter and isn't whitespace. > (u'Hi',) > > On Sep 4, 9:53špm, Fredrik Lundh <[EMAIL PRO

Extract Information from Tables in html

2008-09-05 Thread Jackie Wang
Dear all, Here is a html code: Premier Community Bank of Southwest Florida Fort Myers, FL My question is how I can extract the strings and get the results: Premier Community Bank of Southwest Florida; Fort Myers, FL Thanks a lot Jackie -- http://mail.python.org/

Re: Case-insensitive string compare?

2008-09-05 Thread Maric Michaud
Le Friday 05 September 2008 16:00:39 J. Cliff Dyer, vous avez écrit : > Please keep the discussion on-list. > Sorry for the private email, I sent it again to the list.. > On Fri, 2008-09-05 at 15:36 +0200, Maric Michaud wrote: > > Le Friday 05 September 2008 14:33:22 J. Clifford Dyer, vous avez é

Re: Extract Information from Tables in html

2008-09-05 Thread Walter Cruz
On Fri, Sep 5, 2008 at 11:29 AM, Jackie Wang <[EMAIL PROTECTED]> wrote: > Dear all, > > Here is a html code: > > > > Premier Community Bank of Southwest Florida > > Fort Myers, FL > > > > My question is how I can extract the strings and get the results: > Premier Communit

Re: Python test case management system?

2008-09-05 Thread Mudcat
> What would the behaviour of such a system be? In other words, what is > a "test case management system" in terms of the things that it does? The feature set for one tends to vary. In short it's a front end app which is tied to a db that stores and organizes test cases. The system will allow you

Make Games

2008-09-05 Thread NightZombie
x-no-archive: yes I want to learn Python so I can make simple games. What are some good books that'll help me do this? -- http://mail.python.org/mailman/listinfo/python-list

hashing an array - howto

2008-09-05 Thread Helmut Jarausch
Hi, I need to hash arrays of integers (from the hash module). So, I have to derive from array and supply a __hash__ method. But how to hash an array (of fixed length, say 25)? What I need is a function which maps a tuple of 25 integers into 1 integer with good hashing properties. Does anybody k

Re: hashing an array - howto

2008-09-05 Thread Peter Otten
Helmut Jarausch wrote: > I need to hash arrays of integers (from the hash module). > > So, I have to derive from array and supply a __hash__ method. > But how to hash an array (of fixed length, say 25)? > What I need is a function which maps a tuple of 25 integers > into 1 integer with good hashi

Re: Make Games

2008-09-05 Thread Diez B. Roggisch
NightZombie schrieb: x-no-archive: yes I want to learn Python so I can make simple games. What are some good books that'll help me do this? Don't know about books, but I don't think it is important that the books are about python for game programming - game programming in general will help.

Re: Extract Information from Tables in html

2008-09-05 Thread Peter Pearson
On Fri, 5 Sep 2008 11:35:14 -0300, Walter Cruz <[EMAIL PROTECTED]> wrote: > On Fri, Sep 5, 2008 at 11:29 AM, Jackie Wang <[EMAIL PROTECTED]> wrote: >> Here is a html code: >> >> >> >> Premier Community Bank of Southwest Florida >> >> Fort Myers, FL >> >> >> >> My question

Re: Can anyone suggest a good crypto package?

2008-09-05 Thread Fett
On Sep 4, 8:04 pm, Paul Rubin wrote: > If you just want to authenticate the strings without confidentiality, > use the built-in HMAC module. But beware of replay attacks. I looked into this and it looks like I might be able to get by with this. I didn't find this functi

Re: PyGUI as a standard GUI API for Python?

2008-09-05 Thread Peter Decker
On Wed, Sep 3, 2008 at 11:57 AM, Diez B. Roggisch <[EMAIL PROTECTED]> wrote: > Michael Palmer schrieb: >> >> As anyone knows, the state of Python GUI programming is a little >> fractured at this time, with many toolkits, wrappers and meta-wrappers >> dead and alive, with or without documentation. >

Re: max(), sum(), next()

2008-09-05 Thread David C. Ullrich
In article <[EMAIL PROTECTED]>, Ken Starks <[EMAIL PROTECTED]> wrote: > David C. Ullrich wrote: > > > > > I don't see why you feel the two should act the same. > > At least in mathematics, the sum of the elements of > > the empty set _is_ 0, while the maximum element of the > > empty set is und

Re: hashing an array - howto

2008-09-05 Thread bearophileHUGS
Helmut Jarausch: > I need to hash arrays of integers (from the hash module). One of the possible solutions is to hash the equivalent tuple, but it requires some memory (your sequence must not be tuples already): assert not isinstance(somelist, tuple) hash(tuple(somelist)) This is an alternative

Re: Core dumped while interacting with OpenOffice.org via pyuno

2008-09-05 Thread Marco Bizzarri
On Fri, Sep 5, 2008 at 3:50 PM, Maric Michaud <[EMAIL PROTECTED]> wrote: > Le Friday 05 September 2008 15:04:22 Marco Bizzarri, vous avez écrit : >> Hi all. >> >> I'm experiencing a core dump while working in the following environment >> >> - debain etch >> - python2.3 >> - openoffice.org 2.4 >> -

Re: max(), sum(), next()

2008-09-05 Thread David C. Ullrich
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote: > David C. Ullrich: > > At least in mathematics, the sum of the elements of > > the empty set _is_ 0, while the maximum element of the > > empty set is undefined. > > What do you think about my idea of adding that 'default' argument to >

Re: Understanding the pythonic way: why a.x = 1 is better than a.setX(1) ?

2008-09-05 Thread Diez B. Roggisch
Ivan Illarionov schrieb: > On 4 сент, 21:49, Bruno Desthuilliers > <[EMAIL PROTECTED]> wrote: >> Ivan Illarionov a écrit : >> >> >> >>> On 4 сент, 22:59, Carl Banks <[EMAIL PROTECTED]> wrote: You can write code to guard against this if you want: class A: legal = set(["x"])

Retrieving the name of the class calling an instance method

2008-09-05 Thread mercado mercado
In Python, is it possible for an instance method to know the name of the class which is calling it? For example, in the sample below, I would like for the someMethod method to print the name of the class calling it ("bar" in the first case, "again" in the second). -

Re: max(), sum(), next()

2008-09-05 Thread bearophileHUGS
David C. Ullrich: > I didn't mention what's below because it doesn't seem > likely that saying max([]) = -infinity and > min([]) = +infinity is going to make the OP happy... Well, it sounds cute having Neginfinite and Infinite as built-int objects that can be compared to any other type and are < o

Re: [MacOS X] plat-mac/errors.rsrc.df.rsrc not installed/created

2008-09-05 Thread Christian Ebert
* Christian Ebert on Thursday, August 28, 2008: > I am on MacOS 10.4.11, and have a minor recurring problem, when > using my own Python installation. > > I only stumbled over it when using http operations with the > Mercurial SCM, and my /tmp/ folder was clobbered with *.rsrc > temporary files. >

Re: PyGUI as a standard GUI API for Python?

2008-09-05 Thread Diez B. Roggisch
Peter Decker schrieb: On Wed, Sep 3, 2008 at 11:57 AM, Diez B. Roggisch <[EMAIL PROTECTED]> wrote: Michael Palmer schrieb: As anyone knows, the state of Python GUI programming is a little fractured at this time, with many toolkits, wrappers and meta-wrappers dead and alive, with or without docu

Re: hashing an array - howto

2008-09-05 Thread Michael Palmer
On Sep 5, 11:18 am, [EMAIL PROTECTED] wrote: > Helmut Jarausch: > > > I need to hash arrays of integers (from the hash module). > > One of the possible solutions is to hash the equivalent tuple, but it > requires some memory (your sequence must not be tuples already): why can't it be tuple already

Re: Extract Information from Tables in html

2008-09-05 Thread Stefan Behnel
Hi, Jackie Wang wrote: > Here is a html code: > > > > Premier Community Bank of Southwest Florida > > Fort Myers, FL > > > > My question is how I can extract the strings and get the results: > Premier Community Bank of Southwest Florida; Fort Myers, FL Use lxml.h

Files application architecture

2008-09-05 Thread Benjamin Watine
Hi, I'm about to develop a small python application and I wonder how to organize files in this application. I'm familar to java, so I'm tempted to use the same convention : 1 file per class and 1 folders per package. I know that packages doesn't exists in python, they are modules instead. Ma

Re: PyGUI as a standard GUI API for Python?

2008-09-05 Thread Todd Whiteman
M.-A. Lemburg wrote: A long time ago, there was a Python plugin for Netscape which allowed you to run Python straight in the browser. Perhaps it's time to revive such an idea... but then you're still missing out on the GUI part, since you're still stuck with what the browser has to offer in terms

Re: Retrieving the name of the class calling an instance method

2008-09-05 Thread Maric Michaud
Le Friday 05 September 2008 17:29:39 mercado mercado, vous avez écrit : > In Python, is it possible for an instance method to know the name of the > class which is calling it? For example, in the sample below, I would like > for the someMethod method to print the name of the class calling it ("bar"

Re: Retrieving the name of the class calling an instance method

2008-09-05 Thread Emile van Sebille
mercado mercado wrote: In Python, is it possible for an instance method to know the name of the class which is calling it? Well, the class name is in __class__ so changing 'print x' to 'print __class__' will show foo in both cases, which is in fact the name of the class which is calling i

Re: Files application architecture

2008-09-05 Thread Diez B. Roggisch
Benjamin Watine schrieb: Hi, I'm about to develop a small python application and I wonder how to organize files in this application. I'm familar to java, so I'm tempted to use the same convention : 1 file per class and 1 folders per package. I know that packages doesn't exists in python, the

Re: hashing an array - howto

2008-09-05 Thread bearophileHUGS
Michael Palmer: > why can't it be tuple already? Because if the input list L has tuples and lists, they end having the same hash value: >>> L = [[1,2,3], (1,2,3)] >>> hash(tuple(L[0])), hash(tuple(L[1])) (-378539185, -378539185) But it's a not much common situation, and few hash collision pairs

Re: max(), sum(), next()

2008-09-05 Thread castironpi
On Sep 5, 3:28 am, "Manu Hack" <[EMAIL PROTECTED]> wrote: > On Thu, Sep 4, 2008 at 4:25 PM, castironpi <[EMAIL PROTECTED]> wrote: > > On Sep 4, 2:42 pm, [EMAIL PROTECTED] wrote: > >> David C. Ullrich: > > >> > At least in mathematics, the sum of the elements of > >> > the empty set _is_ 0, while th

Documentation (was Re: atomic section in code)

2008-09-05 Thread Fredrik Lundh
Michele Simionato wrote: The page you link here is WAYS better than the standard documentation of the threading module. Generally speaking, the effbot zone contains a lot of improvements over the standard docs which are lacking in various areas. I have always wondered why they are kept separated

Re: atomic section in code

2008-09-05 Thread Fredrik Lundh
Diez B. Roggisch wrote: AFAIC that kind of mutual exclusion is what atomicity is about. What else do you expect to happen? sounds like he wants/needs non-cooperative, mandatory locking. -- http://mail.python.org/mailman/listinfo/python-list

Re: Case-insensitive string compare?

2008-09-05 Thread Fredrik Lundh
Maric Michaud wrote: I suspect you are coming to conclusions a bit quickly, without taking the pain of understanding the whole discussion. I'm pretty sure I was the first one to post an answer in this thread, and I understand Python design and performance issues very well, thank you. (but g

Re: Python and Cyrillic characters in regular expression

2008-09-05 Thread Fredrik Lundh
phasma wrote: string = u"Привет" (u'\u041f\u0440\u0438\u0432\u0435\u0442',) string = u"Hi.Привет" (u'Hi',) the [\w\s] pattern you used matches letters, numbers, underscore, and whitespace. "." doesn't fall into that category, so the "match" method stops when it gets to that character. ma

Re: max(), sum(), next()

2008-09-05 Thread Mensanator
On Sep 5, 1:08 am, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On Thu, 4 Sep 2008 18:09:49 -0700 (PDT), Mensanator <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > > > Too bad. I brought this up because I use Python a lot with > > database work and rarely for proving theorms

Re: max(), sum(), next()

2008-09-05 Thread Ken Starks
David C. Ullrich wrote: In article <[EMAIL PROTECTED]>, Ken Starks <[EMAIL PROTECTED]> wrote: David C. Ullrich wrote: I don't see why you feel the two should act the same. At least in mathematics, the sum of the elements of the empty set _is_ 0, while the maximum element of the empty set is

Re: "Full" element tag listing possible with Elementtree?

2008-09-05 Thread jaime . dyson
On Sep 4, 11:43 pm, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > > >   this is node b > >   this is node c > >     > >     this is node e > >   > >   this is node f > > > > > I would want to print the following: > > > > > > > text: this is node b > > > >

Re: Make Games

2008-09-05 Thread David
NightZombie wrote: x-no-archive: yes I want to learn Python so I can make simple games. What are some good books that'll help me do this? -- http://mail.python.org/mailman/listinfo/python-list Good book you can get used; Python Programming for the Absolute Beginner http://books.google.com

sqlite3 import performance

2008-09-05 Thread Ben Lee
hi folks -- a quick python and sqlite3 performance question. i find that inserting a million rows of in-memory data into an in-memory database via a single executemany() is about 30% slower than using the sqlite3 CLI and the .import command (reading the same data from a disk file, even.) i find

Re: PyGUI as a standard GUI API for Python?

2008-09-05 Thread Peter Decker
On Fri, Sep 5, 2008 at 10:48 AM, Diez B. Roggisch <[EMAIL PROTECTED]> wrote: > You got me wrong. I didn't say it doesn't use the native toolkit under > various OSes, I'm well aware of that it does. > > What I *did* say was that wx API is designed primarily with windows' toolkit > as base, and as a

Re: xml + mmap cross

2008-09-05 Thread castironpi
On Sep 5, 12:13 am, Stefan Behnel <[EMAIL PROTECTED]> wrote: > Hi, > > this discussion seems pretty much off-topic for a Python list. > > > > castironpi wrote: > > In an XML file, entries are stored in serial, sort of like this. > > > AAA BBB CCC DDD > > > Or more recognizably, > > > somethingsomet

Re: pdb bug and questions

2008-09-05 Thread R. Bernstein
castironpi <[EMAIL PROTECTED]> writes: > On Sep 4, 4:22 pm, Stef Mientki <[EMAIL PROTECTED]> wrote: >> hello, >> >> I'm trying to embed a debugger into an editor. >> I'm only interested in high level debugging. >> The first question is what debugger is the best for my purpose ? >> (pdb, pydb, rpdb

Determining Processor Vender

2008-09-05 Thread aha
Dose anyone know of a cross-platform method for determining the vendor of a processor? Under linux I can check /proc/cpuinfo. What I'd like to be able to do is determine if a processor is AMD or Intel, so that I can use the appropriate numerical libraries for my application. Regards, Aquil -- h

Re: Determining Processor Vender

2008-09-05 Thread aha
On Sep 5, 3:00 pm, aha <[EMAIL PROTECTED]> wrote: > Dose anyone know of a cross-platform method for determining the vendor > of a processor?  Under linux I can check /proc/cpuinfo.  What I'd like > to be able to do is determine if a processor is AMD or Intel, so that > I can use the appropriate num

Re: pdb bug and questions

2008-09-05 Thread R. Bernstein
Stef Mientki <[EMAIL PROTECTED]> writes: > hello, > > I'm trying to embed a debugger into an editor. > I'm only interested in high level debugging. > The first question is what debugger is the best for my purpose ? > (pdb, pydb, rpdb2, smart debugger, extended debugger ? > > Second question, in no

Re: "Full" element tag listing possible with Elementtree?

2008-09-05 Thread Carl Banks
On Sep 5, 2:27 am, [EMAIL PROTECTED] wrote: > So, for example, if I had a document that looked like this: > > >this is node b >this is node c > > this is node e > >this is node f > > > I would want to print the following: > > > > text: this is node b > > text:

Need formatting suggestion for long strings

2008-09-05 Thread Robert Dailey
Hi, I find quite often that I'm writing things like this: raise FatalExcept( "Insufficient number of arguments specified. Exactly {0} arguments are required. See stage.bat for documentation on accepted parameters.".format( num_arguments ) ) On my display (Vertical monitor), this exceeds the widt

Re: use str as variable name

2008-09-05 Thread Marco Bizzarri
On Thu, Sep 4, 2008 at 10:47 AM, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > > (...as Bruno implies, setattr(), len() et al can be and should be viewed as > generic functions. Just a question: "generic functions" are not meant in the sense of "generic functions" of CLOS, am I right? -- Marco Biz

[PIL] quake like multicoloured text

2008-09-05 Thread Durand
I'm wondering how I could render text with PIL in which different parts of the text are different characters. This is for a game stats script where names are written like: ^1Red ^2Green ^3Yellow, etc. The problem is that I currently use text in the ImageDraw module but the only way I can think of r

Re: Need formatting suggestion for long strings

2008-09-05 Thread Jean-Paul Calderone
On Fri, 5 Sep 2008 14:24:16 -0500, Robert Dailey <[EMAIL PROTECTED]> wrote: Hi, I find quite often that I'm writing things like this: raise FatalExcept( "Insufficient number of arguments specified. Exactly {0} arguments are required. See stage.bat for documentation on accepted parameters.".form

Re: quake like multicoloured text

2008-09-05 Thread Durand
Oops, I meant, "I'm wondering how I could render text with PIL in which different parts of the text are different *colours*." -- http://mail.python.org/mailman/listinfo/python-list

Re: pdb bug and questions

2008-09-05 Thread Stef Mientki
R. Bernstein wrote: Stef Mientki <[EMAIL PROTECTED]> writes: hello, I'm trying to embed a debugger into an editor. I'm only interested in high level debugging. The first question is what debugger is the best for my purpose ? (pdb, pydb, rpdb2, smart debugger, extended debugger ? Second que

Re: Need formatting suggestion for long strings

2008-09-05 Thread aha
On Sep 5, 3:29 pm, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: > On Fri, 5 Sep 2008 14:24:16 -0500, Robert Dailey <[EMAIL PROTECTED]> wrote: > >Hi, > > >I find quite often that I'm writing things like this: > > >raise FatalExcept( "Insufficient number of arguments specified. Exactly {0} > >argum

Re: Need formatting suggestion for long strings

2008-09-05 Thread Robert Dailey
On Fri, Sep 5, 2008 at 2:29 PM, Jean-Paul Calderone <[EMAIL PROTECTED]>wrote: > mystring = ( > "This is a very long string that " > "spans multiple lines and does " > "not include line breaks or tabs " > "from the source file between " > "the strings partitions.") At first glance it lo

  1   2   >