Re: tarfile...bug?

2007-10-12 Thread alan . haffner
On Oct 9, 10:33 pm, Anurag <[EMAIL PROTECTED]> wrote: > Hi, > > Have any one faced such problem, I assume it must be common if it can > be replicated so easily , or something wrong with my system > > Also if I use tar.members instead of tar.getmembers() it works > so what is the diff. between tar.m

Re: Declarative properties

2007-10-12 Thread Artur Siekielski
George Sakkis wrote: > By now you must have been convinced that default getters/setters is > not a very useful idea in Python but this does not mean you can't do > it; It's a perfect summary of my thoughts after reading this thread. I will use public attributes (with access customizable with prope

Re: Declarative properties

2007-10-12 Thread Bruno Desthuilliers
Dan Stromberg a écrit : > On Thu, 11 Oct 2007 13:46:12 +, Marc 'BlackJack' Rintsch wrote: > >> On Thu, 11 Oct 2007 13:04:53 +, Artur Siekielski wrote: >> >>> On Oct 11, 2:27 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: But why? Default getters and setters are unnecessary a

Re: Declarative properties

2007-10-12 Thread Bruno Desthuilliers
Artur Siekielski a écrit : > George Sakkis wrote: >> By now you must have been convinced that default getters/setters is >> not a very useful idea in Python but this does not mean you can't do >> it; > > It's a perfect summary of my thoughts after reading this thread. I > will use public attribute

Cross-platform GUI development

2007-10-12 Thread [EMAIL PROTECTED]
I've been programming in Python for 5 or more years now and whenever I want a quick-n-dirty GUI, I use Tkinter. This is partly because it's the first toolkit I learnt, but also because it's part of the standard Python distribution and therefore easy to get Python apps to work cross platform - it us

Re: sorteddict PEP proposal [started off as orderedict]

2007-10-12 Thread Paul Rubin
Mark Summerfield <[EMAIL PROTECTED]> writes: > Below is a PEP proposal for a sorteddict. ... Is this proposal dead? I'd been meaning to post some thoughts which I still haven't gotten around to writing up, and am wondering whether to keep it on my todo list. -- http://mail.python.org/mailman/lis

Re: Script to Remove Attachments in Exchange Mailbox

2007-10-12 Thread Tim Golden
[KDawg44] >>> I am frustrated with my users who send large files around the office >>> instead of using the network shares. [Tim Golden] >> I have something v. similar, ... >> It's a while since they were last run to they're probably quite >> dusty but it sounds like the kind of thing you're afte

Re: Cross-platform GUI development

2007-10-12 Thread Alexandre Badez
On Oct 12, 10:13 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > I've been programming in Python for 5 or more years now and whenever I > want a quick-n-dirty GUI, I use Tkinter. This is partly because it's > the first toolkit I learnt, but also because it's part of the standard > Python distr

Re: Pyro: ActiveState (wind32) to Unix

2007-10-12 Thread Tim Golden
Sells, Fred wrote: > I'm using ActiveState python on a windows box to talk to ACtive Directory. > I'm running a Pyro Server on the same box. > > The client is Linux running std Python 2.4. > > It works just fine until the server codes calls some > win32com.client api; then I get > > > Tra

Re: decorating container types (Python 2.4)

2007-10-12 Thread James Stroud
[EMAIL PROTECTED] wrote: > On Oct 12, 12:19 pm, James Stroud <[EMAIL PROTECTED]> wrote: >> [EMAIL PROTECTED] wrote: >>> I have a container class A and I want to add functionality to it by >>> using a decorator class B, as follows: >>> class A(object): >>> def __len__(self): >>> return 5

Re: EasyMock for python ?

2007-10-12 Thread Simon Brunning
On 10/12/07, Ben Finney <[EMAIL PROTECTED]> wrote: > BlueBird <[EMAIL PROTECTED]> writes: > This means that the Mock object automatically supports any number of > attributes and methods by any reasonable names; the only setup needed > beyond creating the instance is to seed it with anything you *do

Re: EasyMock for python ?

2007-10-12 Thread Ben Finney
(Please don't send me personal copies of messages that are sent to the forum; I read via the newsgroup, and it's annoying to also get replies in email when I didn't send an email message.) "Simon Brunning" <[EMAIL PROTECTED]> writes: > On 10/12/07, Ben Finney <[EMAIL PROTECTED]> wrote: > > This m

Re: Problem with MySQL cursor

2007-10-12 Thread Florian Lindner
Carsten Haese wrote: > On Thu, 2007-10-11 at 15:14 +0200, Florian Lindner wrote: >> Hello, >> I have a function that executes a SQL statement with MySQLdb: >> >> def executeSQL(sql, *args): >> print sql % args >> cursor = conn.cursor() >> cursor.execute(sql, args) >> cursor.close

Re: Cross-platform GUI development

2007-10-12 Thread Peter Decker
On 10/12/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > My question is if Tix is old hat, what is the GUI toolkit I *should* > be using for quick-n-dirty cross platform GUI development? I would heartily recommend Dabo (http://dabodev.com). It wraps the wxPython toolkit, but eliminates 99% of

Memory Problems in Windows 2003 Server

2007-10-12 Thread amdescombes
Hi, I am using Python 2.5.1 I have an application that reads a file and generates a key in a dictionary for each line it reads. I have managed to read a 1GB file and generate more than 8 million keys on an Windows XP machine with only 1GB of memory and all works as expected. When I use the same

Re: Last iteration?

2007-10-12 Thread Peter Otten
Diez B. Roggisch wrote: > Florian Lindner wrote: >> can I determine somehow if the iteration on a list of values is the >> last iteration? > def last_iter(iterable): > it = iter(iterable) > buffer = [it.next()] > for i in it: > buffer.append(i) > old, buffer = buffer

Traceback (most recent call last): PROBLEM

2007-10-12 Thread smarras
Hello everyone, I keep obtaining an error message whenever I execute some very simple routines; the error that follows says that I am calling certain functions that, in reality, I am not calling from any of the routines that I wrote: error: > python fwrite_mat.py 0, 0, 0, 0 , 0, 1, 2, 3 , 0,

Re: Error on base64.b64decode() ?!

2007-10-12 Thread Jean-Paul Calderone
On Fri, 12 Oct 2007 14:59:13 -, Christoph Krammer <[EMAIL PROTECTED]> wrote: >Hello everybody, > >I am using a python script to extract images from email messages. This >works fine for some messages, but not all attached images can be >decoded. I use the following code to decode the image and s

Error on base64.b64decode() ?!

2007-10-12 Thread Christoph Krammer
Hello everybody, I am using a python script to extract images from email messages. This works fine for some messages, but not all attached images can be decoded. I use the following code to decode the image and save it to a database: try: imagedec = base64.b64decode(imageenc) imagehash = md5.

Re: PEP idea: Instrumented Python

2007-10-12 Thread Jean-Paul Calderone
On Fri, 12 Oct 2007 11:33:11 -0500, Erik Jones <[EMAIL PROTECTED]> wrote: > [snip] > >This got me thinking about building a module that could be included >by projects that creates a socket and responds to messages on that >socket in a separate thread from the main app so that you can connect >to th

Re: Python module for making Quicktime or mpeg movies from images

2007-10-12 Thread Daniel Fetchinson
> My Python script makes a bunch of images that I want to use as frames > in a movie. I've tried searching for a module that will take these > images and put them together in a Quicktime or mpeg movie, but haven't > found anything. My images are currently pdfs, but I could make them > into just a

Announcement: Project to get some CPython C extensions running under IronPython

2007-10-12 Thread Giles Thomas
The great thing about CPython is that it comes with the batteries included. The problem with IronPython is that some of these batteries just don't fit - in particular, most of the the C extensions don't work. We'd like to help fix at least some of this problem, to help people who use IronPyth

Re: matching a street address with regular expressions

2007-10-12 Thread Paul McGuire
On Oct 12, 8:19 am, John Machin <[EMAIL PROTECTED]> wrote: > "... most of the developed world" was the [very optimistic] request. > How does it go with "JAPAN 112-0001 TOKYO Bunkyo-Ku Hakusan 4-Chome 3- > 2" and will it give the same result for "4-3-2 HAKUSAN BUNKYO-KU TOKYO > 112-1 JAPAN"? OK,

Re: Simple question about python logic.

2007-10-12 Thread Colin J. Williams
Tim Chase wrote: >> I have a file containing following data. But the dimension can be >> different. >> >> A B C D E F G >> 3 4 1 5 6 2 4 >> 7 2 4 1 6 9 3 >> 3 4 1 5 6 2 4 >> 7 2 4 1 6 9 3 >> . >> . >> . >> . >> >> What is the best approach to make a column vector with the name such >> as A B, etc?

How to set proxy in Python for flickr api

2007-10-12 Thread honestguy1999
Hi, everyone, I am using beej's flickr api in Python. For some reason I have to bypass the firewall using a proxy. I read the urllib reference and set http_proxy="my proxy". But it didn't work. I can't even get authenticated. Is there anyway that we can set the proxy? -- http://mail.python.org/ma

Re: PEP idea: Instrumented Python

2007-10-12 Thread Erik Jones
On Oct 12, 2007, at 12:10 PM, Jean-Paul Calderone wrote: > On Fri, 12 Oct 2007 11:33:11 -0500, Erik Jones <[EMAIL PROTECTED]> > wrote: >> [snip] >> >> This got me thinking about building a module that could be included >> by projects that creates a socket and responds to messages on that >> sock

Re: Web Ontology Language (OWL) parsing

2007-10-12 Thread Tim Churches
Sean Davis wrote: > I would like to parse some OWL files, but I haven't dealt with OWL in > python or any other language for that matter. Some quick google > searches do not turn up much in the way of possibilities for doing so > in python. Any suggestions of available code or using existing > li

Re: Cross-platform GUI development

2007-10-12 Thread Dan Stromberg
On Fri, 12 Oct 2007 05:30:13 -0500, Nick Craig-Wood wrote: > 3) Isn't a pain to install on windows (GTK) pygtk is easy to install on windows if you use cygwin. I started developing a little ssh GUI frontend on a windows laptop using cygwin pygtk and cygwin openssh. When I moved it over to a Li

Re: Convert obejct string repr to actual object

2007-10-12 Thread English, Mark
> From: Tor Erik Sønvisen > Date: October 8th 2007 > I've tried locating some code that can recreate an object from > it's string representation... On a related note I've wondered about this: >>> class Foo(object): pass >>> f = Foo() >>> s = repr(f) >>> s '<__main__.Foo object at 0x007CBAB0>' So

Re: RMI with Pyro et al

2007-10-12 Thread Diez B. Roggisch
Irmen de Jong schrieb: > Diez B. Roggisch wrote: > >> Go install cygwin (but not it's included python-interpreter, or at least >> make sure you have your python path properly under control) and then >> simply >> start the script from the command-line. And hit C-c if you need it to >> stop, >> an

Re: PEP idea: Instrumented Python

2007-10-12 Thread Erik Jones
On Oct 12, 2007, at 10:09 AM, Christopher Nelson wrote: > I was looking at adding dtrace-like dynamic tracing to Python. > Note that this isn't dtrace itself. The basic rationale: > > 1. A lot of enterprise-level software is written in Python. It is > difficult to impossible to reproduce th

Re: Simple question about python logic.

2007-10-12 Thread Tim Chase
> I have a file containing following data. But the dimension can be > different. > > A B C D E F G > 3 4 1 5 6 2 4 > 7 2 4 1 6 9 3 > 3 4 1 5 6 2 4 > 7 2 4 1 6 9 3 > . > . > . > . > > What is the best approach to make a column vector with the name such > as A B, etc? There are a couple different

Re: Top 10 Caribbean island destinations

2007-10-12 Thread John McWilliams
[EMAIL PROTECTED] wrote: > lol :) another one on baseball : 90% of the game is physical, the > other half is mental. > > GS > [EMAIL PROTECTED] > > On Oct 11, 7:32 pm, willshak <[EMAIL PROTECTED]> wrote: >> on 10/11/2007 10:14 PM Audio expert said the following: >> >>> Now I know where NOT to go.

Re: Simple question about python logic.

2007-10-12 Thread Carl Banks
On Oct 12, 11:32 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > I have a file containing following data. But the dimension can be > different. > > A B C D E F G > 3 4 1 5 6 2 4 > 7 2 4 1 6 9 3 > 3 4 1 5 6 2 4 > 7 2 4 1 6 9 3 > . > . > . > . > > What is the best approach to make a column vecto

Re: Cross-platform GUI development

2007-10-12 Thread Grant Edwards
On 2007-10-12, Grant Edwards <[EMAIL PROTECTED]> wrote: > I use wxPython, because it uses Gtk on Linux, and Gtk is > "native" for both me and for my Windows users. I didn't state that very well. What I meant was that wxPython uses Gtk under Linux (which is native for me) so wxPython looks nati

Re: Cross-platform GUI development

2007-10-12 Thread Grant Edwards
On 2007-10-12, BlueBird <[EMAIL PROTECTED]> wrote: >> I'd recommend wxPython over those becase >> >> 1) native look and feel on all platforms Not true for KDE or other non-Gtk desktops. > You get it with PyQt as well. Not true for Gnome or other non-Qt desktops. There is no single "native look

Re: Cross-platform GUI development

2007-10-12 Thread Grant Edwards
On 2007-10-12, Alexandre Badez <[EMAIL PROTECTED]> wrote: > Personnaly, I use PyQt simply because I prefere Qt to Gtk, > witch is much more integrated with all desktop than Gtk. So you're claiming Qt is much more integrated with Gnome than Gtk? The mind wobbles. The Gnome and XFCE desktops are _

Re: pyserial doesn't recognize virtual serial port

2007-10-12 Thread Grant Edwards
On 2007-10-12, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Hi, > I am trying to use virtual serial ports to develop/test my serial > communication program. Running in to trouble... > > I am using com0com to create the virtual ports. The virtual ports > seem to be working fine when I test it

Simple question about python logic.

2007-10-12 Thread [EMAIL PROTECTED]
I have a file containing following data. But the dimension can be different. A B C D E F G 3 4 1 5 6 2 4 7 2 4 1 6 9 3 3 4 1 5 6 2 4 7 2 4 1 6 9 3 . . . . What is the best approach to make a column vector with the name such as A B, etc? -- http://mail.python.org/mailman/listinfo/python-list

PEP idea: Instrumented Python

2007-10-12 Thread Christopher Nelson
I was looking at adding dtrace-like dynamic tracing to Python. Note that this isn't dtrace itself. The basic rationale: 1. A lot of enterprise-level software is written in Python. It is difficult to impossible to reproduce the customer environment in a test lab. Sometimes applications hang myst

Re: Python module for making Quicktime or mpeg movies from images

2007-10-12 Thread TYR
On Oct 11, 4:17 pm, Tim Golden <[EMAIL PROTECTED]> wrote: > jeremito wrote: > > On Oct 11, 10:43 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > >> jeremito wrote: > >>> My Python script makes a bunch of images that I want to use as frames > >>> in a movie. I've tried searching for a module th

Re: Memory Problems in Windows 2003 Server

2007-10-12 Thread brad
amdescombes wrote: > Hi, > > I am using Python 2.5.1 > I have an application that reads a file and generates a key in a > dictionary for each line it reads. I have managed to read a 1GB file and > generate more than 8 million keys on an Windows XP machine with only 1GB > of memory and all works

Re: Memory Problems in Windows 2003 Server

2007-10-12 Thread brad
amdescombes wrote: > Hi, > > I am using Python 2.5.1 > I have an application that reads a file and generates a key in a > dictionary for each line it reads. I have managed to read a 1GB file and > generate more than 8 million keys on an Windows XP machine with only 1GB > of memory and all works

Subprocess Running Slowly

2007-10-12 Thread Robert Rawlins - Think Blue
Hello Guys, I'm looking for a little advice on spawning a sub process to run a command line application for transferring a file over Bluetooth. Now the spawned process runs from start to finish exactly as I would expect it too, however its very slow. Now the main reason this is so odd, is

Re: Traceback (most recent call last): PROBLEM

2007-10-12 Thread Peter Otten
smarras wrote: > Hello everyone, I keep obtaining an error message whenever I execute some > very simple routines; the error that follows says that I am calling > certain functions that, in reality, I am not calling from any of the > routines that I wrote: > > error: > >> python fwrite_mat.py >

Re: matching a street address with regular expressions

2007-10-12 Thread John Machin
On Oct 12, 4:07 pm, Paul McGuire <[EMAIL PROTECTED]> wrote: > On Oct 11, 11:50 pm, John Nagle <[EMAIL PROTECTED]> wrote: > > > > > If anyone has a first-rate address parser in Python that will cover > > most of the developed world, I'd like to talk to them. > > >

Re: Declarative properties

2007-10-12 Thread Stargaming
On Thu, 11 Oct 2007 18:58:44 +0200, Bruno Desthuilliers wrote: [snip] Your implementation seems particularly broken. You do not return anything from `name()`, hereby removing name as an attribute (or: replacing it with its return value -- None). You should return ``property(**locals()) `` (or ``

Re: How to set proxy in Python for flickr api

2007-10-12 Thread honestguy1999
On Oct 12, 2:40 pm, [EMAIL PROTECTED] wrote: > Hi, everyone, I am using beej's flickr api in Python. For some reason > I have to bypass the firewall using a proxy. I read the urllib > reference and set http_proxy="my proxy". But it didn't work. I can't > even get authenticated. Is there anyway that

Re: Problem with MySQL cursor

2007-10-12 Thread Carsten Haese
On Fri, 2007-10-12 at 13:12 +0200, Florian Lindner wrote: > Carsten Haese wrote: > > sql = "INSERT INTO "+DOMAIN_TABLE+"("+DOMAIN_FIELD+") VALUES (%s)" > > executeSQL(sql, domainname) > > Ok, I understand it and now it works, but why is limitation? Why can't I > just the string interpolation in a

Re: Last iteration?

2007-10-12 Thread tasjaevan
On Oct 12, 11:58 am, Florian Lindner <[EMAIL PROTECTED]> wrote: > Hello, > can I determine somehow if the iteration on a list of values is the last > iteration? > > Example: > > for i in [1, 2, 3]: >if last_iteration: > print i*i >else: > print i > > that would print > > 1 > 2 >

Re: Cross-platform GUI development

2007-10-12 Thread Eric Brunel
On Fri, 12 Oct 2007 10:13:29 +0200, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > I've been programming in Python for 5 or more years now and whenever I > want a quick-n-dirty GUI, I use Tkinter. This is partly because it's > the first toolkit I learnt, but also because it's part of the standard

Re: Last iteration?

2007-10-12 Thread Paul Hankin
On Oct 12, 11:58 am, Florian Lindner <[EMAIL PROTECTED]> wrote: > Hello, > can I determine somehow if the iteration on a list of values is the last > iteration? > > Example: > > for i in [1, 2, 3]: >if last_iteration: > print i*i >else: > print i Yes, either use enumerate or ju

Re: Last iteration?

2007-10-12 Thread Diez B. Roggisch
Florian Lindner wrote: > Hello, > can I determine somehow if the iteration on a list of values is the last > iteration? > > Example: > > for i in [1, 2, 3]: >if last_iteration: > print i*i >else: > print i > > that would print > > 1 > 2 > 9 > > > Can this be acomplished s

Re: matching a street address with regular expressions

2007-10-12 Thread Grant Edwards
On 2007-10-12, Paul McGuire <[EMAIL PROTECTED]> wrote: > I've been to Japan and Europe too, and I can't even figure out > how many digits a phone number is supposed to have! I was shocked at utterly foreign and lost I felt looking at phone numbers in various places overseas. I could deal with ph

Last iteration?

2007-10-12 Thread Florian Lindner
Hello, can I determine somehow if the iteration on a list of values is the last iteration? Example: for i in [1, 2, 3]: if last_iteration: print i*i else: print i that would print 1 2 9 Can this be acomplished somehow? Thanks, Florian -- http://mail.python.org/mailman/lis

Re: EasyMock for python ?

2007-10-12 Thread BlueBird
On Oct 11, 4:26 pm, "Simon Brunning" <[EMAIL PROTECTED]> wrote: > On 10/10/07, BlueBird <[EMAIL PROTECTED]> wrote: > > > Does anybody know where to find a library like EasyMock for python ? I > > searched quickly but could not find anything. > > > I found python-mocks on sourceforge but form quickl

Re: Python service gets interrupted function call

2007-10-12 Thread Roger Upole
"ashish" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi All, > I wanted to know how to handle events like 'logoff' in the main thread > so that any process which is being run by svcDoRun method of service > does not get 'interrupted function call' exception. > > I am posting a ve

Re: Cross-platform GUI development

2007-10-12 Thread Nick Craig-Wood
Alexandre Badez <[EMAIL PROTECTED]> wrote: > On Oct 12, 10:13 am, "[EMAIL PROTECTED]" > <[EMAIL PROTECTED]> wrote: > > My question is if Tix is old hat, what is the GUI toolkit I *should* > > be using for quick-n-dirty cross platform GUI development? I guess > > this is tangentially related to: >

Problem with global

2007-10-12 Thread Florian Lindner
Hello, I have a little problem with the global statement. def executeSQL(sql, *args): try: import pdb; pdb.set_trace() cursor = db.cursor() # db is . [...] except: print "Problem contacting MySQL database. Please contact root." sys.exit(-1) db =

Re: Script to Remove Attachments in Exchange Mailbox

2007-10-12 Thread Tim Golden
Tim Golden wrote: > [KDawg44] > I am frustrated with my users who send large files around the office instead of using the network shares. > > [Tim Golden] >>> I have something v. similar, ... >>> It's a while since they were last run to they're probably quite >>> dusty but it sounds lik

Re: Cross-platform GUI development

2007-10-12 Thread BlueBird
On Oct 12, 12:30 pm, Nick Craig-Wood <[EMAIL PROTECTED]> wrote: > > > My question is if Tix is old hat, what is the GUI toolkit I *should* > > > be using for quick-n-dirty cross platform GUI development? I guess > > > this is tangentially related to: > > > >http://groups.google.com/group/comp.lang.

RE: Last iteration?

2007-10-12 Thread Andreas Tawn
> Hello, > can I determine somehow if the iteration on a list of values > is the last > iteration? > > Example: > > for i in [1, 2, 3]: >if last_iteration: > print i*i >else: > print i > > that would print > > 1 > 2 > 9 Something like: myList = [1, 2, 3] for i, j in enume

Re: Last iteration?

2007-10-12 Thread Stefan Behnel
Florian Lindner wrote: > can I determine somehow if the iteration on a list of values is the last > iteration? > > Example: > > for i in [1, 2, 3]: >if last_iteration: > print i*i >else: > print i > > that would print > > 1 > 2 > 9 > > > Can this be acomplished somehow? Y

Re: sorteddict PEP proposal [started off as orderedict]

2007-10-12 Thread Mark Summerfield
On 12 Oct, 09:17, Paul Rubin wrote: > Mark Summerfield <[EMAIL PROTECTED]> writes: > > Below is a PEP proposal for a sorteddict. ... > > Is this proposal dead? I'd been meaning to post some thoughts which I > still haven't gotten around to writing up, and am wondering wh

Re: Is this a bug of the lambda function

2007-10-12 Thread Carsten Haese
On Fri, 12 Oct 2007 01:00:47 -0400, Zhu Wayne wrote > Hi, > I have a short code which gives me strange results, the code is as follows: > > f = [lambda x: None]*5 > for j in range(0, 5): > f[j] = lambda x: float(j)*x > [...] > It seems only when I use the index j (which is declear with

Re: matching a street address with regular expressions

2007-10-12 Thread Paul McGuire
On Oct 12, 8:19 am, John Machin <[EMAIL PROTECTED]> wrote: > "... most of the developed world" was the [very optimistic] request. > How does it go with "JAPAN 112-0001 TOKYO Bunkyo-Ku Hakusan 4-Chome 3- > 2" and will it give the same result for "4-3-2 HAKUSAN BUNKYO-KU TOKYO > 112-1 JAPAN"? OK,

Re: decorating container types (Python 2.4)

2007-10-12 Thread George Sakkis
On Oct 11, 5:42 pm, [EMAIL PROTECTED] wrote: > Hi, > > I have a container class A and I want to add functionality to it by > using a decorator class B, as follows: > > class A(object): > def __len__(self): > return 5 > > class B(object): > def __init__(self, a): > self._a =

Re: Problem with MySQL cursor

2007-10-12 Thread Diez B. Roggisch
Florian Lindner wrote: > Carsten Haese wrote: > >> On Thu, 2007-10-11 at 15:14 +0200, Florian Lindner wrote: >>> Hello, >>> I have a function that executes a SQL statement with MySQLdb: >>> >>> def executeSQL(sql, *args): >>> print sql % args >>> cursor = conn.cursor() >>> cursor.ex

Re: problem with wxPanel derivation class ~ thanks

2007-10-12 Thread none
none wrote: > wxGlade created a simple Frame with a panel a sizer and 3 wxControls , > saticText, TextCtrl, and a Button. > > The resulting code works fine. > > Now the problem. > I wish to make a separate class derrived from wxPanel that has the sized > and controls as above. It jusst won't wor

Re: problem with wxPanel derivation class

2007-10-12 Thread kyosohma
On Oct 11, 4:01 pm, "Chris Mellon" <[EMAIL PROTECTED]> wrote: > On 10/11/07, <"@bag.python.org <"none> wrote:> wxGlade created a simple Frame > with a panel a sizer and 3 wxControls , > > saticText, TextCtrl, and a Button. > > > > > It seems as though the complaint is that a 'wxWindow *' is expe

Re: matching a street address with regular expressions

2007-10-12 Thread Paul McGuire
On Oct 12, 1:07 am, Paul McGuire <[EMAIL PROTECTED]> wrote: > On Oct 11, 11:50 pm, John Nagle <[EMAIL PROTECTED]> wrote: > > > > > If anyone has a first-rate address parser in Python that will cover > > most of the developed world, I'd like to talk to them. > > >

Re: matching a street address with regular expressions

2007-10-12 Thread Grant Edwards
On 2007-10-12, Paul McGuire <[EMAIL PROTECTED]> wrote: > If you've got an re that can handle everything from "123 Main" to > "221B Baker Street" to "Hollywood and Vine" to "Lot 123, Hundred of > Foughbarre", now THAT would be something. Don't forget street addresses like: The Low Cowsheds G

Re: raw_input() and utf-8 formatted chars

2007-10-12 Thread kyosohma
On Oct 12, 1:53 pm, 7stud <[EMAIL PROTECTED]> wrote: > s = 'A\xcc\x88' #capital A with umlaut > print s #displays capital A with umlaut > > s = raw_input('Enter: ') #A\xcc\x88 > print s#displays A\xcc\x88 > > print len(input) #9 > > It looks like every ch

Re: Last iteration?

2007-10-12 Thread Carsten Haese
On Fri, 2007-10-12 at 12:58 +0200, Florian Lindner wrote: > Hello, > can I determine somehow if the iteration on a list of values is the last > iteration? > > Example: > > for i in [1, 2, 3]: >if last_iteration: > print i*i >else: > print i > > that would print > > 1 > 2 > 9

Re: Last iteration?

2007-10-12 Thread Paul Hankin
On Oct 12, 2:18 pm, Carsten Haese <[EMAIL PROTECTED]> wrote: > On Fri, 2007-10-12 at 12:58 +0200, Florian Lindner wrote: > > Hello, > > can I determine somehow if the iteration on a list of values is the last > > iteration? > > > Example: > > > for i in [1, 2, 3]: > >if last_iteration: > >

Traceback (most recent call last): PROBLEM

2007-10-12 Thread smarras
Hello everyone, I keep obtaining an error message whenever I execute some very simple routines; the error that follows says that I am calling certain functions that, in reality, I am not calling from any of the routines that I wrote: error: > python fwrite_mat.py 0, 0, 0, 0 , 0, 1, 2, 3 , 0,

Moving objects in Tkinter

2007-10-12 Thread Evjen Halverson
I have tried to make a Tkinter program make a rectangle move down the window, but did not succeed. All it does is make a rectangle trail. What am I doing wrong? from Tkinter import* root = Tk() RectangleColor='orange' Background=tk_rgb = "#%02x%02x%02x" % (100, 255, 100) root.geometr

Re: matching a street address with regular expressions

2007-10-12 Thread Grant Edwards
On 2007-10-12, Grant Edwards <[EMAIL PROTECTED]> wrote: > On 2007-10-12, Paul McGuire <[EMAIL PROTECTED]> wrote: > >> If you've got an re that can handle everything from "123 Main" to >> "221B Baker Street" to "Hollywood and Vine" to "Lot 123, Hundred of >> Foughbarre", now THAT would be something.

Re: The fundamental concept of continuations

2007-10-12 Thread David Kastrup
George Neuner writes: > Yes and no. General continuations, as you describe, are not the > only form continuations take. Nor are they the most common form > used. The most common continuations are function calls and returns. > Upward one-shot continuations (exceptions or non-local returns) are

Re: Cross-platform GUI development

2007-10-12 Thread Kevin Walzer
[EMAIL PROTECTED] wrote: > > My question is if Tix is old hat, what is the GUI toolkit I *should* > be using for quick-n-dirty cross platform GUI development? I guess > this is tangentially related to: What widgets are you using in Tix? They may be available in BWidgets, Tablelist, or other scr

Re: Declarative properties

2007-10-12 Thread Dan Stromberg
On Fri, 12 Oct 2007 09:42:28 +0200, Bruno Desthuilliers wrote: >>> So what? Otherwise you carry *always* the baggage of a public >>> property and a private attribute whether you need this or not. At >>> least for me it would be unnecessary in most cases. >> >> That "baggage" of carrying around

raw_input() and utf-8 formatted chars

2007-10-12 Thread 7stud
s = 'A\xcc\x88' #capital A with umlaut print s #displays capital A with umlaut s = raw_input('Enter: ') #A\xcc\x88 print s#displays A\xcc\x88 print len(input) #9 It looks like every character of the string I enter in utf-8 is being interpreted literal

Re: Convert obejct string repr to actual object

2007-10-12 Thread Carsten Haese
On Fri, 2007-10-12 at 17:41 +0100, English, Mark wrote: > > From: Tor Erik Sønvisen > > Date: October 8th 2007 > > I've tried locating some code that can recreate an object from > > it's string representation... > On a related note I've wondered about this: > >>> class Foo(object): pass > >>> f =

Re: Problem with MySQL cursor

2007-10-12 Thread Florian Lindner
Carsten Haese wrote: > On Fri, 2007-10-12 at 13:12 +0200, Florian Lindner wrote: >> Carsten Haese wrote: >> > sql = "INSERT INTO "+DOMAIN_TABLE+"("+DOMAIN_FIELD+") VALUES (%s)" >> > executeSQL(sql, domainname) >> >> Ok, I understand it and now it works, but why is limitation? Why can't I >> just

test if email

2007-10-12 Thread Florian Lindner
Hello, is there a function in the Python stdlib to test if a string is a valid email address? Thanks, florian -- http://mail.python.org/mailman/listinfo/python-list

Re: raw_input() and utf-8 formatted chars

2007-10-12 Thread 7stud
On Oct 12, 1:18 pm, [EMAIL PROTECTED] wrote: > On Oct 12, 1:53 pm, 7stud <[EMAIL PROTECTED]> wrote: > > > s = 'A\xcc\x88' #capital A with umlaut > > print s #displays capital A with umlaut > > > s = raw_input('Enter: ') #A\xcc\x88 > > print s#displays A\xcc\x88 > >

Re: Declarative properties

2007-10-12 Thread Dan Stromberg
On Thu, 11 Oct 2007 18:42:16 +, Marc 'BlackJack' Rintsch wrote: >> The "baggage" of possibly fixing (AKA "generalizing") how your attributes >> are accessed is something you lug around while your deadline looms. > > Sorry I don't get it. If I want to customize the access to a "normal" > att

Re: test if email

2007-10-12 Thread kyosohma
On Oct 12, 2:55 pm, Florian Lindner <[EMAIL PROTECTED]> wrote: > Hello, > is there a function in the Python stdlib to test if a string is a valid > email address? > > Thanks, > > florian What do you mean? If you're just testing the construction of the email address string, then it's pretty easy. I

Re: Python module for making Quicktime or mpeg movies from images

2007-10-12 Thread jeremito
On Oct 12, 10:37 am, TYR <[EMAIL PROTECTED]> wrote: > On Oct 11, 4:17 pm, Tim Golden <[EMAIL PROTECTED]> wrote: > > > > > jeremito wrote: > > > On Oct 11, 10:43 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > > >> jeremito wrote: > > >>> My Python script makes a bunch of images that I want to u

Re: Moving objects in Tkinter

2007-10-12 Thread Matt McCredie
On 10/12/07, Evjen Halverson <[EMAIL PROTECTED]> wrote: > I have tried to make a Tkinter program make a rectangle move down the > window, but did not succeed. All it does is make a rectangle trail. >What am I doing wrong? > > from Tkinter import* > root = Tk() > RectangleColor='orange' >

Re: Declarative properties

2007-10-12 Thread George Sakkis
On Oct 12, 2:55 pm, Dan Stromberg <[EMAIL PROTECTED]> wrote: > If you have a program that needs to perform well, you're much better off > coding your classes the best way you know how from a Software Engineering > perspective, and using pysco or shedskin or pypy or similar to > improve performance

Re: test if email

2007-10-12 Thread Tim Williams
On 12/10/2007, brad <[EMAIL PROTECTED]> wrote: > Florian Lindner wrote: > > Hello, > > is there a function in the Python stdlib to test if a string is a valid > > email address? > > Nope, most any string with an @ in it could be a valid email addy. Send > a message to the addy, if it doesn't bounce

Re: test if email

2007-10-12 Thread Tim Williams
On 12/10/2007, Florian Lindner <[EMAIL PROTECTED]> wrote: > Hello, > is there a function in the Python stdlib to test if a string is a valid > email address? > You mean a valid SMTP email address? In reality, there isn't a way of doing this. But a good rule of thumb is if it hasn't got at least

Re: test if email

2007-10-12 Thread brad
Florian Lindner wrote: > Hello, > is there a function in the Python stdlib to test if a string is a valid > email address? Nope, most any string with an @ in it could be a valid email addy. Send a message to the addy, if it doesn't bounce, then it's valid. -- http://mail.python.org/mailman/listi

stderr is a lame hack?

2007-10-12 Thread Erik Jones
So, I was just taking a look at doctest.py and saw this: Then running the module as a script will cause the examples in the docstrings to get executed and verified: python M.py This won't display anything unless an example fails, in which case the failing example(s) and the cause(s) of the failu

Re: problem with wxPanel derivation class ~ thanks

2007-10-12 Thread Chris Mellon
On 10/12/07, <"@bag.python.org <"none> wrote: > none wrote: > > wxGlade created a simple Frame with a panel a sizer and 3 wxControls , > Thanks All, > I didn't make the super() call (java terminology) > to the base class. > > this is the only python group (en) on giganews, my first search > no

[Pyro] ConnectionClosedError

2007-10-12 Thread George Sakkis
Didn't have much luck with this in the Pyro mailing list so I am trying here, just in case. I have a Pyro server running as a daemon process and occasionally (typically after several hours or days of uptime) a ConnectionClosedError is raised when a client calls a remote method. Both client and serv

Re: Declarative properties

2007-10-12 Thread Chris Mellon
On 10/12/07, Dan Stromberg <[EMAIL PROTECTED]> wrote: > On Fri, 12 Oct 2007 09:42:28 +0200, Bruno Desthuilliers wrote: > > >>> So what? Otherwise you carry *always* the baggage of a public > >>> property and a private attribute whether you need this or not. At > >>> least for me it would be unnec

Re: raw_input() and utf-8 formatted chars

2007-10-12 Thread Marc 'BlackJack' Rintsch
On Fri, 12 Oct 2007 13:18:35 -0700, 7stud wrote: > On Oct 12, 1:18 pm, [EMAIL PROTECTED] wrote: >> On Oct 12, 1:53 pm, 7stud <[EMAIL PROTECTED]> wrote: >> >> > s = 'A\xcc\x88' #capital A with umlaut >> > print s #displays capital A with umlaut >> >> > s = raw_input('Enter: ') #A\xcc\

Re: test if email

2007-10-12 Thread Grant Edwards
On 2007-10-12, brad <[EMAIL PROTECTED]> wrote: > Florian Lindner wrote: >> Hello, >> is there a function in the Python stdlib to test if a string is a valid >> email address? > > Nope, most any string with an @ in it could be a valid email addy. Send > a message to the addy, if it doesn't bounce,

  1   2   >