Re: ['a', 'b'][True] results 'b' But how?

2007-07-05 Thread Kelvie Wong
In this case, [True] and [False] are not lists, rather you're accessing the items of the list with the index True or False, as per the following example: >>> a_list = ['a', 'b'] >>> a_list[True] 'b' >>> a_list[False] 'a' This happens because the __getitem__ method takes its argument (which in thi

Re: ['a', 'b'][True] results 'b' But how?

2007-07-05 Thread Robert Bauck Hamar
kath wrote: > Hi, > > Can any one please tell me how is the following code is working? > ['a','b'] is a list of string Yes. > and [True] is list of boolean value. No. It's the subscription operator applied to the list of strings. a = ['a', 'b'] a[True] may be clearer. > How is it making effe

Re: ['a', 'b'][True] results 'b' But how?

2007-07-05 Thread rishi pathak
True stands for 1 and False stands for 0 so list[True] is equivalent to list[1] and list[False] is equivalent to list[0] On 7/5/07, kath <[EMAIL PROTECTED]> wrote: Hi, Can any one please tell me how is the following code is working? ['a','b'] is a list of string, and [True] is list of boolean

Re: [True] results 'b' But how?

2007-07-05 Thread kath
Hi Kelvie and RBH, Thanks for your quick reply. That was very much helpful indeed. regards, kath. -- http://mail.python.org/mailman/listinfo/python-list

Re: PyRun_String using my module in a def

2007-07-05 Thread Gabriel Genellina
En Thu, 05 Jul 2007 01:19:32 -0300, Stuart <[EMAIL PROTECTED]> escribió: > What command do you mean when you say "update main_dict with > dlfl_dict"? I think Alex Martelly was refering to use main_dict.update(dlfl_dict) (Python code) or PyDict_Update(main_dict, dlfl_dict) (in C code). > I tr

Problem with building extension in Python

2007-07-05 Thread vedrandekovic
Hi, I have already install Microsoft visual studio .NET 2003 and MinGw, when I try to build a extension: python my_extension_setup.py build ( or install ) , I get an error: LINK : fatal error LNK1141: failure during build of exports file error: command '"C:\Program Files\Microsoft Visual Studio

Re: Memory leak issue with complex data structure

2007-07-05 Thread Hrvoje Niksic
Alan Franzoni <[EMAIL PROTECTED]> writes: > I have a serious "leak" issue; even though I clear all those sets > and I delete all the references I can have to the current namespace, > memory is not freed. Maybe the memory is freed (marked as available for further use by Python), just not released

Re: import mysteries

2007-07-05 Thread Peter Otten
David Abrahams wrote: > > on Wed Jul 04 2007, Peter Otten <__peter__-AT-web.de> wrote: > Explicitly passed, see >> http://genshi.edgewall.org/browser/trunk/genshi/filters/tests/transform.py >>> >>> IIRC I ran doctest on the file I cited, not the one you're pointing >>> at. Is th

Re: MethodType/FunctionType and decorators

2007-07-05 Thread Michele Simionato
On Jul 5, 3:41 am, [EMAIL PROTECTED] (Alex Martelli) wrote: > Alex already explained everything beautifully. I will just add a link to the definite guide to descriptors: http://users.rcn.com/python/download/Descriptor.htm Michele Simionato (who spent lot of brain cycles studying descriptors *

Re: Problem with building extension in Python

2007-07-05 Thread Gabriel Genellina
En Thu, 05 Jul 2007 05:08:58 -0300, <[EMAIL PROTECTED]> escribió: > I have already install Microsoft visual studio .NET 2003 and MinGw, > when I try to build a extension: Is this for Python 2.4? I think you can't compile Python 2.5 with VS2003. > python my_extension_setup.py build ( or install

Re: Tkinter toggle a Label Widget based on checkbutton value

2007-07-05 Thread Eric Brunel
On Wed, 04 Jul 2007 21:51:34 +0200, O.R.Senthil Kumaran <[EMAIL PROTECTED]> wrote: > Following is a tk code, which will display a checkbutton, and when > checkbox is > enabled, it will show the below present Label. > > What I was trying is, when checkbox is enabled the Label should be shown >

Re: PEP 3107 and stronger typing (note: probably a newbie question)

2007-07-05 Thread Nis Jørgensen
Bruno Desthuilliers skrev: > Paul Rubin a écrit : >> Bruno Desthuilliers <[EMAIL PROTECTED]> writes: >> >>> Haskell - as other languages using type-inference like OCaml - are in >>> a different category. Yes, I know, don't say it, they are statically >>> typed - but it's mostly structural typing, n

Re: Find This Module

2007-07-05 Thread Peter Otten
[EMAIL PROTECTED] wrote: > I'm looking at the source for the module sre_compile.py and it does > this import: > > import _sre > > But I can't find a file related to _sre anywhere. Where is it? If you want the source code, have a look at http://svn.python.org/view/python/trunk/Modules/_sre.c

Re: what is wrong with that r"\"

2007-07-05 Thread Nick Craig-Wood
Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > On Wed, 04 Jul 2007 11:21:14 +, Neil Cerutti wrote: > > > If the escaped quotes didn't function in raw strings, I'd be > > unable to construct (with a single notation) a regex that > > included both kinds of quotes at once. > > > > re.c

Re: Problem with building extension in Python

2007-07-05 Thread Stefan Behnel
[EMAIL PROTECTED] wrote: > I have already install Microsoft visual studio .NET 2003 and MinGw, > when I try to build a extension: > > python my_extension_setup.py build ( or install ) , I get an error: > > LINK : fatal error LNK1141: failure during build of exports file > error: command '"C:\Prog

Re: Proposal: s1.intersects(s2)

2007-07-05 Thread Nis Jørgensen
Steven D'Aprano skrev: > On Wed, 04 Jul 2007 23:53:15 -0400, David Abrahams wrote: > >> on Wed Jul 04 2007, "Steven D'Aprano" >> wrote: >> >>> On Wed, 04 Jul 2007 14:37:34 +, Marc 'BlackJack' Rintsch wrote: >>> On Wed, 04 Jul 2007 09:59:24 -0400, David Abrahams wrote: > Here's

Python daemon in Linux

2007-07-05 Thread [EMAIL PROTECTED]
i made MyThread(Thread) when isDaemon() == 0: everything works when isDaemon() == 1: nothing works why??? -- http://mail.python.org/mailman/listinfo/python-list

WXPYTHON push button call a frame

2007-07-05 Thread Marcpp
Hi I need to call a widget from a button in WXPYTHON. I've tried to this from a function like this, but when push the button, the program opens a window and do error. Any idea? . def DialogRRHH(self,event): prog = wx.PySimpleApp(0) wx.InitAllImageHandlers() DialogRR

Re: MethodType/FunctionType and decorators

2007-07-05 Thread Alex Popescu
On Jul 5, 11:17 am, Michele Simionato <[EMAIL PROTECTED]> wrote: > On Jul 5, 3:41 am, [EMAIL PROTECTED] (Alex Martelli) wrote: > > > > > Alex already explained everything beautifully. I will just add a link > to > the definite guide to > descriptors:http://users.rcn.com/python/download/Descriptor

Re: The best platform and editor for Python

2007-07-05 Thread kimiraikkonen
Thanks for the links and replies, taking care. My another aim is: Can i develop graphical applications (like in Windows) which contain menus, interactive dialog boxes etc. using Ptyhon? I got it quite but not sure. I don't know Ptyhon's capability skills for creating interactive softwares like in

Re: Building a Python app with Mozilla

2007-07-05 Thread Stefan Sonnenberg-Carstens
On Do, 5.07.2007, 03:45, greg wrote: > [EMAIL PROTECTED] wrote: > >> wxWidgets will give you native looking apps on both Linux and Windows > > Well, maybe. There's more to getting a native feel than > just using the right widgets. I once saw a Qt-based app on > MacOSX that had tiny little buttons t

Re: The best platform and editor for Python

2007-07-05 Thread Kay Schluehr
On Jul 3, 8:12 pm, [EMAIL PROTECTED] (Cameron Laird) wrote: > Python is simply easier than C++; you might > well find that a debugger, for example, doesn't feel as essential > as it is for you with C++. That's what I love most about the Python community. Whenever there is just a non-standard, pla

Re: Python daemon in Linux

2007-07-05 Thread [EMAIL PROTECTED]
As far as I understand the issue, any Python process has a sort of "main" thread. When the main thread exits, the Python process will exit if there are only daemon threads around. If there are any non-daemon threads, the Python process will only exit after those threads are finished. Or, as the doc

Re: Python daemon in Linux

2007-07-05 Thread [EMAIL PROTECTED]
thanx benjamin ) no more questions -- http://mail.python.org/mailman/listinfo/python-list

Re: The best platform and editor for Python

2007-07-05 Thread Gregor Horvath
kimiraikkonen schrieb: > My another aim is: Can i develop graphical applications (like in > Windows) which contain menus, interactive dialog boxes etc. using > Ptyhon? > > I got it quite but not sure. I don't know Ptyhon's capability skills > for creating interactive softwares like in Windows's c

Re: The best platform and editor for Python

2007-07-05 Thread Gregor Horvath
Kay Schluehr schrieb: > That's what I love most about the Python community. Whenever there is > just a non-standard, platform-dependent or crappy implementation of a > feature you get told that you don't need it. When printf was good for > little David print is good enough for me. > That's a pro

(EMBEDDING) Can't get python error message

2007-07-05 Thread anonymisiert85
I run this string to produce a error "x+1" PyRun_SimpleStringFlags() return -1, so that i know this is a script with error inside... but now - how can i get error message? i tested some py-functions - but this functions do not work... i called this functions direct after PyRun_SimpleStringFlags

Re: Reversing a string

2007-07-05 Thread Sion Arrowsmith
Jan Vorwerk <[EMAIL PROTECTED]> wrote: > [ lots of sensible stuff to discover "reversed" ] > >>> print reversed.__doc__ See also: >>> help(reversed) -- \S -- [EMAIL PROTECTED] -- http://www.chaos.org.uk/~sion/ "Frankly I have no feelings towards penguins one way or the other" -- Arth

Chat programs

2007-07-05 Thread HangZhou Monty Boy
I'd like to think of building a chat program, could you advise me if python is good enough for people to get all of my source code ? Thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: The best platform and editor for Python

2007-07-05 Thread Thomas Heller
QOTW? Gregor Horvath schrieb: > That's a property of open source projects. > Features nobody really needs are not implemented. > > Gregor -- http://mail.python.org/mailman/listinfo/python-list

Re: MethodType/FunctionType and decorators

2007-07-05 Thread Steve Holden
Alex Popescu wrote: > On Jul 5, 11:17 am, Michele Simionato <[EMAIL PROTECTED]> > wrote: >> On Jul 5, 3:41 am, [EMAIL PROTECTED] (Alex Martelli) wrote: >> >>> >> Alex already explained everything beautifully. I will just add a link >> to >> the definite guide to >> descriptors:http://users.rcn.co

Re: WXPYTHON push button call a frame

2007-07-05 Thread Steve Holden
Marcpp wrote: > Hi I need to call a widget from a button in WXPYTHON. I've tried to > this from a function like this, but when push the button, the program > opens a window and do error. > Any idea? > Well, one *really* good idea would be to copy the error message and paste it into your message.

Re: MethodType/FunctionType and decorators

2007-07-05 Thread Alex Popescu
On Jul 5, 3:32 pm, Steve Holden <[EMAIL PROTECTED]> wrote: > Alex Popescu wrote: > > On Jul 5, 11:17 am, Michele Simionato <[EMAIL PROTECTED]> > > wrote: > >> On Jul 5, 3:41 am, [EMAIL PROTECTED] (Alex Martelli) wrote: > > >>> > >> Alex already explained everything beautifully. I will just add a l

Re: MethodType/FunctionType and decorators

2007-07-05 Thread Michele Simionato
On Jul 5, 11:16 am, Alex Popescu <[EMAIL PROTECTED]> wrote: > Guys, I appreciate a lot your help and explanations. It looks like I > have to read/play a bit more as some of the terms/ideas are pretty new > to me (coming to Python with a 10 years Java bag, and only with a > small dynlang bag - Ruby,

Re: PEP 3107 and stronger typing (note: probably a newbie question)

2007-07-05 Thread Steve Holden
Paul Rubin wrote: > John Nagle <[EMAIL PROTECTED]> writes: >> This has been tried. Original K&R C had non-enforced static typing. >> All "struct" pointers were equivalent. It wasn't pretty. >> >> It takes strict programmer discipline to make non-enforced static >> typing work. I've see

RE: PEP 3107 and stronger typing (note: probably a newbie question)

2007-07-05 Thread Hamilton, William
> From: Paul Rubin > > greg <[EMAIL PROTECTED]> writes: > > > E.g. your program might pass its test and run properly for years > > > before some weird piece of input data causes some regexp to not quite > > > work. > > > > Then you get a bug report, you fix it, and you add a test > > for it so tha

Re: Building a Python app with Mozilla

2007-07-05 Thread Shane Geiger
Brett Cannon was doing some work with the Firefox security model to allow Python coding from within Firefox. He may have stopped doing the work because it would not lead to a PhD. I am really looking forward to seeing someone making this a possibility. Stefan Sonnenberg-Carstens wrote: > On Do

Re-raising exceptions with modified message

2007-07-05 Thread Christoph Zwerschke
What is the best way to re-raise any exception with a message supplemented with additional information (e.g. line number in a template)? Let's say for simplicity I just want to add "sorry" to every exception message. My naive solution was this: try: ... except Exception, e: raise e.__

Re: The best platform and editor for Python

2007-07-05 Thread Roy Smith
In article <[EMAIL PROTECTED]>, Nicola Musatti <[EMAIL PROTECTED]> wrote: > On Jul 5, 1:23 pm, Gregor Horvath <[EMAIL PROTECTED]> wrote: > [...] > > That's a property of open source projects. > > Features nobody really needs are not implemented. > > No, no, you got it all wrong. It's in *commerc

Re: The best platform and editor for Python

2007-07-05 Thread Nicola Musatti
On Jul 5, 1:23 pm, Gregor Horvath <[EMAIL PROTECTED]> wrote: [...] > That's a property of open source projects. > Features nobody really needs are not implemented. No, no, you got it all wrong. It's in *commercial* projects that features nobody really needs are not implemented. Profit is fundament

Re: IDEs for COM scripting: C# v. Python v. Iron Python v. JPython

2007-07-05 Thread Siegfried Heintze
Can someone suggest some criterion for selecting Python, JPython or Iron Python for COM Scripting? I have not looked: I assume there are multiple eclipse plugins for Python/JPython/Iron Python. Could someone recommend one? I'll also try out eric that was mentioned previously. I figured out my

Re: MethodType/FunctionType and decorators

2007-07-05 Thread Michele Simionato
On Jul 5, 3:17 pm, Alex Popescu <[EMAIL PROTECTED]> wrote: > The true story is that > while working on Groovy (I am a committer on this dynlang meant to run > on the Java VM:http://groovy.codehaus.org) and reading some Python > materials, my interest grew exponentially. And now I have decided to >

Re: WXPYTHON push button call a frame

2007-07-05 Thread Marcpp
On 5 jul, 14:51, Steve Holden <[EMAIL PROTECTED]> wrote: > Marcpp wrote: > > Hi I need to call a widget from a button in WXPYTHON. I've tried to > > this from a function like this, but when push the button, the program > > opens a window and do error. > > Any idea? > > Well, one *really* good idea

Re: Re-raising exceptions with modified message

2007-07-05 Thread Thomas Heller
Christoph Zwerschke schrieb: > What is the best way to re-raise any exception with a message > supplemented with additional information (e.g. line number in a > template)? I have the impression that you do NOT want to change the exceptions, instead you want to print the traceback in a customized

Re: The best platform and editor for Python

2007-07-05 Thread [EMAIL PROTECTED]
Kay Schluehr wrote: > On Jul 3, 8:12 pm, [EMAIL PROTECTED] (Cameron Laird) wrote: > > > Python is simply easier than C++; you might > > well find that a debugger, for example, doesn't feel as essential > > as it is for you with C++. > > That's what I love most about the Python community. Whenever t

Re: Re-raising exceptions with modified message

2007-07-05 Thread Christoph Zwerschke
Thomas Heller wrote: > I have the impression that you do NOT want to change the exceptions, > instead you want to print the traceback in a customized way. But I may be > wrong... No, I really want to modify the exception, supplementing its message with additional information about the state of

Re: Proposal: s1.intersects(s2)

2007-07-05 Thread Aahz
In article <[EMAIL PROTECTED]>, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > >My main feeling is that any such function should be a set method rather >than a built-in function like len(). The name change was comparatively >unimportant. Look up at the Subject: line. There never was any suggestion

Re: The best platform and editor for Python

2007-07-05 Thread Paul McGuire
On Jul 5, 9:21 am, Roy Smith <[EMAIL PROTECTED]> wrote: > In article <[EMAIL PROTECTED]>, > Nicola Musatti <[EMAIL PROTECTED]> wrote: > > > On Jul 5, 1:23 pm, Gregor Horvath <[EMAIL PROTECTED]> wrote: > > [...] > > > That's a property of open source projects. > > > Features nobody really needs are

Re: Re-raising exceptions with modified message

2007-07-05 Thread Neil Cerutti
On 2007-07-05, Christoph Zwerschke <[EMAIL PROTECTED]> wrote: > Thomas Heller wrote: >> I have the impression that you do NOT want to change the >> exceptions, instead you want to print the traceback in a >> customized way. But I may be wrong... > > No, I really want to modify the exception, suppl

Re: The best platform and editor for Python

2007-07-05 Thread Neil Cerutti
On 2007-07-05, Paul McGuire <[EMAIL PROTECTED]> wrote: > On Jul 5, 9:21 am, Roy Smith <[EMAIL PROTECTED]> wrote: >> In article <[EMAIL PROTECTED]>, >> Nicola Musatti <[EMAIL PROTECTED]> wrote: >> >> > On Jul 5, 1:23 pm, Gregor Horvath <[EMAIL PROTECTED]> wrote: >> > [...] >> > > That's a property

Re: The best platform and editor for Python

2007-07-05 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Kay Schluehr <[EMAIL PROTECTED]> wrote: >On Jul 3, 8:12 pm, [EMAIL PROTECTED] (Cameron Laird) wrote: > >> Python is simply easier than C++; you might >> well find that a debugger, for example, doesn't feel as essential >> as it is for you with C++. > >That's what I

Re: Building a Python app with Mozilla

2007-07-05 Thread [EMAIL PROTECTED]
greg wrote: > [EMAIL PROTECTED] wrote: > > > wxWidgets will give you native looking apps on both Linux and Windows > > Well, maybe. There's more to getting a native feel than > just using the right widgets. I once saw a Qt-based app on > MacOSX that had tiny little buttons that were too small > for

Re: The best platform and editor for Python

2007-07-05 Thread Kay Schluehr
On Jul 5, 4:08 pm, Nicola Musatti <[EMAIL PROTECTED]> wrote: > On Jul 5, 1:23 pm, Gregor Horvath <[EMAIL PROTECTED]> wrote: > [...] > > > That's a property of open source projects. > > Features nobody really needs are not implemented. > > No, no, you got it all wrong. It's in *commercial* projects

Re: WXPYTHON push button call a frame

2007-07-05 Thread kyosohma
On Jul 5, 9:04 am, Marcpp <[EMAIL PROTECTED]> wrote: > On 5 jul, 14:51, Steve Holden <[EMAIL PROTECTED]> wrote: > > > > > Marcpp wrote: > > > Hi I need to call a widget from a button in WXPYTHON. I've tried to > > > this from a function like this, but when push the button, the program > > > opens a

Re: PyRun_String using my module in a def

2007-07-05 Thread Alex Martelli
Gabriel Genellina <[EMAIL PROTECTED]> wrote: > En Thu, 05 Jul 2007 01:19:32 -0300, Stuart <[EMAIL PROTECTED]> > escribió: > > > What command do you mean when you say "update main_dict with > > dlfl_dict"? > > I think Alex Martelly was refering to use main_dict.update(dlfl_dict) > (Python code)

Re: The best platform and editor for Python

2007-07-05 Thread Nicola Musatti
On Jul 5, 4:21 pm, Roy Smith <[EMAIL PROTECTED]> wrote: > In article <[EMAIL PROTECTED]>, > Nicola Musatti <[EMAIL PROTECTED]> wrote: > > > On Jul 5, 1:23 pm, Gregor Horvath <[EMAIL PROTECTED]> wrote: > > [...] > > > That's a property of open source projects. > > > Features nobody really needs are

Re: list.append not working?

2007-07-05 Thread Hardy
On 5 Jul., 18:07, infidel <[EMAIL PROTECTED]> wrote: > On Jul 5, 8:58 am, Hardy <[EMAIL PROTECTED]> wrote: > > > > > I experience a problem with append(). This is a part of my code: > > > for entity in temp: > > md['module']= entity.addr.get('module') > > md['id']=en

Re: list.append not working?

2007-07-05 Thread infidel
On Jul 5, 8:58 am, Hardy <[EMAIL PROTECTED]> wrote: > I experience a problem with append(). This is a part of my code: > > for entity in temp: > md['module']= entity.addr.get('module') > md['id']=entity.addr.get('id') > md['type']=entity.addr.get('type')

Re: How can i change an Object type ?

2007-07-05 Thread KuhlmannSascha
On Jul 4, 12:14 pm, [EMAIL PROTECTED] wrote: > On Jul 4, 12:40 am, Tim Roberts <[EMAIL PROTECTED]> wrote: > > > > > KuhlmannSascha <[EMAIL PROTECTED]> wrote: > > > >i tried now for several hours to read through a win32com API to access > > >Itunes and read out myplaylists. > > > >First of all the C

list.append not working?

2007-07-05 Thread Hardy
I experience a problem with append(). This is a part of my code: for entity in temp: md['module']= entity.addr.get('module') md['id']=entity.addr.get('id') md['type']=entity.addr.get('type') #print md mbusentities.append(md)

Re: list.append not working?

2007-07-05 Thread 7stud
Hardy wrote: > I experience a problem with append(). This is a part of my code: > > for entity in temp: > md['module']= entity.addr.get('module') > md['id']=entity.addr.get('id') > md['type']=entity.addr.get('type') > #print md >

Re: Chat programs

2007-07-05 Thread Thomas Jollans
On Thursday 05 July 2007, HangZhou Monty Boy wrote: > I'd like to think of building a chat program, could you advise me if > python is good enough for people to get all of my source code ? I'm not sure what the language you use has to do with how people acquire your source code, but (remember: th

Re: Proposal: s1.intersects(s2)

2007-07-05 Thread Steven D'Aprano
On Thu, 05 Jul 2007 07:34:28 -0700, Aahz wrote: > In article <[EMAIL PROTECTED]>, > Steven D'Aprano <[EMAIL PROTECTED]> wrote: >> >>My main feeling is that any such function should be a set method rather >>than a built-in function like len(). The name change was comparatively >>unimportant. > >

Re: Where is the syntax for the dict() constructor ?!

2007-07-05 Thread Chris Mellon
On 7/5/07, Captain Poutine <[EMAIL PROTECTED]> wrote: > I'm simply trying to read a CSV into a dictionary. > > (if it matters, it's ZIP codes and time zones, i.e., > 35983,CT > 39161,CT > 47240,EST > > > > Apparently the way to do this is: > > import csv > > dictZipZones = {} > > reader = csv.reade

Re: Python's "only one way to do it" philosophy isn't good?

2007-07-05 Thread Chris Mellon
On 7/2/07, Douglas Alan <[EMAIL PROTECTED]> wrote: > Lenard Lindstrom <[EMAIL PROTECTED]> writes: > > If they are simply a performance tweak then it's not an issue *. I > > was just concerned that the calls were necessary to keep resources > > from being exhausted. > > Well, if you catch an excepti

Re: list.append not working?

2007-07-05 Thread Abhishek Jain
with every iteration your previous values are overwritten ('md' is a dictionary) so thats why your are observing this ouput.. check if the following patch solves your problem for entity in temp: md['module']= entity.addr.get('module') md['id']=entity.addr.get('id')

Where is the syntax for the dict() constructor ?!

2007-07-05 Thread Captain Poutine
I'm simply trying to read a CSV into a dictionary. (if it matters, it's ZIP codes and time zones, i.e., 35983,CT 39161,CT 47240,EST Apparently the way to do this is: import csv dictZipZones = {} reader = csv.reader(open("some.csv", "rb")) for row in reader: # Add the row to the dictiona

Re: The best platform and editor for Python

2007-07-05 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Gregor Horvath <[EMAIL PROTECTED]> wrote: >kimiraikkonen schrieb: > >> My another aim is: Can i develop graphical applications (like in >> Windows) which contain menus, interactive dialog boxes etc. using >> Ptyhon? >> >> I got it quite but not sure. I don't know P

Re: disappearing documentation of `coerce`

2007-07-05 Thread Alan Isaac
> On 2007-07-05, Alan Isaac <[EMAIL PROTECTED]> wrote: >>Once upon a time, `coerce` was documented >>with the other built-ins. Neil Cerutti wrote: > It's now documented in Library Reference 2.2 Non-essential > Built-in Functions. > Apparently it is no longer needed or useful, but only kept for >

Re: Proposal: s1.intersects(s2)

2007-07-05 Thread Steven D'Aprano
On Thu, 05 Jul 2007 01:48:58 +, richyjsm wrote: > On Jul 4, 8:14 pm, Steven D'Aprano > <[EMAIL PROTECTED]> wrote: >> However, there's a very subtle flaw in the idea. While "the intersection" >> of two sets is well-defined, "these two sets intersect" is (surprisingly!) >> _not_ well-defined. >

Re: login http://cheeseshop.python.org/pypi broken ?

2007-07-05 Thread gert
On Jul 5, 8:30 am, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > gert schrieb: > > > tried reseting password but i can not login anymore to upload my new > > source code ? > > Please try again. It was a misconfiguration which should be fixed now. > > Regards, > Martin thank you, it works. -- ht

Re: The best platform and editor for Python

2007-07-05 Thread kimiraikkonen
I just wanted a simple answer to my simple question, however topic has messed up. Think questioner as a beginner and use more understandable terms to help :) Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: Proposal: s1.intersects(s2)

2007-07-05 Thread OKB (not okblacke)
Steven D'Aprano wrote: > Just because I've never come across it doesn't mean it exists, so > I'd be grateful for any reference to a technical definition, or > even references to any mathematician using intersect as a verb in a > vigorous, non-hand-waving way. Here's a link to get you started:

Re: The best platform and editor for Python

2007-07-05 Thread Mark Morss
On Jul 1, 3:30 pm, "Sönmez Kartal" <[EMAIL PROTECTED]> wrote: "Emacs is the best for anything for me." Me too. Also, as pointed out by some others, a debugger is not really all that necessary for an interpreted language like Python. > > Hi, > > For experienced with Pyhton users, which developing

deliberate versus os socket timeout

2007-07-05 Thread Robin Becker
While messing about with some deliberate socket timeout code I got an unexpected timeout after 20 seconds when my code was doing socket.setdefaulttimeout(120). Closer inspection revealed that this error in fact seemed to come from the os (in this case windows xp). By inspection of test cases t

Re: Where is the syntax for the dict() constructor ?!

2007-07-05 Thread Neil Cerutti
On 2007-07-05, Captain Poutine <[EMAIL PROTECTED]> wrote: > I'm simply trying to read a CSV into a dictionary. > > (if it matters, it's ZIP codes and time zones, i.e., > 35983,CT > 39161,CT > 47240,EST > > > > Apparently the way to do this is: > > import csv > > dictZipZones = {} > > reader = csv.r

need help with converting c function to python function

2007-07-05 Thread nephish
hello all, i have a c function from some modbus documentation that i need to translate into python. it looks like this: unsigned short CRC16(puchMsg, usDataLen) unsigned char *puchMsg ; unsigned short usDataLen ; { unsigned char uchCRCHi = 0xFF ; unsigned char uchCRCLo = 0xFF ; unsigne

Re: WXPYTHON push button call a frame

2007-07-05 Thread Roel Schroeven
Marcpp schreef: > Hi I need to call a widget from a button in WXPYTHON. I've tried to > this from a function like this, but when push the button, the program > opens a window and do error. > Any idea? > > . > def DialogRRHH(self,event): > prog = wx.PySimpleApp(0) > wx.InitA

Re: Where is the syntax for the dict() constructor ?!

2007-07-05 Thread Peter Otten
Neil Cerutti wrote: > On 2007-07-05, Captain Poutine <[EMAIL PROTECTED]> wrote: >> I'm simply trying to read a CSV into a dictionary. >> >> (if it matters, it's ZIP codes and time zones, i.e., >> 35983,CT >> 39161,CT >> 47240,EST >> >> >> >> Apparently the way to do this is: >> >> import csv >> >>

Re: Where is the syntax for the dict() constructor ?!

2007-07-05 Thread Captain Poutine
Neil Cerutti wrote: > On 2007-07-05, Captain Poutine <[EMAIL PROTECTED]> wrote: >> I'm simply trying to read a CSV into a dictionary. >> >> (if it matters, it's ZIP codes and time zones, i.e., >> 35983,CT >> 39161,CT >> 47240,EST >> >> >> >> Apparently the way to do this is: >> >> import csv >> >>

Re: Re-raising exceptions with modified message

2007-07-05 Thread Christoph Zwerschke
Neil Cerutti wrote: > The documentation for BaseException contains something that might > be relevant: > >[...] If more data needs to be attached to the exception, >attach it through arbitrary attributes on the instance. All > > Users could get at the extra info you attached, but it wouldn

Re: Python's "only one way to do it" philosophy isn't good?

2007-07-05 Thread Falcolas
On Jul 5, 10:30 am, "Chris Mellon" <[EMAIL PROTECTED]> wrote: > > I don't think anyone has suggested that. Let me be clear about *my* > position: When you need to ensure that a file has been closed by a > certain time, you need to be explicit about it. When you don't care, > just that it will be cl

Re: Where is the syntax for the dict() constructor ?!

2007-07-05 Thread Captain Poutine
Peter Otten wrote: > Neil Cerutti wrote: > >> On 2007-07-05, Captain Poutine <[EMAIL PROTECTED]> wrote: >>> I'm simply trying to read a CSV into a dictionary. >>> >>> (if it matters, it's ZIP codes and time zones, i.e., >>> 35983,CT >>> 39161,CT >>> 47240,EST >>> >>> >>> >>> Apparently the way to

SMTP server w/o using Twisted framework

2007-07-05 Thread _spitFIRE
Is it possible to run a SMTP server that sends mail to recipients using standard libraries, without using twisted framework, and also without using any relay server? -- http://mail.python.org/mailman/listinfo/python-list

Re: Where is the syntax for the dict() constructor ?!

2007-07-05 Thread Thomas Jollans
On Thursday 05 July 2007, Captain Poutine wrote: > Peter Otten wrote: > > Neil Cerutti wrote: > >> On 2007-07-05, Captain Poutine <[EMAIL PROTECTED]> wrote: > >>> I'm simply trying to read a CSV into a dictionary. > >>> > >>> (if it matters, it's ZIP codes and time zones, i.e., > >>> 35983,CT > >>>

Re: SMTP server w/o using Twisted framework

2007-07-05 Thread Jeff McNeil
If you just want to send mail, you should be able to use the standard smtplib module (http://docs.python.org/lib/module-smtplib.html). If your recipients are on the Internet, you would need to handle MX resolution yourself. I know you said you want to avoid a relay server, but it's probably the be

Re: SMTP server w/o using Twisted framework

2007-07-05 Thread _spitFIRE
On Jul 5, 1:34 pm, "Jeff McNeil" <[EMAIL PROTECTED]> wrote: > If you just want to send mail, you should be able to use the standard > smtplib module (http://docs.python.org/lib/module-smtplib.html). If > your recipients are on the Internet, you would need to handle MX > resolution yourself. > How

Re: Shed Skin Python-to-C++ Compiler 0.0.21, Help needed

2007-07-05 Thread Klaas
On Jun 29, 3:48 am, "Mark Dufour" <[EMAIL PROTECTED]> wrote: > I have just released version 0.0.22 of Shed Skin, an experimental > Python-to-C++ compiler. Among other things, it has the exciting new > feature of being able to generate (simple, for now) extension modules, > so it's much easier to c

Re: Re-raising exceptions with modified message

2007-07-05 Thread Neil Cerutti
On 2007-07-05, Christoph Zwerschke <[EMAIL PROTECTED]> wrote: > Neil Cerutti wrote: >> The documentation for BaseException contains something that might >> be relevant: >> >>[...] If more data needs to be attached to the exception, >>attach it through arbitrary attributes on the instance.

Callback scoping

2007-07-05 Thread Dan
So, I think I understand what python's scoping is doing in the following situation: >>> x = [ lambda: ind for ind in range(10) ] >>> x [ at 0x00BEC070>, at 0x00BEC7F0>, at 0x00BECA70>, at 0x00C1EBF0>, at 0x00C1EE30>, at 0x00C228F0>, at 0x00C228B0>, at 0x00C28730>, at 0x00C286F0>, at 0x00C2

Re: Proposal: s1.intersects(s2)

2007-07-05 Thread Christoph Zwerschke
Nis Jørgensen wrote: > The problem is, these functions can be read as "X is [consisting only > of] digit[s]", "X is lower [case]" etc, where the bits in brackets have > been removed for brewity. In the case of "s1 is intersect s2" there is > no way I can see of adding words to get a correct sentenc

Re: SMTP server w/o using Twisted framework

2007-07-05 Thread Jean-Paul Calderone
On Thu, 05 Jul 2007 18:56:49 -, _spitFIRE <[EMAIL PROTECTED]> wrote: >On Jul 5, 1:34 pm, "Jeff McNeil" <[EMAIL PROTECTED]> wrote: >> If you just want to send mail, you should be able to use the standard >> smtplib module (http://docs.python.org/lib/module-smtplib.html). If >> your recipients ar

Re: PEP 3107 and stronger typing (note: probably a newbie question)

2007-07-05 Thread Donn Cave
In article <[EMAIL PROTECTED]>, Paul Boddie <[EMAIL PROTECTED]> wrote: > However, it's interesting to consider the work that sometimes needs to > go in to specify data structures in some languages - thinking of ML > and friends, as opposed to Java and friends. The campaign for optional > static t

Re: Where is the syntax for the dict() constructor ?!

2007-07-05 Thread Neil Cerutti
On 2007-07-05, Captain Poutine <[EMAIL PROTECTED]> wrote: > "Reader objects (DictReader instances and objects returned by > the reader() function) have the following public methods: Lucky for you and me, Peter Otten corrected my mistaken advice. > next( ) > Return the next row of the

Extracting arbitrary amounts of data from a dictionary.

2007-07-05 Thread robinsiebler
I had nothing better to do, so I thought I would make a database that contained the songs played on the internet radio station I listen to (hardradio.com) so I could see how many differents songs/artists they played. I stored the data like this: dates = {} #; year = {}; week = {}; date = {};

Re: SMTP server w/o using Twisted framework

2007-07-05 Thread Jeff McNeil
Inline... On 7/5/07, _spitFIRE <[EMAIL PROTECTED]> wrote: > On Jul 5, 1:34 pm, "Jeff McNeil" <[EMAIL PROTECTED]> wrote: > > If you just want to send mail, you should be able to use the standard > > smtplib module (http://docs.python.org/lib/module-smtplib.html). If > > your recipients are on the I

Re: Re-raising exceptions with modified message

2007-07-05 Thread Christoph Zwerschke
Neil Cerutti wrote: > You may need the traceback module to get at the error message, if > trying to read e.message can fail. > > Something like this mess here: ;) > >... >except Exception, e: > etype, evalue, etb = sys.exc_info() > ex = traceback.format_exception_only(etype, eva

Re: need help with converting c function to python function

2007-07-05 Thread Anton Vredegoor
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] says... > i have a c function from some modbus documentation that i need to > translate into python. > > it looks like this: > > > unsigned short CRC16(puchMsg, usDataLen) > unsigned char *puchMsg ; > unsigned short usDataLen ; > { >unsigne

Re: SMTP server w/o using Twisted framework

2007-07-05 Thread _spitFIRE
On Jul 5, 2:21 pm, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: > You need to do a DNS MX lookup. There's nothing in the Python stdlib > which provides this functionality. There are several libraries available > which do this, though (Twisted among them ;). You can probably find them > with a

Re: SMTP server w/o using Twisted framework

2007-07-05 Thread _spitFIRE
On Jul 5, 2:37 pm, "Jeff McNeil" <[EMAIL PROTECTED]> wrote: > You could try pyDNS (http://pydns.sourceforge.net). You should simply > be able to call the 'DNS.mxlookup' function. The other option would > be twisted.names... > Thanks for the pointers. > What about simply running an SMTP server o

  1   2   >