Re: dictionary of list from a file

2006-10-04 Thread Paul McGuire
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi guys, > this is my first post. my "programming" background is perlish scripting > and now I am learning python. I need to create a dictionary of list > from a file. Normally in perl I use to do like: > > while(){ > @info=spl

Re: How can I correct an error in an old post?

2006-10-04 Thread Steve Holden
Jorgen Grahn wrote: > On Mon, 02 Oct 2006 16:36:24 +0100, Steve Holden <[EMAIL PROTECTED]> wrote: > >>Jorgen Grahn wrote: >> >>>On 1 Oct 2006 10:18:59 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: >>> >>> >>> and I wish to add my findings to the post, to prevent others from takin

Re: sax barfs on unicode filenames

2006-10-04 Thread John Machin
Diez B. Roggisch wrote: > Edward K. Ream wrote: > > > Hi. Presumably this is a easy question, but anyone who understands the > > sax docs thinks completely differently than I do :-) > > > > > > > > Following the usual cookbook examples, my app parses an open file as > > follows:: > > > > > > > >

Re: PEP 358 and operations on bytes

2006-10-04 Thread John Machin
Paul Rubin wrote: > "John Machin" <[EMAIL PROTECTED]> writes: > > So why haven't you been campaigning for regular expression support for > > sequences of int, and for various array.array subtypes? > > regexps work on byte arrays. But not on other integer subtypes. If regexps should not be restric

Re: A Universe Set

2006-10-04 Thread MonkeeSage
Jorgen Grahn wrote: > - infinite xrange()s Fun. How about in-memory objects which use no memory, and self-referential anonymous functions, and object states without objects... Regards, Jordan -- http://mail.python.org/mailman/listinfo/python-list

Re: Python to use a non open source bug tracker?

2006-10-04 Thread skip
Giovanni> In fact, are you absolutely positive that you need so much Giovanni> effort to maintain an existing bugtracker installation? The development group's experience with SF and I think to a lesser extent, Roundup in its early days, and more generally with other components of the deve

Re: A Universe Set

2006-10-04 Thread Paul McGuire
"Jorgen Grahn" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > - the black hole function 'def f(*args): pass' > - the identity function 'def f(x): return x' > Also not so farfetched. See the disable and enable decorators at http://wiki.python.org/moin/PythonDecoratorLibrary#head-8

Re: Python to use a non open source bug tracker?

2006-10-04 Thread skip
Istvan> I think you are missing the point. Switching to a different Istvan> tracker is not such a big deal. Having a really good tracker is Istvan> a big deal. No, actually switching trackers can be one big pain in the ass. You probably aren't aware of how hard it's been for the Pyth

Re: can't open chm files all of a sudden

2006-10-04 Thread John Salerno
John Machin wrote: > Many things might cause an error dialogue -- further info needed. Thanks, I will try your suggestions when I get home. As far as I know, this only started happening yesterday (although maybe I haven't opened the files in a day or two). All I've installed/uninstalled since t

Re: Python/Tkinter crash.

2006-10-04 Thread Eric Brunel
On Wed, 04 Oct 2006 10:33:55 +0200, Hendrik van Rooyen <[EMAIL PROTECTED]> wrote: > Hi, > > I get the following: > > [EMAIL PROTECTED]:~/Controller/lib> python display.py > UpdateStringProc should not be invoked for type font > Aborted > > and I am back at the bash prompt - this is most frustrat

Re: Making posts to an ASP.NET webform.

2006-10-04 Thread Bernard
Bernard wrote: > Gabriel Genellina wrote: > > At Monday 2/10/2006 13:05, Bernard wrote: > > > > > > > Has anyone tried what I'm doing? and if you tried how have you > > > > > succeeded getting the data back after the post action? > > > > Use a packet sniffer or something to look at an actual POST

Re: sax barfs on unicode filenames: workaround

2006-10-04 Thread Edward K. Ream
Happily, the workaround is easy. Replace theFile with: # Use cStringIo to avoid a crash in sax when inputFileName has unicode characters. s = theFile.read() theFile = cStringIO.StringIO(s) My first attempt at a workaround was to use: s = theFile.read() parser.parseString(s) but the expat pars

Re: A Universe Set

2006-10-04 Thread Peter Otten
Jean-Paul Calderone wrote: > On Wed, 04 Oct 2006 11:00:28 -0400, Leif K-Brooks <[EMAIL PROTECTED]> > wrote: >>Jorgen Grahn wrote: >>> - infinite xrange()s >> >>itertools.count()? > > Not quite: > > >>> import sys, itertools > >>> c = itertools.count(sys.maxint) > >>> c.next() > 2

Re: changing numbers to spellings

2006-10-04 Thread Paul Rubin
Steve Holden <[EMAIL PROTECTED]> writes: > You should get some clue about the number conversion (not to menion a > bunch of code you can lift :) from > > http://www.python.org/pycon/dc2004/papers/42/ex1-C/num2eng.py For some reason I felt like writing another one, that doesn't use as much re

item access time: sets v. lists

2006-10-04 Thread David Isaac
Is it expected for access to set elements to be much slower than access to list elements? Explanation? Thanks, Alan Isaac >>> t1=timeit.Timer("for i in set(xrange(1)):pass","") >>> t2=timeit.Timer("for i in list(xrange(1)):pass","") >>> t1.timeit(1000) 9.806250235714316 >>> t2.timeit(1000

Re: PEP 358 and operations on bytes

2006-10-04 Thread Paul Rubin
"John Machin" <[EMAIL PROTECTED]> writes: > But not on other integer subtypes. If regexps should not be restricted > to text, they should work on domains whose number of symbols is greater > than 256, shouldn't they? I think the underlying regexp C library isn't written that way. I can see reason

Re: How to ask sax for the file encoding

2006-10-04 Thread Diez B. Roggisch
Edward K. Ream wrote: >> [The value of the encoding field] _could_ be retained, but for what >> purpose? > > I'm asking this question because my app needs it :-) > Imo, there is *no* > information in any xml file that can be considered irrelvant. It sure is! The encoding _is_ irrelevant, in

Re: A Universe Set

2006-10-04 Thread Istvan Albert
Jorgen Grahn wrote: > I have been craving for some similar things for a while, and I'm still not > sure if they are good ideas, or brain damage caused by studying functional > programming at Uni. This is a self correcting situation, as ayone who understands why they need this can surely write th

Re: Need help with syntax on inheritance.

2006-10-04 Thread Peter Otten
SpreadTooThin wrote: > the =() syntax indicates what? No special syntax, just an empty tuple as a default parameter. In this case I could have used an empty list, too, but I thought I'd spare you the dangers of mutable default values as explained here: http://www.python.org/doc/faq/general/#id53

Re: can't open chm files all of a sudden

2006-10-04 Thread Gabriel Genellina
At Wednesday 4/10/2006 01:32, John Salerno wrote: > I tried opening my Python chm docs just now, as well as the one for > wxPython, and both are giving me an error dialog when I double-click > them and I can't open them. This happened apparently for no reason, just > today. I even reset but that

Re: item access time: sets v. lists

2006-10-04 Thread Dennis Benzinger
On Wed, 04 Oct 2006 16:02:56 GMT "David Isaac" <[EMAIL PROTECTED]> wrote: > Is it expected for access to set elements to be much > slower than access to list elements? Explanation? > Thanks, > Alan Isaac > > >>> t1=timeit.Timer("for i in set(xrange(1)):pass","") > >>> t2=timeit.Timer("for i

Re: item access time: sets v. lists

2006-10-04 Thread Paul McGuire
"David Isaac" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Is it expected for access to set elements to be much > slower than access to list elements? Explanation? > Thanks, > Alan Isaac > t1=timeit.Timer("for i in set(xrange(1)):pass","") t2=timeit.Timer("for i in

Re: loop beats generator expr creating large dict!?

2006-10-04 Thread David Isaac
> Alan Isaac wrote: > > The current situation is: use a loop because the obvious generator > > approach is not efficient. "Fredrik Lundh" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > "not efficient" compared to what ? I already guess that I've missed your point, but to prove it

Re: How to ask sax for the file encoding

2006-10-04 Thread Edward K. Ream
> The encoding _is_ irrelevant, in the very moment you get unicode strings. We shall have to disagree about this. My use case is perfectly reasonable, imo. > If you write out xml again, use whatever encoding suits you best. What suits me best is what the *user* specified, and that got put in t

libgmail: attaching files

2006-10-04 Thread wal
How does one attach files to emails using libgmail? The following code http://pramode.net/articles/lfy/fuse/4.txt works fine when said files are simple text files, but it failes as soon as the files are wild binary files, even attaching the source of an email in a text file (.eml files) failes.

Re: preemptive OOP?

2006-10-04 Thread Kent Johnson
Mark Elston wrote: > * Kent Johnson wrote (on 9/30/2006 2:04 PM): >> John Salerno wrote: >>> So my question in general is, is it a good idea to default to an OOP >>> design like my second example when you aren't even sure you will need >>> it? I know it won't hurt, and is probably smart to do som

Re: can't open chm files all of a sudden

2006-10-04 Thread John Salerno
Dennis Lee Bieber wrote: > On Wed, 04 Oct 2006 15:55:11 GMT, John Salerno > <[EMAIL PROTECTED]> declaimed the following in comp.lang.python: > >> the files in a day or two). All I've installed/uninstalled since then >> was HTML Kit. I'm not on a network, it's just me. I redownloaded the chm >> f

Re: can't open chm files all of a sudden

2006-10-04 Thread John Salerno
Gabriel Genellina wrote: > At Wednesday 4/10/2006 01:32, John Salerno wrote: > >> > I tried opening my Python chm docs just now, as well as the one for >> > wxPython, and both are giving me an error dialog when I double-click >> > them and I can't open them. This happened apparently for no reason,

Re: Tk: filling a frame with a widget

2006-10-04 Thread jmdeschamps
Paolo Pantaleo wrote: > I have this code > > from Tkinter import * > > root=Tk() > Button(root).pack(fill=BOTH) > root.mainloop() > > I would expect the button filling all the client draw area of the > Frame, but when I resize the root window the button becomes wider, but > not higher ( I get some

Re: Python to use a non open source bug tracker?

2006-10-04 Thread Giovanni Bajo
[EMAIL PROTECTED] wrote: > Giovanni> In fact, are you absolutely positive that you need so > much Giovanni> effort to maintain an existing bugtracker > installation? > > The development group's experience with SF and I think to a lesser > extent, Roundup in its early days, and more general

Re: preemptive OOP?

2006-10-04 Thread John Salerno
Kent Johnson wrote: >> There is certainly a *lot* of 'Gratuitous OOP' (GOOP?) out there. > > In my experience a lot of GOOP results LOL. Good thing we didn't go with the acronym from my phrase "preemptive OOP" ;) -- http://mail.python.org/mailman/listinfo/python-list

Re: Python to use a non open source bug tracker?

2006-10-04 Thread Giovanni Bajo
Steve Holden wrote: > No, I'm not on the infrastructure list, but I know that capable people > *are*: and you know I am quite capable of donating my time to the > cause, when I have it to spare (and sometimes even when I don't). > > Perhaps what I *should* have written was "Sadly *many* people spe

Re: item access time: sets v. lists

2006-10-04 Thread David Isaac
Paul M. wrote: > Random access to item in list/set when item exists > set -> 0.000241650824337 > list -> 0.0245168031132 > > Random access to item in list/set when item does not exist > set -> 0.000187733357172 > list -> 0.522086186932 OK, that's a much better set of answers including to questi

Is there an alternative to os.walk?

2006-10-04 Thread Bruce
Hi all, I have a question about traversing file systems, and could use some help. Because of directories with many files in them, os.walk appears to be rather slow. I`m thinking there is a potential for speed-up since I don`t need os.walk to report filenames of all the files in every directory it v

Re: How to ask sax for the file encoding

2006-10-04 Thread Rob Wolfe
"Edward K. Ream" <[EMAIL PROTECTED]> writes: > Can anyone tell me how the content handler can determine the encoding of the > file? Can sax provide this info? Try this: from xml.parsers import expat s = """ Title Chapter 1 """ class MyParser(object): def XmlDecl(self, version, encodin

Re: item access time: sets v. lists

2006-10-04 Thread Neil Cerutti
On 2006-10-04, David Isaac <[EMAIL PROTECTED]> wrote: > Paul M. wrote: >> Random access to item in list/set when item exists >> set -> 0.000241650824337 >> list -> 0.0245168031132 >> >> Random access to item in list/set when item does not exist >> set -> 0.000187733357172 >> list -> 0.52208618693

Re: switching to numpy and failing, a user story

2006-10-04 Thread [EMAIL PROTECTED]
sturlamolden wrote: > Travis E. Oliphant wrote: > > > Definitely not true. People in Singapore, Japan, Ghana, South Africa, > > France, Germany, New Zealand, Australia, and many other countries are > > using NumPy successfully. Gratefully, a few have contributed by buying > > the book, but a lot

Re: string: __iter__()?

2006-10-04 Thread mrquantum
John Roth: > The iter() builtin creates an iterator for any > object that obeys the sequence protocol. > Since strings obey the sequence protocol there > is no real advantage to adding yet another > protocol to an already very fat object. Okay! > This does, however, mean that testing > for the

Re: How to ask sax for the file encoding

2006-10-04 Thread Irmen de Jong
Edward K. Ream wrote: > What suits me best is what the *user* specified, and that got put in the > first xml line. > I'm going to have to parse this line myself. Please consider adding some elements to the document itself that describe the desired output format, such as: ... utf-8 ... Thi

Re: Python to use a non open source bug tracker?

2006-10-04 Thread fuzzylollipop
Giovanni Bajo wrote: > Hello, > > I just read this mail by Brett Cannon: > http://mail.python.org/pipermail/python-dev/2006-October/069139.html > where the "PSF infrastracture committee", after weeks of evaluation, > recommends > using a non open source tracker (called JIRA - never heard before o

Re: preemptive OOP?

2006-10-04 Thread Mark Elston
* Kent Johnson wrote (on 10/4/2006 10:04 AM): > Mark Elston wrote: >> ... >> Without this prior planning, any expansion (not to mention bug fixing) >> becomes more difficult and makes the resulting code more brittle. While >> not all planning for the future requires OO, this is one mechanism that

Re: preemptive OOP?

2006-10-04 Thread Mark Elston
* John Salerno wrote (on 10/4/2006 10:18 AM): > Kent Johnson wrote: > >>> There is certainly a *lot* of 'Gratuitous OOP' (GOOP?) out there. >> >> In my experience a lot of GOOP results > > LOL. Good thing we didn't go with the acronym from my phrase "preemptive > OOP" ;) Oops. I couldn't res

Re: switching to numpy and failing, a user story

2006-10-04 Thread [EMAIL PROTECTED]
Travis E. Oliphant wrote: > [EMAIL PROTECTED] wrote: > > - I guess I should just buy the documentation. I don't like this idea, > > because I think it's counter-productive to the project to have payware > > docs (would Python be successful if you had to buy the documentation? I > > don't think so)

Re: Is there an alternative to os.walk?

2006-10-04 Thread Irmen de Jong
Bruce wrote: > Hi all, > I have a question about traversing file systems, and could use some > help. Because of directories with many files in them, os.walk appears > to be rather slow. Provide more info/code. I suspect it is not os.walk itself that is slow, but rather the code that processes its

Re: Python to use a non open source bug tracker?

2006-10-04 Thread A.M. Kuchling
On 04 Oct 2006 06:44:24 -0700, Paul Rubin <> wrote: > Right now there is not even agreement on what the goal is. The goal is a new tracker for python.org that the developers like better; the original call lists 3 reasons (bad interface; lack of reliability; lack of workflow controls).

Re: item access time: sets v. lists

2006-10-04 Thread Paul McGuire
"Neil Cerutti" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Look at the code again. It's not testing what it says it's > testing. > It isnt? The only quibble I can see is that there really is no "first" element in a set. I picked the "0 in set" and "0 in list" to pick the fa

Re: item access time: sets v. lists

2006-10-04 Thread Paul McGuire
"David Isaac" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Paul M. wrote: >> Random access to item in list/set when item exists >> set -> 0.000241650824337 >> list -> 0.0245168031132 >> >> Random access to item in list/set when item does not exist >> set -> 0.000187733357172 >>

Re: PEP 358 and operations on bytes

2006-10-04 Thread bearophileHUGS
Paul Rubin: > I think the underlying regexp C library isn't written that way. I can > see reasons to want a higher-level regexp library that works on > arbitrary sequences, calling a user-supplied function to classify > sequence elements, the way current regexps use the character code to > classif

Re: Python crash when trying to generate an Excel worksheet with VBA macros

2006-10-04 Thread hg
dan_roman wrote: > Hi, > I developed a script with a nice interface in Tkinter that allows me to > edit some formulas and to generate an Excel worksheet with VBA macros > within it. The script runs perfectlly in Office 2000, but in Office > 2003 crash at line: "wbc = workbook.VBProject.VBComponents

Re: Python/Tkinter crash.

2006-10-04 Thread Hendrik van Rooyen
"Eric Brunel" <[EMAIL PROTECTED]> wrote: > On Wed, 04 Oct 2006 10:33:55 +0200, Hendrik van Rooyen > <[EMAIL PROTECTED]> wrote: > > > Hi, > > > > I get the following: > > > > [EMAIL PROTECTED]:~/Controller/lib> python display.py > > UpdateStringProc should not be invoked for type font > > Aborte

Re: Python/Tkinter crash.

2006-10-04 Thread Russell E. Owen
In article <[EMAIL PROTECTED]>, "Hendrik van Rooyen" <[EMAIL PROTECTED]> wrote: >Hi, > >I get the following: > >[EMAIL PROTECTED]:~/Controller/lib> python display.py >UpdateStringProc should not be invoked for type font >Aborted >... >Everything seems to work fine. - there is a thread that runs t

Re: PEP 358 and operations on bytes

2006-10-04 Thread Paul Rubin
[EMAIL PROTECTED] writes: > > I think the underlying regexp C library isn't written that way. I can > > see reasons to want a higher-level regexp library that works on > > arbitrary sequences, calling a user-supplied function to classify > > sequence elements, the way current regexps use the chara

Having trouble using CTypes with a custom function

2006-10-04 Thread tkondal
Hi all. I just started looking at Python's ctypes lib and I am having trouble using it for a function. For starters, here's my Python code: from ctypes import*; myStringDLL= cdll.LoadLibrary("myStringDLL.dll"); GetMyString = getattr(myStringDLL, "?GetMyString@@[EMAIL PROTECTED]@[EMAIL PROTECTE

Re: Having trouble using CTypes with a custom function

2006-10-04 Thread Chris Mellon
On 4 Oct 2006 11:18:16 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Hi all. > > I just started looking at Python's ctypes lib and I am having trouble > using it for a function. > > For starters, here's my Python code: > > > from ctypes import*; > myStringDLL= cdll.LoadLibrary("myStringDLL.

Re: Having trouble using CTypes with a custom function

2006-10-04 Thread tkondal
Would you have any example of a wrapper for such data types? Thanks. Chris Mellon wrote: > On 4 Oct 2006 11:18:16 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Hi all. > > > > I just started looking at Python's ctypes lib and I am having trouble > > using it for a function. > > > > For

Re: Having trouble using CTypes with a custom function

2006-10-04 Thread Chris Mellon
On 4 Oct 2006 11:35:11 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Would you have any example of a wrapper for such data types? > > Thanks. > > Chris Mellon wrote: > > On 4 Oct 2006 11:18:16 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > Hi all. > > > > > > I just started loo

Re: Having trouble using CTypes with a custom function

2006-10-04 Thread tkondal
Hi Chris. I know that it is easy to fix the problem using C++. However, I do not want to code a wrapper DLL. I was wondering if there was a workaround with Python. Everything has to be done in Python as we do not have the tools for C++ (and we are not planning on getting any). Thanks. Chris Me

Re: item access time: sets v. lists

2006-10-04 Thread Duncan Booth
"Paul McGuire" <[EMAIL PROTECTED]> wrote: > By contrast, a set (and also the keys in a dict) use a tree structure > to index more quickly into the list of items 'dict' and I believe also 'set' use a hash table, not a tree structure. -- http://mail.python.org/mailman/listinfo/python-list

Re: item access time: sets v. lists

2006-10-04 Thread Neil Cerutti
On 2006-10-04, Paul McGuire <[EMAIL PROTECTED]> wrote: > "Neil Cerutti" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > >> Look at the code again. It's not testing what it says it's >> testing. > > It isnt? > > The only quibble I can see is that there really is no "first" > element

Re: Python to use a non open source bug tracker?

2006-10-04 Thread Paul Boddie
Giovanni Bajo wrote: > > The current request is: "please, readers of python-dev, setup a team of 6-10 > people to handle roundup or we'll go to a non-free software for bug > tracking". Actually, it would appear that the request goes out to comp.lang.python/python-list as well (ie. the ungrateful p

Re: item access time: sets v. lists

2006-10-04 Thread [EMAIL PROTECTED]
David Isaac wrote: > Paul M. wrote: > > Random access to item in list/set when item exists > > set -> 0.000241650824337 > > list -> 0.0245168031132 > > > > Random access to item in list/set when item does not exist > > set -> 0.000187733357172 > > list -> 0.522086186932 > > > OK, that's a much be

Re: Is there an alternative to os.walk?

2006-10-04 Thread waylan
Bruce wrote: > Hi all, > I have a question about traversing file systems, and could use some > help. Because of directories with many files in them, os.walk appears > to be rather slow. I`m thinking there is a potential for speed-up since > I don`t need os.walk to report filenames of all the files

Re: How to ask sax for the file encoding

2006-10-04 Thread Fredrik Lundh
Edward K. Ream wrote: > I'm asking this question because my app needs it :-) Imo, there is *no* > information in any xml file that can be considered irrelvant. the encoding isn't *in* the XML file, it's an artifact of the serialization model used for a specific XML infoset. the XML data is pu

Re: Python to use a non open source bug tracker?

2006-10-04 Thread David Goodger
Giovanni Bajo wrote: > The current request is: "please, readers of python-dev, setup a team of 6-10 > people to handle roundup or we'll go to a non-free software for bug > tracking". This is something which I cannot cope with, and I'm *speaking* > up against. Were the request lowered to something m

Re: item access time: sets v. lists

2006-10-04 Thread Paul McGuire
"Neil Cerutti" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On 2006-10-04, Paul McGuire <[EMAIL PROTECTED]> wrote: >> "Neil Cerutti" <[EMAIL PROTECTED]> wrote in message >> news:[EMAIL PROTECTED] >> > > It seems to be timing "testing for membership", not "random > access". Random

Re: How to ask sax for the file encoding

2006-10-04 Thread Fredrik Lundh
Edward K. Ream wrote: > What suits me best is what the *user* specified, and that got put in the > first xml line. are you expecting your users to write XML by hand? ouch. -- http://mail.python.org/mailman/listinfo/python-list

Find out the name of a variable passed as an argument

2006-10-04 Thread Andreas Huesgen
Hello everybody, is there a way to receive the name of an object passed to a function from within the function. something like def foo(param): print theNameOfTheVariablePassedToParam var1 = "hello" var2 = "world" >>> foo(var1) var1 >>> foo(var2) var2 thanks in advance, greets An

Re: item access time: sets v. lists

2006-10-04 Thread Paul McGuire
"Duncan Booth" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > "Paul McGuire" <[EMAIL PROTECTED]> wrote: > >> By contrast, a set (and also the keys in a dict) use a tree structure >> to index more quickly into the list of items > > 'dict' and I believe also 'set' use a hash table, no

Re: Python to use a non open source bug tracker?

2006-10-04 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > No, actually switching trackers can be one big pain in the ass. You > probably aren't aware of how hard it's been for the Python development team > (I think Martin v. Loewis, mostly) to get tracker data out of SF. http://effbot.org/zone/sandbox-sourceforge.htm -- h

Re: PEP 358 and operations on bytes

2006-10-04 Thread Fredrik Lundh
John Machin wrote: > But not on other integer subtypes. If regexps should not be restricted > to text, they should work on domains whose number of symbols is greater > than 256, shouldn't they? they do: import re, array data = [0, 1, 1, 2] array_type = "IH"[re.sre_compile.MAXCODE == 0x] a

CGI Tutorial

2006-10-04 Thread Clodoaldo Pinto Neto
I'm just building a Python CGI Tutorial and would appreciate any feedback from the many experts in this list. Regards, Clodoaldo Pinto Neto -- http://mail.python.org/mailman/listinfo/python-list

Re: CGI Tutorial

2006-10-04 Thread Tim Chase
> I'm just building a Python CGI Tutorial and would appreciate > any feedback from the many experts in this list. First item of feedback...post something on which to give feedback, such as a link to the work in progress. :) -tkc -- http://mail.python.org/mailman/listinfo/python-list

Re: Find out the name of a variable passed as an argument

2006-10-04 Thread Fredrik Lundh
Andreas Huesgen wrote: > is there a way to receive the name of an object passed to a function > from within the function. objects don't have names, so in general, you cannot do that. see: http://pyfaq.infogami.com/how-can-my-code-discover-the-name-of-an-object -- http://mail.python.org/mai

Re: Python to use a non open source bug tracker?

2006-10-04 Thread skip
>> No, actually switching trackers can be one big pain in the ass. You >> probably aren't aware of how hard it's been for the Python >> development team (I think Martin v. Loewis, mostly) to get tracker >> data out of SF. Fredrik> http://effbot.org/zone/sandbox-sourceforge.ht

Re: Python to use a non open source bug tracker?

2006-10-04 Thread Martin v. Löwis
Giovanni Bajo schrieb: >>> I hope this >>> recommendation from the "PSF infrastructure committee" is rejected. >> That is very very unlikely. Who would reject it, and why? > > The community, and I am impressed you do not want to understand the "why". How would "the community" actually reject it?

Re: CGI Tutorial

2006-10-04 Thread Clodoaldo Pinto Neto
Clodoaldo Pinto Neto wrote: > I'm just building a Python CGI Tutorial and would appreciate any > feedback from the many experts in this list. http://webpython.codepoint.net -- http://mail.python.org/mailman/listinfo/python-list

Re: CGI Tutorial

2006-10-04 Thread Clodoaldo Pinto Neto
Clodoaldo Pinto Neto wrote: > I'm just building a Python CGI Tutorial and would appreciate any > feedback from the many experts in this list. http://webpython.codepoint.net -- http://mail.python.org/mailman/listinfo/python-list

Re: How to ask sax for the file encoding

2006-10-04 Thread Edward K. Ream
> are you expecting your users to write XML by hand? Of course not. Leo has the following option: @string new_leo_file_encoding = utf-8 Edward Edward K. Ream email: [EMAIL PROTECTED] Leo: http://webpages.charter.net/edreaml

Re: Python to use a non open source bug tracker?

2006-10-04 Thread Martin v. Löwis
Giovanni Bajo schrieb: > In fact, are you absolutely positive that you need so much effort to > maintain an existing bugtracker installation? I know for sure that GCC's > Bugzilla installation is pretty much on its own; Daniel Berlin does some > maintainance every once in a while (upgrading when ne

Re: How to ask sax for the file encoding

2006-10-04 Thread Edward K. Ream
> Please consider adding some elements to the document itself that describe the desired output format, Well, that's what the encoding field in the xml line was supposed to do. Not a bad idea though, except it changes the file format, and I would really rather not do that. Edward ---

Re: How to ask sax for the file encoding

2006-10-04 Thread Edward K. Ream
> the encoding isn't *in* the XML file, it's an artifact of the > serialization model used for a specific XML infoset. the XML > data is pure Unicode. Sorry, but no. The *file* is what I am talking about, and the way it is encoded does, in fact, really make a difference to some users. They ha

Re: Python to use a non open source bug tracker?

2006-10-04 Thread Martin v. Löwis
Giovanni Bajo schrieb: > Frankly, I don't give a damn about the language the application is coded in That's probably one of the reasons why you aren't a member of the Python Software Foundation. Its mission includes to publicize, promote the adoption of, and facilitate the ongoing development of P

Re: Find out the name of a variable passed as an argument

2006-10-04 Thread John Henry
Algol, anyone? Andreas Huesgen wrote: > Hello everybody, > > is there a way to receive the name of an object passed to a function > from within the function. > > something like > > def foo(param): > print theNameOfTheVariablePassedToParam > > var1 = "hello" > var2 = "world" > > >>> foo(var

Re: PEP 358 and operations on bytes

2006-10-04 Thread bearophileHUGS
A simple RE engine written in Python can be short, this is a toy: http://paste.lisp.org/display/24849 If you can't live without the usual syntax: http://paste.lisp.org/display/24872 Paul Rubin: > Yes, I want something like that all the time for file scanning without > having to resort to parser mo

Re: dictionary of list from a file

2006-10-04 Thread [EMAIL PROTECTED]
limodou wrote: > here is my program > > d = {} > for line in file('test.txt'): > line = line.strip() > if line: > k, v = line.strip().split() > d.setdefault(k, []).append(v) > print d Minor nits: you call strip twice, when you don't need to. just omit the second call. Also

Re: item access time: sets v. lists

2006-10-04 Thread Duncan Booth
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > A set, on the other hand, uses a hash table so finding an element > takes constant time (it's one hash lookup, independent of the size of > the set)--and determining an item isn't there is likewise constant > time. > One hash calculation, but ther

Re: CGI Tutorial

2006-10-04 Thread Tim Chase
>> I'm just building a Python CGI Tutorial and would appreciate any >> feedback from the many experts in this list. > > http://webpython.codepoint.net Thanks! :) My first note would be regarding http://webpython.codepoint.net/shell_commands The code is very dangerous...allowing any ol' schmoe

Where is Python in the scheme of things?

2006-10-04 Thread gord
As a complete novice in the study of Python, I am asking myself where this language is superior or better suited than others. For example, all I see in the tutorials are lots of examples of list processing, arithmetic calculations - all in a DOS-like environment. What is particularly disappoint

Re: Python to use a non open source bug tracker? - Trac?

2006-10-04 Thread Martin v. Löwis
Harry George schrieb: > I'm not on the infrastructure list either. But I wonder why it is > "Roundup or else non-python COTS"? I gave up on Roundup a while ago > due to too many crashes. I'm now using Trac: > > a) Open Source > b) Python > c) Adequate functionality (for me at least) > > http:/

Re: Having trouble using CTypes with a custom function

2006-10-04 Thread [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote: > Hi all. > > I just started looking at Python's ctypes lib and I am having trouble > using it for a function. [...] > #C++ Prototype of the function I want to call: ctypes provides support for calling functions in C libraries, using C datatypes. I don't see any reason t

Re: Python to use a non open source bug tracker?

2006-10-04 Thread Paul Rubin
"Martin v. Löwis" <[EMAIL PROTECTED]> writes: > You fail to recognize that Python is *already* using a non-free software > for bug tracking, as do thousands of other projects. I don't think that reflects an explicit decision. SF started out as free software and the software became nonfree after

Re: Python to use a non open source bug tracker?

2006-10-04 Thread Martin v. Löwis
[EMAIL PROTECTED] schrieb: > No, actually switching trackers can be one big pain in the ass. You > probably aren't aware of how hard it's been for the Python development team > (I think Martin v. Loewis, mostly) to get tracker data out of SF. An > explicit requirement was that any tool chosen as

Re: How to ask sax for the file encoding

2006-10-04 Thread Edward K. Ream
> Try this: [snip] Parser.XmlDeclHandler = self.XmlDecl [snip] Excellent! Thanks so much. Edward Edward K. Ream email: [EMAIL PROTECTED] Leo: http://webpages.charter.net/edreamleo/front.html -

Re: Where is Python in the scheme of things?

2006-10-04 Thread Fredrik Lundh
gord wrote: > What is particularly disappointing is the absence of a Windows IDE, > components and an event driven paradigm. How does Python stand relative to > the big 3, namely Visual C++, Visual Basic and Delphi? if you think those are the "big 3", you should perhaps start by asking yoursel

Re: Python to use a non open source bug tracker?

2006-10-04 Thread Martin v. Löwis
Paul Boddie schrieb: > Out of interest, here are some figures: > > KDE: 12983 bugs and 11656 wishes > GNOME: 23624 reports > Python: 7159 bugs, 3843 patches, 477 feature requests > > The Python figures are totals, whereas I can't be sure whether the KDE > and GNOME figures merely refer to t

Re: py2app semi-standalone semi-works

2006-10-04 Thread James Stroud
Dave Opstad wrote: > In article <[EMAIL PROTECTED]>, > James Stroud <[EMAIL PROTECTED]> wrote: >>I am trying to create a semi-standalone with the vendor python on OS X >>10.4 (python 2.3.5). I tried to include some packages with both >>--packages from the command and the 'packages' option in set

Re: sax barfs on unicode filenames

2006-10-04 Thread Martin v. Löwis
Fredrik Lundh schrieb: > Diez B. Roggisch wrote: > >> Filenames are expected to be bytestrings. So what happens is that the >> unicode string you pass as filename gets implicitly converted using the >> default encoding. > > it is ? Yes. While you can pass Unicode strings as file names to many Py

Re: Where is Python in the scheme of things?

2006-10-04 Thread James Stroud
gord wrote: > As a complete novice in the study of Python, I am asking myself where this > language is superior or better suited than others. For example, all I see in > the tutorials are lots of examples of list processing, arithmetic > calculations - all in a DOS-like environment. > > What is

Re: sax barfs on unicode filenames: workaround

2006-10-04 Thread Martin v. Löwis
Edward K. Ream schrieb: > Happily, the workaround is easy. Replace theFile with: > > # Use cStringIo to avoid a crash in sax when inputFileName has unicode > characters. > s = theFile.read() > theFile = cStringIO.StringIO(s) > > My first attempt at a workaround was to use: > > s = theFile.read

Re: switching to numpy and failing, a user story

2006-10-04 Thread Travis Oliphant
[EMAIL PROTECTED] wrote: > Travis E. Oliphant wrote: > > > Given the quality of python's (free) documentation and how good it's > been for a very long time, it's bit ironic to be using the phrase > "normal open-source documentation" on this mailing list. Numeric > python, which numpy aspires to b

  1   2   3   4   >