Re: [ANN] PyScript 0.5 released

2005-01-21 Thread Do Re Mi chel La Si Do
Hi ! The good URL is : http://pyscript.sourceforge.net :-) -- Michel Claveau -- http://mail.python.org/mailman/listinfo/python-list

Re: global variable, ok for string, bad for int

2005-01-21 Thread Tim Roberts
francisl <[EMAIL PROTECTED]> wrote: > >I have a problem when I declare global variable. >If it is string, dict, array or tuple, everything goes fine, but with int, I >get an "used before declaration" error. Excuse me for being dubious, but I don't believe you. Both of the examples you posted wor

Re: Freezing a mutable (was Re: lambda)

2005-01-21 Thread Antoon Pardon
Op 2005-01-21, Bengt Richter schreef <[EMAIL PROTECTED]>: > On 20 Jan 2005 14:07:57 GMT, Antoon Pardon <[EMAIL PROTECTED]> wrote: > > Would you like a dictionary that acts as you want and takes care of all > problems internally, and accepts keys and values of any type without wrapping > or other mo

Re: What's the best python web-developer's editor

2005-01-21 Thread Franz Steinhaeusler
On Thu, 20 Jan 2005 18:47:53 +, andy <[EMAIL PROTECTED]> wrote: >Anybody like to comment on which editor they use for python web app >development - for both discrete and mixed python and html code, and why? > I use DrPython, because: It is open source, written in python and wxPython and us

RE: Print to Windows default Printer

2005-01-21 Thread Tim Golden
[Samantha] | Thanks for the URL. I finally am able to print the temp file. | Not exactly | what I wanted, but it will work. The code I used to print was this: | | os.system ("start /min notepad /P temp.txt") | | Thanks ALL! | S Glad you got it sorted. What you describe is, in fact, the sli

Re: tkinter socket client ?

2005-01-21 Thread TZOTZIOY
On 20 Jan 2005 22:25:52 -0800, rumours say that "Tonino" <[EMAIL PROTECTED]> might have written: [tkinter gui for a socket client, lots of data from the socket] >NOW - HOW do I get the server's sent data to continuiosly print in the >Text() widget ? You need to use: yourTextWidget.insert(Tkinte

Graph and Table implementation

2005-01-21 Thread Jan Rienyer Gadil
could anyone please help me! what and how is the best implementation of creating a table based on data coming from the serial port ? and also how would i be able to create graphs (2D) based on these data? opinions and suggestion are most highly welcome. thanks. jr -- http://mail.python.org/mail

TypeError error on tkinter.createfilehandler dummy example

2005-01-21 Thread David
Hi, I'm getting the following error: Traceback (most recent call last):   File "..\kk.py", line 37, in ?     tkinter.createfilehandler(filex, tkinter.READABLE, _dispatch) TypeError: 'NoneType' object is not callable when executing this code on my Windows box: from Tkinter import * def _

DevX: "Processing EDI Documents into XML with Python"

2005-01-21 Thread Claudio Grondi
"You don't have to rely on expensive and proprietary EDI conversion software to parse, validate, and translate EDI X12 data to and from XML; you can build your own translator with any modern programming language, such as Python." by Jeremy Jones http://www.devx.com/enterprise/Article/2

Re: [ANN] PyScript 0.5 released

2005-01-21 Thread Claudio Grondi
http://sourceforge.net/project/showfiles.php?group_id=50346 shows the date of release of pyscript-0.5 as: 2004-05-11 07:00 What is then the reason for this [ANN] ? Claudio "Paul Cochrane" <[EMAIL PROTECTED]> schrieb im Newsbeitrag news:[EMAIL PROTECTED] > PyScript is a python module for pr

Re: Python and SOAP

2005-01-21 Thread Diez B. Roggisch
> I'd like to write a SOAP client and a SOAP server > in Python. > > Is SOAPy still the way to go, or are there better > methods? If you really need SOAP, Nelson did answer your question. But if you are only communicating between two python processes, I suggest pyro. -- Regards, Diez B. Roggis

Re: Overloading ctor doesn't work?

2005-01-21 Thread Nick Craig-Wood
Martin Häcker <[EMAIL PROTECTED]> wrote: > Now I thought, just overide the ctor of datetime so that year, month and >day are static and everything should work as far as I need it. > > That is, it could work - though I seem to be unable to overide the ctor. :( > > Why is that? Its a bug!

RE: Class introspection and dynamically determining function arguments

2005-01-21 Thread Mark English
> From: "Mark English" <[EMAIL PROTECTED]> > > I'd like to write a Tkinter app which, given a class, pops up a > window(s) with fields for each "attribute" of that class. The > user could enter values for the attributes and on closing the > window would be returned an instance of the class. The

Re: Overloading ctor doesn't work?

2005-01-21 Thread Kent Johnson
Nick Craig-Wood wrote: Martin Häcker <[EMAIL PROTECTED]> wrote: Now I thought, just overide the ctor of datetime so that year, month and day are static and everything should work as far as I need it. That is, it could work - though I seem to be unable to overide the ctor. :( Its a bug! http:

how to write a tutorial

2005-01-21 Thread Xah Lee
i've started to read python tutorial recently. http://python.org/doc/2.3.4/tut/tut.html Here are some quick critique: quick example: If the input string is too long, they don't truncate it, but return it unchanged; this will mess up your column lay-out but that's usually better than the alternati

Re: how to write a tutorial

2005-01-21 Thread Diez B. Roggisch
Xah Lee wrote: > i've started to read python tutorial recently. > http://python.org/doc/2.3.4/tut/tut.html Finally! It was about time... > Here are some quick critique: Given that you seem to be totally inert to critique yourself - e.g. your continued posting of useless language comparison, and

RE: Class introspection and dynamically determining function arguments

2005-01-21 Thread Diez B. Roggisch
> The classes I'm dealing with do have attributes since they're > C-Extension types with attributes provided in the "tp_getset" slot. So > this is one case where I can query the class for attributes without > having to create an instance. Thanks for making me think of that, since > looking in the c

Re: tkinter socket client ?

2005-01-21 Thread Tonino
thanks for the reply . just one problem - I do not know how to sit in a "loop" accepting messages on the socket connection - writting them to the Text() widget - refreshing the the GUI - and then starting all over where do I put the loop for the socket ? Thanks Tonino -- http://mail.python

Is there a library to parse Mozilla "mork" documents?

2005-01-21 Thread Paul Boddie
John Reese wrote: > > Mozilla, Firefox, Thunderbird, and so forth use this awful format > called MORK to store all kinds of things: which messages you've read > in a newsgroup, headers and indexes into the mbox file of messages in > a mail folder, and address books. It's documented to some extent

Re: tkinter socket client ?

2005-01-21 Thread Diez B. Roggisch
> just one problem - I do not know how to sit in a "loop" accepting > messages on the socket connection - writting them to the Text() widget > - refreshing the the GUI - and then starting all over > where do I put the loop for the socket ? Another thread? Or use twisted, it comes with a tkint

[ANN] PyLint 0.6

2005-01-21 Thread Sylvain Thenault
Hi there, I'm very pleased to announce the 0.6 release of PyLint. This release fix a lot of bugs and should be much more stable than the 0.5 release where stopping actual import of analyzed modules has been introduced (and that's really a huge improvment, since this was potentialy introducing some

map in Python

2005-01-21 Thread Stu
I have recently switched over to Python from Perl. I want to do something like this in Python: @test = ("a1", "a2", "a3"); map {s/[a-z]//g} @test; print @test; However, I take it there is no equivalent to $_ in Python. But in that case how does map pass the elements of a sequence to a function? I

Re: map in Python

2005-01-21 Thread Simon Brunning
On 21 Jan 2005 04:25:27 -0800, Stu <[EMAIL PROTECTED]> wrote: > I have recently switched over to Python from Perl. I want to do > something like this in Python: > > @test = ("a1", "a2", "a3"); > map {s/[a-z]//g} @test; > print @test; > > However, I take it there is no equivalent to $_ in Python.

Re: tkinter socket client ?

2005-01-21 Thread Tonino
thanks for the info - but I really do not want to learn twisted before I can understand Tkinter ;) another thread seems the way - will try that ... Thanks Tonino -- http://mail.python.org/mailman/listinfo/python-list

Re: map in Python

2005-01-21 Thread Simon Brunning
On Fri, 21 Jan 2005 12:37:46 +, Simon Brunning <[EMAIL PROTECTED]> wrote: > This what you want? > > >>> import re > >>> test = ["a1", "a2", "a3"] > >>> test = [re.sub("[a-z]", "", item) for item in test] > >>> test > ['1', '2', '3'] Or, if you *must* use map, you can do: >>> test = map(lambd

Re: map in Python

2005-01-21 Thread Pierre Barbier de Reuille
You have three ways to do what you want : First wayt is to use lambda. Then, you want to write : >>> map(lambda x: re.sub("[a-z]", "", x), test) Second is to use regular named function : >>> def remove_letters( s ): ... re.sub("[a-z]", "", s) >>> map(remove_letters, test) A third way would be to

Re: What's the best python web-developer's editor

2005-01-21 Thread Philippe C. Martin
>>Emacs >>For both discrete and mixed python and html code, and why? >>There's no reason to use anything else. Although I tested and will keep testing other editors/ide, I also went back to emacs and am quite happy with it. However, I sometimes use snavigator (http://sourceforge.net/projects/sou

Re: how to write a tutorial

2005-01-21 Thread drewc
You should not be giving such advice! (and the crosspost ... WTF?). I've been trying to follow along with your perl/python yahoo group, but your posts are terrible. Perhaps you should provide the output of the code you post. Then i'd actually know what i'm trying to achieve. As it is i have to c

Re: Class introspection and dynamically determining function arguments

2005-01-21 Thread Nick Coghlan
Diez B. Roggisch wrote: Nick Coghlan wrote: If this only has to work for classes created for the purpose (rather than for an arbitrary class): Certainly a step into the direction I meant - but still missing type declarations. And that's what at least I'd like to see - as otherwise you don't know w

Re: PyCon Preliminary Program Announced!

2005-01-21 Thread A.M. Kuchling
On Thu, 20 Jan 2005 22:52:13 -0500, Tim Peters <[EMAIL PROTECTED]> wrote: > The web page needs better formatting. In general, there are no more Suggestions for improvement are welcome. Perhaps the Wiki version of the schedule, at http://www.python.org/moin/PyConDC2005/Schedule, may be

Re: Zen of Python

2005-01-21 Thread Nick Coghlan
Paul Rubin wrote: You snipped out the examples I gave, like [x*x for x in range(5)] leaving unnecessary residue in the name space. Was it not obvious from the beginning that that was a kludge? If it was obviously a kludge, was it not obvious that there would be reason to want to fix it someday?

Re: PyCon Preliminary Program Announced!

2005-01-21 Thread Timothy Fitz
> I don't care much for "parallel tracks" myself, because I want to hear > basically everything. But we had more proposals of higher quality > this year than ever before, so it came down to scheduling more talks > in parallel than ever before too, or rejecting perfectly good > proposals. Will t

need help on generator...

2005-01-21 Thread Joh
hello, i'm trying to understand how i could build following consecutive sets from a root one using generator : l = [1,2,3,4] would like to produce : [1,2], [2,3], [3,4], [1,2,3], [2,3,4] but unfortunately can not, i guess i can do it by using sub generator and maybe enumerate, please if you h

Funny Python error messages

2005-01-21 Thread Will Stuyvesant
Add your funny or surprising Python error messages to this thread. A requirement is that you should also show (minimal) code that produces the message. Put the code below, so people can think about how to generate the message first, a little puzzle if you like. Perhaps this will even be a usefu

Re: Graph and Table implementation

2005-01-21 Thread Peter Hansen
Jan Rienyer Gadil wrote: could anyone please help me! what and how is the best implementation of creating a table based on What is a "table", to you? It could mean anything from something you intend to print, to a GUI-based representation similar to a spreadsheet, to a simple two-dimensional array

Re: Funny Python error messages

2005-01-21 Thread Peter Hansen
Will Stuyvesant wrote: Perhaps this will even be a useful thread, to brighten the life of the brave people doing the hard work of providing us with error messages. My first one (i'm learning, i'm learning) is TypeError: 'callable-iterator' object is not callable # >>> it = iter(lambda:0, 0) # >>> i

Re: need help on generator...

2005-01-21 Thread Denis S. Otkidach
On 21 Jan 2005 05:58:03 -0800 [EMAIL PROTECTED] (Joh) wrote: > i'm trying to understand how i could build following consecutive sets > from a root one using generator : > > l = [1,2,3,4] > > would like to produce : > > [1,2], [2,3], [3,4], [1,2,3], [2,3,4] >>> def consecutive_sets(l): ...

Re: need help on generator...

2005-01-21 Thread Laszlo Zsolt Nagy
Joh wrote: hello, i'm trying to understand how i could build following consecutive sets from a root one using generator : l = [1,2,3,4] would like to produce : [1,2], [2,3], [3,4], [1,2,3], [2,3,4] Do you mean: [1,2], [2,3], [3,4], [1,2,3], [2,3,4], [1,3,4] (E.g. all elements in the power set e

Re: TypeError error on tkinter.createfilehandler dummy example

2005-01-21 Thread Pedro Werneck
Hi, The createfilehandler is not supported on Windows since Tcl/TK 8.0. tkinter.createfilehandler is None, so you get the NoneType is not callable error. I wrote a simple module with a mix-in class to solve this problem. I had a lote of code using it on linux and needed to run it on Windows. I

Re: need help on generator...

2005-01-21 Thread Craig Ringer
On Fri, 2005-01-21 at 17:14 +0300, Denis S. Otkidach wrote: > On 21 Jan 2005 05:58:03 -0800 > [EMAIL PROTECTED] (Joh) wrote: > > > i'm trying to understand how i could build following consecutive sets > > from a root one using generator : > > > > l = [1,2,3,4] > > > > would like to produce : > >

ElementTree.findtext()

2005-01-21 Thread Richie Hindle
Hi, I can't get ElementTree.findtext() to work with anything other than a single-level path: >>> from elementtree import ElementTree >>> tree = ElementTree.fromstring("""\ ... ... ... ... The title ... ... ... """) >>> print tree.findtext("*/title") The title >>> print tree.findtext("html/he

Re: PyCon Preliminary Program Announced!

2005-01-21 Thread Steve Holden
Timothy Fitz wrote: I don't care much for "parallel tracks" myself, because I want to hear basically everything. But we had more proposals of higher quality this year than ever before, so it came down to scheduling more talks in parallel than ever before too, or rejecting perfectly good proposals.

Re: Example of resolving an alias using Carbon.File module?

2005-01-21 Thread fortepianissimo
Problem solved: from Carbon.File import * fs, _, _ = ResolveAliasFile('/some/path', 1) print fs.as_pathname() -- http://mail.python.org/mailman/listinfo/python-list

Re: tkinter socket client ?

2005-01-21 Thread Neal Norwitz
You are probably looking for Tkinter.createfilehandler(). Here are some snippets to get you started: tk_reactor = Tkinter._tkinter self.sd = socket(AF_INET, SOCK_STREAM) self.sd.connect((HOST, PORT)) tk_reactor.createfilehandler(self.sd, Tkinter.READABLE, self.handle_input) def handle_input(self

Dynamic properties

2005-01-21 Thread michael
Hello again, I have a dictionary with the following content : 'LZ': {'type': 'N', 'bytes': '8'}, 'LVI000': {'type': 'N', 'bytes': '10'} This could be seen as a interface description to deal with an external program that needs a 18 Byte communication area. 8 and 18 Bytes have to be interp

Re: Print a string in binary format

2005-01-21 Thread Nick Coghlan
neutrino wrote: Greetings to the Python gurus, I have a binary file and wish to see the "raw" content of it. So I open it in binary mode, and read one byte at a time to a variable, which will be of the string type. Now the problem is how to print the binary format of that charater to the standard o

Re: ElementTree.findtext()

2005-01-21 Thread Richie Hindle
[me] > >>> print tree.findtext("html/head/title") > None I realised what the problem was the second after I hit Send (why is it never the second *before*?) The tree represents the top-level element, so of course searching within it for 'html' fails. What I should say is this: >>> print tree.f

Re: how to write a tutorial

2005-01-21 Thread John Hunter
> "Xah" == Xah Lee <[EMAIL PROTECTED]> writes: Xah> at places often a whole paragraph on some so called computer Xah> science jargons should be deleted. They are there more to Xah> showcase inane technicality than do help the Xah> reader. (related, many passages with jargons sh

Re: tkinter socket client ?

2005-01-21 Thread Tonino
hi there , yeah - had a look at createfilehandler() - was a bit confusing - but your example helps ;) Thanks Tonino -- http://mail.python.org/mailman/listinfo/python-list

Re: how to write a tutorial

2005-01-21 Thread Frank Buss
drewc <[EMAIL PROTECTED]> wrote: > What does this have to do with Lisp? (i'm in c.l.l). he is a troll, but one who confess this fact: http://www.xahlee.org/Netiquette_dir/troll.html -- Frank Buß, [EMAIL PROTECTED] http://www.frank-buss.de, http://www.it4-systems.de -- http://mail.python.org/m

Re: need help on need help on generator...

2005-01-21 Thread Francis Girard
Hi, I recently read David Mertz (IBM DeveloperWorks) about generators and got excited about using lazy constructs in my Python programming. But besides the fact that generators are either produced with the new "yield" reserved word or by defining the __new__ method in a class definition, I don

Re: need help on generator...

2005-01-21 Thread Craig Ringer
On Fri, 2005-01-21 at 22:38 +0800, Craig Ringer wrote: > consecutive_sets = ( x[offset:offset+subset_size] > for subset_size in xrange(2, len(x)) > for offset in xrange(0, len(x) + 1 - subset_size) ) Where 'x' is list to operate on, as I should've initial

wx.BoxSizer problem

2005-01-21 Thread Laszlo Zsolt Nagy
Hi All, Here is the code of a frame: import wx class PanelDatabaseDefinition(wx.Panel): def __init__(self,parent): wx.Panel.__init__(self,parent) self.sizer = wx.BoxSizer(wx.VERTICAL) self.SetSizer(self.sizer) self.sizer.Add(wx.Button(self,label="test1"),flag=wx.EXPAND,pr

Re: Dynamic properties

2005-01-21 Thread Nick Coghlan
michael wrote: My first try is : fget = lambda self: mygetattr(self, attrname) fset = lambda self, value: mysetattr (self, attrname, value) fdel = lambda self: mydelattr(self, attrname) # fget, fset, fdel are used to reconstruct the byte field setattr (self, key, property (fget, fset, fdel)) setatt

Re: PyCon Preliminary Program Announced!

2005-01-21 Thread Tim Peters
[A.M. Kuchling] > Suggestions for improvement are welcome. Perhaps the Wiki version of > the schedule, at http://www.python.org/moin/PyConDC2005/Schedule, > may be better. It is, but the 2004 schedule was really what I had in mind (very readable!): http://www.python.org/pycon/dc2004/schedule

Re: Graph and Table implementation

2005-01-21 Thread Thomas Bartkus
"Jan Rienyer Gadil" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > could anyone please help me! > > what and how is the best implementation of creating a table based on > data coming from the serial port ? and also how would i be able to > create graphs (2D) based on these data? > >

Re: Dynamic properties

2005-01-21 Thread Craig Ringer
On Fri, 2005-01-21 at 06:43 -0800, michael wrote: > setattr (self, key, property (fget, fset, fdel)) > it gives me > > > > What am I doing wrong here Properties must be defined in the class, not the instance, to work as expected. (Edit: Nick Coghlan explained this more accurately). You can

Re: need help on generator...

2005-01-21 Thread Peter Otten
Joh wrote: > i'm trying to understand how i could build following consecutive sets > from a root one using generator : > > l = [1,2,3,4] > > would like to produce : > > [1,2], [2,3], [3,4], [1,2,3], [2,3,4] > > but unfortunately can not, i guess i can do it by using sub generator > and maybe e

ANN: P4Python 0.5 - Interface to Perforce

2005-01-21 Thread Robert Cowham
Have just released this to PyPI. http://www.python.org/pypi?:action=display&name=P4Python&version=0.5 Name: P4Python Version: 0.5 Author: Robert Cowham Author email: robert at vaccaperna co uk Home page: http://public.perforce.com/guest/robert_cowham/perforce/API/python/index .html Dow

Configuring Python for Tk on Mac

2005-01-21 Thread Martyn Quick
On my desk here at work I have a Mac G4 running Mac OS X v10.2.8. When I go into a terminal and type "python" up comes a nice python interface and all seems great. However when I type "import Tkinter" I'm greeted by the following error. >>> import Tkinter Traceback (most recent call last): Fil

Re: need help on need help on generator...

2005-01-21 Thread Craig Ringer
On Fri, 2005-01-21 at 16:05 +0100, Francis Girard wrote: > I recently read David Mertz (IBM DeveloperWorks) about generators and > got excited about using lazy constructs in my Python programming. Speaking of totally great articles, and indirectly to lazyness (though not lazyily evaluated construc

Tarfile module error

2005-01-21 Thread Beowulf
Hello, I'm using Python to automate admin tasks on my job. We use Windoze 2000 as desktop platform. When executing this daily backup scripts I get the following error: Traceback (most recent call last): File "C:\UTILS\backup.py", line 8, in ? TarFileBackup = tarfile.open(NewBackupFilename,

Python-enterprise (integration) SIG/mailinglist/etc.?

2005-01-21 Thread Wolfgang Keller
Hello, Python seems to be used quite a lot for (the integration of) enterprise applications. Just as an example, there are at least three (projects for the implementation of) ERP systems in Python: - GNUenterprise - ERP5 - TinyERP There are also a lot of different modules already available which

Re: need help on generator...

2005-01-21 Thread Francis Girard
Le vendredi 21 Janvier 2005 16:06, Craig Ringer a ÃcritÂ: > On Fri, 2005-01-21 at 22:38 +0800, Craig Ringer wrote: > > consecutive_sets = ( x[offset:offset+subset_size] > > for subset_size in xrange(2, len(x)) > > for offset in xrange(0, len(x) + 1 - subset

MPI and python+threads on IRIX

2005-01-21 Thread Marc Poinot
Hi, I'm trying to add a dynamic module using MPI on a 2.3.4 Python with threads (posix). The interpreter blocks into the dlopen (dynload_shlib.c) if any reference to the IRIX libmpi.so (actually SGI/IRIX 6.5) appears. The docs say that the use of MPI+dlopen requires a call to MPI_Init_thread befo

Re: need help on need help on generator...

2005-01-21 Thread Francis Girard
Really, thank you Craig Ringer for your great answer. > I'm afraid I can't help you with that. I tend to take the view that side > effects in lazily executed code are a bad plan, and use lazy execution > for things where there is no reason to care when the code is executed. I completly agree wi

Re: need help on generator...

2005-01-21 Thread Craig Ringer
On Fri, 2005-01-21 at 16:54 +0100, Francis Girard wrote: > First, I think that you mean : > > consecutive_sets = [ x[offset:offset+subset_size] > for subset_size in xrange(2, len(x)) > for offset in xrange(0, len(x) + 1 - subset_size)] > > (with square

Re: how to write a tutorial

2005-01-21 Thread CBFalconer
Xah Lee wrote: > > i've started to read python tutorial recently. > http://python.org/doc/2.3.4/tut/tut.html > > Here are some quick critique: This has absolutely nothing to do with c.l.c, nor most of the cross-posted groups. F'ups set. Why did you do such a foul cross-posting in the first pla

circular iteration

2005-01-21 Thread Flavio codeco coelho
hi, is there a faster way to build a circular iterator in python that by doing this: c=['r','g','b','c','m','y','k'] for i in range(30): print c[i%len(c)] thanks, Flávio -- http://mail.python.org/mailman/listinfo/python-list

Re: circular iteration

2005-01-21 Thread Duncan Booth
Flavio codeco coelho wrote: > hi, > > is there a faster way to build a circular iterator in python that by > doing this: > > c=['r','g','b','c','m','y','k'] > > for i in range(30): > print c[i%len(c)] > > thanks, > > Flávio > >>> import itertools >>> c=['r','g','b','c','m','y','k'] >>>

Re: problems with duplicating and slicing an array

2005-01-21 Thread beliavsky
Yun Mao wrote: >Thanks for the help. numarray doesn't provide what I look for either. e.g. >a = array( [[1,2,3],[4,5,6]] ) >I sometimes what this: a[ [1,0], :], or even >a[ [1,0], [0,1] ] , which should give me >[[4, 5], [1,2]] I think Fortran 90 and 95 have the array slicing you want. For examp

Re: how to write a tutorial

2005-01-21 Thread M Jared Finder
Xah Lee wrote: i've started to read python tutorial recently. http://python.org/doc/2.3.4/tut/tut.html What does this have to do with Perl, Lisp, Scheme, or C? -- MJF -- http://mail.python.org/mailman/listinfo/python-list

Re: circular iteration

2005-01-21 Thread Simon Brunning
On 21 Jan 2005 08:31:02 -0800, Flavio codeco coelho <[EMAIL PROTECTED]> wrote: > hi, > > is there a faster way to build a circular iterator in python that by doing > this: > > c=['r','g','b','c','m','y','k'] > > for i in range(30): > print c[i%len(c)] I don''t know if it's faster, but: >>

Re: need help on generator...

2005-01-21 Thread Francis Girard
Thank you, I immediately download version 2.4, switching from version 2.3. Francis Girard FRANCE Le vendredi 21 Janvier 2005 17:34, Craig Ringer a ÃcritÂ: > On Fri, 2005-01-21 at 16:54 +0100, Francis Girard wrote: > > First, I think that you mean : > > > > consecutive_sets = [ x[offset:offset+su

Re: Zen of Python

2005-01-21 Thread Skip Montanaro
Steve> The fact that a bright bunch like the Python developers didn't Steve> realize that it would be sensible to have a local scope for the Steve> list comprehension variable is a perfect demonstration of that Steve> point. Actually, I seem to recall that the topic came up, but a

Re: ElementTree.findtext()

2005-01-21 Thread Skip Montanaro
Richie> I realised what the problem was the second after I hit Send (why Richie> is it never the second *before*?) So you could enlighten those of us who didn't realize what the problem was, even ten seconds later than that... Richie> The tree represents the top-level element, so

Re: Funny Python error messages

2005-01-21 Thread Fredrik Lundh
Peter Hansen wrote: >> My first one (i'm learning, i'm learning) is >> >> TypeError: 'callable-iterator' object is not callable >> >> # >>> it = iter(lambda:0, 0) >> # >>> it() >> # TypeError: 'callable-iterator' object is not callable > > Given that the supposed humour depends on the *name* of >

Re: circular iteration

2005-01-21 Thread Fredrik Lundh
"Flavio codeco coelho" wrote: > is there a faster way to build a circular iterator in python that by doing > this: > > c=['r','g','b','c','m','y','k'] > > for i in range(30): >print c[i%len(c)] have you benchmarked this, and found it lacking, or are you just trying to optimize prematurely?

Re: Zen of Python

2005-01-21 Thread Steve Holden
Skip Montanaro wrote: Steve> The fact that a bright bunch like the Python developers didn't Steve> realize that it would be sensible to have a local scope for the Steve> list comprehension variable is a perfect demonstration of that Steve> point. Actually, I seem to recall that the

Re: Tarfile module error

2005-01-21 Thread Kartic
Your NewBackupFilename contains ":" which is not a valid character in a filename in Windows. You could do something like this: >>> NewBackupFilename = DirBackup + '\\' + '%s' % str(datetime.today()).replace(':', '-') + '.tar.bz2' >>> NewBackupFilename 'c:skpdc01Backups\\2005-01-21 12-26-21

Re: DevX: "Processing EDI Documents into XML with Python"

2005-01-21 Thread Jeremy Jones
Claudio Grondi wrote: "You don't have to rely on expensive and proprietary EDI conversion software to parse, validate, and translate EDI X12 data to and from XML; you can build your own translator with any modern programming language, such as Python." by Jeremy Jones http://www.devx.com/e

Re: wx.BoxSizer problem

2005-01-21 Thread Ed Leafe
On Jan 21, 2005, at 10:07 AM, Laszlo Zsolt Nagy wrote: My problem is that only one of the buttons is visible and that one is not expanded. (System: Windows, Python 2.3.4, wxPython 2.5.3) Works as expected on Mac OS X 10.3.7, python 2.3.4, wxPython 2.5.2.8. ___/ / __/ / / Ed

Re: What YAML engine do you use?

2005-01-21 Thread rm
Paul Rubin wrote: Reinhold Birkenfeld <[EMAIL PROTECTED]> writes: For those of you who don't know what YAML is: visit http://yaml.org/! You will be amazed, and never think of XML again. Well, almost. Oh please no, not another one of these. We really really don't need it. well, I did look at it, a

RE: Class introspection and dynamically determining function arguments

2005-01-21 Thread Mark English
Diez B. Roggisch wrote: > According to this > http://www-106.ibm.com/developerworks/library/l-pyint.html > > not really - and there are no special moduls neccessary, as > everything is at your hands using __dict__ and so on. Thanks for the link. I'd read that article but found it was too introd

Re: xml parsing escape characters

2005-01-21 Thread Luis P. Mendes
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 ~From your experience, do you think that if this wrong XML code could be meant to be read only by somekind of Microsoft parser, the error will not occur? I'll try to explain: xml producer writes the code in Windows platform and 'thinks' that every clie

Re: xml parsing escape characters

2005-01-21 Thread Luis P. Mendes
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 ~From your experience, do you think that if this wrong XML code could be meant to be read only by somekind of Microsoft parser, the error will not occur? I'll try to explain: xml producer writes the code in Windows platform and 'thinks' that every clie

Simple (newbie) regular expression question

2005-01-21 Thread André Roberge
Sorry for the simple question, but I find regular expressions rather intimidating. And I've never needed them before ... How would I go about to 'define' a regular expression that would identify strings like __alphanumerical__ as in __init__ (Just to spell things out, as I have seen underscores d

Re: What YAML engine do you use?

2005-01-21 Thread Fredrik Lundh
"rm" wrote: > well, I did look at it, and as a text format is more readable than XML is. judging from http://yaml.org/spec/current.html (750k), the YAML designers are clearly insane. that's the most absurd software specification I've ever seen. they need help, not users. -- http://mail.

Re: Funny Python error messages

2005-01-21 Thread Carl Banks
Peter Hansen wrote: > Will Stuyvesant wrote: > > Perhaps this will even be a useful thread, to brighten the > > life of the brave people doing the hard work of providing us > > with error messages. > > > > My first one (i'm learning, i'm learning) is > > > > TypeError: 'callable-iterator' object i

why am I getting a segmentation fault?

2005-01-21 Thread Jay donnell
I have a short multi-threaded script that checks web images to make sure they are still there. I get a segmentation fault everytime I run it and I can't figure out why. Writing threaded scripts is new to me so I may be doing something wrong that should be obvious :( google messes up the python cod

Re: What YAML engine do you use?

2005-01-21 Thread A.M. Kuchling
On Fri, 21 Jan 2005 18:30:47 +0100, rm <[EMAIL PROTECTED]> wrote: > Nowadays, people are trying to create binary XML, XML databases, > graphics in XML (btw, I'm quite impressed by SVG), you have XSLT, you > have XSL-FO, ... . Which is an argument in favor of XML -- it's where the activi

Re: xml parsing escape characters

2005-01-21 Thread Fredrik Lundh
Luis P. Mendes wrote: > xml producer writes the code in Windows platform and 'thinks' that every > client will read/parse the code with a specific Windows parser. Could > that (wrong) XML code parse correctly in that kind of specific Windows > client? not if it's an XML parser. > Do you know an

Pydev 0.8.5 released!

2005-01-21 Thread Fabio Zadrozny
Hi All, PyDev - Python IDE (Python development enviroment for Eclipse) version 0.8.5 has just been released. This release has as its main feature a new Code Completion. Check the homepage for more details (http://pydev.sourceforge.net/). Other things in the release include some bugs corrected, a

short programming projects for kids

2005-01-21 Thread bobdc
I will be teaching an "Introduction to Programming" class to some middle school aged children and will be using Python, obviously. Does anyone have suggestions for simple little programs to create and analyze with them after I get past turtle graphics? Turtle graphics will be plenty for the first

Re: Configuring Python for Tk on Mac

2005-01-21 Thread Matt
I googled around and it looks like it might be a permissions error: http://mail.python.org/pipermail/pythonmac-sig/2002-November/006809.html I don't have a Mac, tho', so I have no idea if it works... HTH -- http://mail.python.org/mailman/listinfo/python-list

Re: Dynamic properties

2005-01-21 Thread Jeremy Bowers
On Fri, 21 Jan 2005 23:27:28 +0800, Craig Ringer wrote: > The chances are that whatever you want to do with dynamically created > properties is better done with __getattr__ and __setattr__ instead. Rather than post my own comment, I'd like to highlight this, emphasize it, and underline it twice. T

Re: how to write a tutorial

2005-01-21 Thread Jeremy Bowers
On Fri, 21 Jan 2005 03:08:50 -0800, Xah Lee wrote: > i've started to read python tutorial recently. > http://python.org/doc/2.3.4/tut/tut.html > > Here are some quick critique: You don't have the respect points for anyone to give a damn. Step one would be demonstrating that you understand the la

Re: Configuring Python for Tk on Mac

2005-01-21 Thread Craig Ringer
On Fri, 2005-01-21 at 07:39 -0800, Martyn Quick wrote: > On my desk here at work I have a Mac G4 running Mac OS X v10.2.8. > > When I go into a terminal and type "python" up comes a nice python > interface and all seems great. However when I type "import Tkinter" > I'm greeted by the following er

Re: Unbinding multiple variables

2005-01-21 Thread Johnny Lin
thanks everyone for the replies! John Hunter, yep, this is Johnny Lin in geosci :). re using return: the problem i have is somewhere in my code there's a memory leak. i realize return is supposed to unbind all the local variables, but since the memory leak is happening despite return, i thought

Re: short programming projects for kids

2005-01-21 Thread André Roberge
bobdc wrote: I will be teaching an "Introduction to Programming" class to some middle school aged children and will be using Python, obviously. Does anyone have suggestions for simple little programs to create and analyze with them after I get past turtle graphics? Turtle graphics will be plenty fo

  1   2   >