Re: Keeping two lists aligned after processing

2008-05-11 Thread Terry Reedy
"Paul Rubin" <"http://phr.cx"@NOSPAM.invalid> wrote in message news:[EMAIL PROTECTED] | philly_bob <[EMAIL PROTECTED]> writes: | > algs=['AlgA', 'AlgB', 'AlgC', 'AlgD', 'AlgE'] | > accs=[] | > for alg in algs: | >thisacc=getattr(alg.accuracy)() |> # picked this technique on comp.lang.python l

Re: File Creation Not Working In A Thread Class?

2008-05-11 Thread Gary Herron
bc90021 wrote: ...and the exact error message was? Here is a tip: if you want people to help you, then you have to help them to help you. Personally, I wouldn't respond to anymore of your questions because you seem incapable of posting the information that was requested. So far, the peop

Re: Python GUIs and custom controls

2008-05-11 Thread Joe P. Cool
On 9 Mai, 10:14, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > If you can work with the license (GPL), I suggest Qt4 Thanks for your helpful hints, guys. -- Joe P. Cool -- http://mail.python.org/mailman/listinfo/python-list

Re: multiple Python versions, but on Windows (how to handle registry updates)

2008-05-11 Thread Gabriel Genellina
En Sun, 11 May 2008 01:17:22 -0300, Banibrata Dutta <[EMAIL PROTECTED]> escribió: > I realized that my query was not making much sense, or a bit convoluted. A > simler form of the question: > > For packages which do contain .dlls & .pyd's (not pure Python) their latest > version may be compatible

Re: Simple question

2008-05-11 Thread Bjoern Schliessmann
Gandalf wrote: > On May 10, 2:36 pm, Bjoern Schliessmann > It depends on your web server configuration. To get your web >> server execute Python code, there are several alternatives like >> >> * CGI >> * FastCGI >> * mod_python > > my server is my computer I didn't mean which server hardware you

Re: what does int means for python ?

2008-05-11 Thread castironpi
On May 11, 5:05 am, alefajnie <[EMAIL PROTECTED]> wrote: > > try arr[2][3] instead. > > > basically your version is trying to index an array with a tuple argument > > (2,3). > > > --irmen > > oh, you're right. > > btw, is any simple way to create multi-dimension array ? > any built-in function ?

Re: diffing and uniqing directories

2008-05-11 Thread castironpi
On May 11, 2:44 pm, Dan Stromberg <[EMAIL PROTECTED]> wrote: > On Sat, 26 Apr 2008 23:44:17 +0530, Rustom Mody wrote: > > Over years Ive collected tgz's of my directories. I would like to diff > > and uniq them > > > Now I guess it would be quite simple to write a script that does a walk > > or fin

Re: Some error messages in Python are ugly

2008-05-11 Thread Matthieu Brucher
Please, really please, stop asking question and go read some books about/get some courses on Linux shell and then finally Python. Before you do that, the only thing will have is upset people telling you to _think_ (clearly that's something you are n,ot used to do, but you will have to start at some

IDLE 3.0a5 has problems with Unicode

2008-05-11 Thread Sven Siegmund
Hello, I am testing Python 3.0a5's handling of unicode strings. Since SPE is not yet for Python 3.0, I have begun to write in IDLE 3.0a5. I have a source code which IDLE 3.0a5 cannot parse, but Python 3.0a5 can: #!/usr/bin/python # -*- coding: utf-8 -*- def načtiSlovník(zdroj='slovník.txt'):

Re: Mathematics in Python are not correct

2008-05-11 Thread Tim Roberts
[EMAIL PROTECTED] wrote: > >I am stunned that this simple misunderstanding of mine ended in a >mathematical clash of a sort. :) You guys really blew me away wih >your mathematical knowledge. And also the 0**0 is a thing I've never >thought about trying, until now that is. If the mathematical rule

Re: How to call a file

2008-05-11 Thread Yves Dorfsman
Gary Herron wrote: First of all, some terminology: You are not *calling* a file, you are *opening* it or reading. Wouldn't it be more correct to say that, in python, you either create a file object, or call a method for that object, once the object has been created ? Yves. -- http://mail.

Re: IDLE 3.0a5 has problems with Unicode

2008-05-11 Thread Martin v. Löwis
> Is this a known bug if IDLE 3.0a5 which will be fixed in the final > release? No, it's now a known bug (at least I don't know it). Whether or not it gets fixed might depend on whether or not it gets reported to bugs.python.org. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-l

Re: IDLE 3.0a5 has problems with Unicode

2008-05-11 Thread Sven Siegmund
> I have a source code which IDLE 3.0a5 cannot parse, but Python 3.0a5 > can: Oh I see the posts in this newsgroup do not yet support Unicode. Most of the special characters in my source code have been messed up. But anyway, those who know Czech can handle it. The error is replicable even with the

Re: IDLE 3.0a5 has problems with Unicode

2008-05-11 Thread Sven Siegmund
> No, it's now a known bug (at least I don't know it). Whether or not it > gets fixed might depend on whether or not it gets reported to > bugs.python.org. Ok, I'll repost it there. S. -- http://mail.python.org/mailman/listinfo/python-list

Re: Is using range() in for loops really Pythonic?

2008-05-11 Thread Ben Finney
John Salerno <[EMAIL PROTECTED]> writes: > num = 33 > > for x in xrange(10): > print num += 1 Which is better done by 'num += 10'. Can you come up with an example that isn't trivially replaced with clearer code? That might make it clearer what your concern is. > The [above] example [...] i

Re: Is using range() in for loops really Pythonic?

2008-05-11 Thread Yves Dorfsman
John Salerno wrote: To me, the first example is a pure use of the for loop. You are iterating through an object and *using* the items you are stepping through. The second example, however, is simply doing something 10 times, and what it's doing has nothing to do with 'x' or xrange. So it see

Re: IDLE 3.0a5 has problems with Unicode

2008-05-11 Thread hdante
On May 11, 7:27 pm, Sven Siegmund <[EMAIL PROTECTED]> wrote: > #!/usr/bin/python Notice that this line is probably not what you want, unless you overwrote the default python 2 installation. The line should be: #!/usr/bin/env python3.0 (this is irrelevant to the bug, however) > IDLE complains

Re: pickle problem

2008-05-11 Thread krustymonkey
On May 8, 7:29 pm, [EMAIL PROTECTED] wrote: > On May 8, 4:35 pm, Hrvoje Niksic <[EMAIL PROTECTED]> wrote: > > > > > Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> writes: > > > > On Thu, 08 May 2008 08:55:35 -0700, krustymonkey wrote: > > > >> The thing is, I'm not using slots by choice. I'm using t

Re: Python, are you ill?

2008-05-11 Thread Tim Roberts
[EMAIL PROTECTED] wrote: > >If you are in the interactive prompt of the Python interpreter and you >do this > >print """Testing\""" or print '''Testing\''' > >you get three dots [...] as if Python expects a code block. ...which it does. >If you >press Enter, you get three dots again, and agai

python without while and other "explosive" statements

2008-05-11 Thread ivo talvet
Hello, Is it possible to have a python which not handle the execution of "while", "for", and other loop statements ? I would like to allow remote execution of python on a public irc channel, so i'm looking for techniques which would do so people won't be able to crash my computer (while 1: os.fork

Re: File Creation Not Working In A Thread Class?

2008-05-11 Thread Gary Herron
bc90021 wrote: You are a perfect example of exactly what I was talking about, and why the Python community is such a poor one. I though you were treated quite fairly all things considered. (You started the personal attacks, the whining about the group, the accusations of arrogance, and the

Re: python without while and other "explosive" statements

2008-05-11 Thread Grant Edwards
On 2008-05-11, ivo talvet <[EMAIL PROTECTED]> wrote: > Is it possible to have a python which not handle the execution of > "while", "for", and other loop statements ? I would like to allow > remote execution of python on a public irc channel, so i'm looking for > techniques which would do so peopl

Re: Module python-magic on/for Windows?

2008-05-11 Thread Larry Hale
(quoted text below my reply) THANK YOU SO MUCH, Michael! Criminitly! Figures! HA! I had it the WHOLE TIME, but didn't realize it! ;) (As mentioned, I had FILE installed from GnuWin32.) DUH! I just neglected to do a search for "magic1.dll"... the most obvious of the obvious! I copied it fro

how to separate words from a string?

2008-05-11 Thread David Anderson
Hi, how can I separate words from a sentence in a string? Like the java.String.split method I need something that gets an string "This is a sentence", and return to em a list["This","is","a","sentence"] Can anyone help? Thx -- http://mail.python.org/mailman/listinfo/python-list

Re: Is using range() in for loops really Pythonic?

2008-05-11 Thread Jonathsn Cronin
On Sun, 11 May 2008 16:16:53 -0400, John Salerno wrote (in message <[EMAIL PROTECTED]>): > XLiIV wrote: > >> The range() function returns a list and list is a sequence, isn't? > > I think you're missing the point. To me, there seems to be a fundamental > difference between these two things: >

Re: Module python-magic on/for Windows?

2008-05-11 Thread Larry Hale
After putting the magic1.dll file to C:\Program Files\Python25\DLLs (looking at the directory structure, that seemed as good a place as any), now I can *import* the module, but... >>> import magic >>> test = magic.Magic() Traceback (most recent call last): File "", line 1, in

Re: how to separate words from a string?

2008-05-11 Thread Benjamin Kaplan
On Sun, May 11, 2008 at 8:15 PM, David Anderson <[EMAIL PROTECTED]> wrote: > Hi, how can I separate words from a sentence in a string? Like the > java.String.split method > I need something that gets an string "This is a sentence", and return to em > a list["This","is","a","sentence"] > Can anyone

Re: IDLE 3.0a5 has problems with Unicode

2008-05-11 Thread Terry Reedy
"Sven Siegmund" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] |> I have a source code which IDLE 3.0a5 cannot parse, but Python 3.0a5 | > can: | | Oh I see the posts in this newsgroup do not yet support Unicode. I think this depends on the reader and maybe the fonts on the system.

Re: Mathematics in Python are not correct

2008-05-11 Thread Terry Reedy
"Tim Roberts" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | [EMAIL PROTECTED] wrote: | > | >I am stunned that this simple misunderstanding of mine ended in a | >mathematical clash of a sort. :) You guys really blew me away wih | >your mathematical knowledge. And also the 0**0 is

Re: Make Python create a tuple with one element in a clean way

2008-05-11 Thread Asun Friere
On May 11, 10:54 pm, [EMAIL PROTECTED] wrote: > To create a tuple with one element, you need to do this: > > >>> my_tuple = (1,)# Note the trailing comma after the value 1 > >>> type(my_tuple) > > > You needn't at all. You could simply do this: >>> your_tuple = 1, You see, it's not the par

Re: Orlando Florida Python Tutor Needed

2008-05-11 Thread Larry Hale
On May 10, 11:42 am, vbgunz <[EMAIL PROTECTED]> wrote: > I will pay anyone for a face-to-face tutoring in the Orlando Florida > area. I will pay $20.00 per hour (minimum 2 hours needed). What I need > are lessons in Decorators and Class methods. If I can walk away with > at least 5 lessons taught i

Re: python without while and other "explosive" statements

2008-05-11 Thread Matt Nordhoff
ivo talvet wrote: > Hello, > > Is it possible to have a python which not handle the execution of > "while", "for", and other loop statements ? I would like to allow > remote execution of python on a public irc channel, so i'm looking for > techniques which would do so people won't be able to crash

Re: list object

2008-05-11 Thread Larry Hale
On May 10, 12:39 pm, Gandalf <[EMAIL PROTECTED]> wrote: > my manual contain chapter about lists with python. when i try to copy > paste : > > li = ["a", "b", "mpilgrim", "z", "example"] (1) > > it i get this errore: > > "TypeError: 'list' object is not callable" > > i was wondering if their is any

Re: Is using range() in for loops really Pythonic?

2008-05-11 Thread Carl Banks
On May 11, 6:44 pm, Ben Finney <[EMAIL PROTECTED]> wrote: > In such cases, the name 'dummy' is conventionally bound to the items > from the iterator, for clarity of purpose:: > > for dummy in range(10): > # do stuff that makes no reference to 'dummy' Is this documented? I've never hea

Re: Saving an audio file's waveform into an image

2008-05-11 Thread Larry Hale
On May 9, 1:55 am, Julien <[EMAIL PROTECTED]> wrote: > Hi, > > I would like to pull out the waveform of an audio file and save it > into an image file, for example in GIF format. Is that achievable, and > if so, how? > > I heard about the Snack module, but the project looks dead and un- > maintaine

Re: File Creation Not Working In A Thread Class?

2008-05-11 Thread 7stud
On May 11, 5:50 pm, Gary Herron <[EMAIL PROTECTED]> wrote: > bc90021 wrote: > > You are a perfect example of exactly what I was talking about, and why > > the Python community is such a poor one. > > I though you were treated quite fairly all things considered.   (You > started the personal attacks

anonymous assignment

2008-05-11 Thread Yves Dorfsman
Is there anyway to tell python I don't care about a value ? Say I want today's year and day, I'd like to do something like: import time y, None, d, None, None, None, None = time.localtime() I know you can't assign anything to None, but I'm sure you get what I mean, a special keyword that means

Re: Is using range() in for loops really Pythonic?

2008-05-11 Thread Ivan Illarionov
On Sun, 11 May 2008 18:52:48 -0700, Carl Banks wrote: > On May 11, 6:44 pm, Ben Finney <[EMAIL PROTECTED]> > wrote: >> In such cases, the name 'dummy' is conventionally bound to the items >> from the iterator, for clarity of purpose:: >> >> for dummy in range(10): >> # do stuff that ma

Re: anonymous assignment

2008-05-11 Thread Paul Rubin
Yves Dorfsman <[EMAIL PROTECTED]> writes: > import time > y, None, d, None, None, None, None = time.localtime() > > I know you can't assign anything to None, but I'm sure you get what I > mean, a special keyword that means I don't care about this value. You can just use a variable name than you i

Corum Bubble Diamond Steel Pink Ladies Watch 196-151-47-0F08-PN96S

2008-05-11 Thread yxs046
Corum Bubble Diamond Steel Pink Ladies Watch 196-151-47-0F08-PN96S Corum Bubble Diamond Steel Pink Ladies Watch 196-151-47-0F08-PN96S Link : http://corum.hotwatch.org/Corum-Ladies-Watch-196-151-47-0F08-PN96S.html Corum Bubble Diamond Steel Pink Ladies Watch 196-151-47-0F08-PN96S Information : Br

Re: anonymous assignment

2008-05-11 Thread D'Arcy J.M. Cain
On Mon, 12 May 2008 02:28:13 GMT Yves Dorfsman <[EMAIL PROTECTED]> wrote: > particular case, there's got to be a better way than: > > d = time.local() > y = d[0] > d = d[1] Like this? y, d = time.local()[:2] -- D'Arcy J.M. Cain <[EMAIL PROTECTED]> | Democracy is three wolves http:

Re: Mathematics in Python are not correct

2008-05-11 Thread Mark Dickinson
On May 11, 9:36 pm, "Terry Reedy" <[EMAIL PROTECTED]> wrote: > Do you have in mind any situations in which it is advantageous to have 0**0 > undefined? (Playing devil's advocate here.) If you regard x**y as exp(y*log(x)) then it's not at all clear that 0.**0. should be considered well-defined. And

Re: Module python-magic on/for Windows?

2008-05-11 Thread Larry Hale
On May 10, 11:41 pm, Larry Hale <[EMAIL PROTECTED]> wrote: > I've heard tell of a Python binding for libmagic (file(1) *nixy > command; seehttp://darwinsys.com/file/). Generally, has anybody > built this and worked with it under Windows? > > The only thing I've been able to find is the python-magi

Re: anonymous assignment

2008-05-11 Thread Yves Dorfsman
Paul Rubin wrote: Yves Dorfsman <[EMAIL PROTECTED]> writes: import time y, None, d, None, None, None, None = time.localtime() I know you can't assign anything to None, but I'm sure you get what I mean, a special keyword that means I don't care about this value. You can just use a variable nam

Convention for name indicating "don't care about the value" (was: Is using range() in for loops really Pythonic?)

2008-05-11 Thread Ben Finney
Carl Banks <[EMAIL PROTECTED]> writes: > On May 11, 6:44 pm, Ben Finney <[EMAIL PROTECTED]> > wrote: > > In such cases, the name 'dummy' is conventionally bound to the items > > from the iterator, for clarity of purpose:: > > > > for dummy in range(10): > > # do stuff that makes no ref

Re: anonymous assignment

2008-05-11 Thread Yves Dorfsman
D'Arcy J.M. Cain wrote: On Mon, 12 May 2008 02:28:13 GMT Yves Dorfsman <[EMAIL PROTECTED]> wrote: particular case, there's got to be a better way than: d = time.local() y = d[0] d = d[1] Like this? y, d = time.local()[:2] Sorry this was a typo (again :-), I meant: d = time.local() y

Re: anonymous assignment

2008-05-11 Thread Ben Finney
Paul Rubin writes: > Yves Dorfsman <[EMAIL PROTECTED]> writes: > > I know you can't assign anything to None, but I'm sure you get what I > > mean, a special keyword that means I don't care about this value. Snap. This topic was raised today in another thread. > You can

Re: Is using range() in for loops really Pythonic?

2008-05-11 Thread John Salerno
Ben Finney wrote: > John Salerno <[EMAIL PROTECTED]> writes: > >> num = 33 >> >> for x in xrange(10): >> print num += 1 > > Which is better done by 'num += 10'. > > Can you come up with an example that isn't trivially replaced with > clearer code? That might make it clearer what your concern

Re: Module python-magic on/for Windows?

2008-05-11 Thread Michael Torrie
Larry Hale wrote: > ALSO: I've even tried putting the 4 "magic" files INTO the .egg > file... still no-go. :/ It's often the custom of programs ported from unix to windows to use the dll location as a key to find the other files that are typically in share, or etc. GTK, for example uses ../share

Re: threading - race condition?

2008-05-11 Thread Gabriel Genellina
En Sun, 11 May 2008 13:16:25 -0300, skunkwerk <[EMAIL PROTECTED]> escribió: > the only issue i have now is that it takes a long time for 100 threads > to initialize that connection (>5 minutes) - and as i'm doing this on > a webserver any time i update the code i have to restart all those > thread

Re: Convention for name indicating "don't care about the value" (was: Is using range() in for loops really Pythonic?)

2008-05-11 Thread Carl Banks
On May 11, 11:41 pm, Ben Finney <[EMAIL PROTECTED]> wrote: > Carl Banks <[EMAIL PROTECTED]> writes: > > On May 11, 6:44 pm, Ben Finney <[EMAIL PROTECTED]> > > wrote: > > > In such cases, the name 'dummy' is conventionally bound to the items > > > from the iterator, for clarity of purpose:: > > > >

Re: Free Memory

2008-05-11 Thread Gabriel Genellina
En Sun, 11 May 2008 01:06:13 -0300, Patrick Mullen <[EMAIL PROTECTED]> escribió: > Yeah I don't know much about locals or globals. I've never used them > before, just know they are there. But anyway, to illustrate what I meant by > the interesting behavior, here is the output (and sorry for it b

Re: Module python-magic on/for Windows?

2008-05-11 Thread Larry Hale
THANKS, AGAIN, for the reply! :) Okay, now I -really- feel silly... :> So, when I was going to try what you'd suggested, I noticed something peculiar: I hadn't "changed" anything on my system, but now, when I tried to "import magic" I got a missing DLL error. For a DIFFERENT DLL! This got me

Accepting text input

2008-05-11 Thread Collin
I'm pretty new to Python, but this has really bugged me. I can't find a way around it. The problem is that, when I use raw_input("sajfasjdf") whatever, or input("dsjfadsjfa"), you can only have numerical values as answers. Any help would be appreciated. Thanks. -- http://mail.python.org/mail

Re: Accepting text input

2008-05-11 Thread Collin
Collin wrote: I'm pretty new to Python, but this has really bugged me. I can't find a way around it. The problem is that, when I use raw_input("sajfasjdf") whatever, or input("dsjfadsjfa"), you can only have numerical values as answers. Any help would be appreciated. Thanks. Oh, wow. I f

Re: Is using range() in for loops really Pythonic?

2008-05-11 Thread Ivan Illarionov
>> In such cases, the name 'dummy' is conventionally bound to the items >> from the iterator, for clarity of purpose [..] > If a value isn't used, then I think the most clear name for it is > "unused". [...] Maybe my brain works differently, but I find both "dummy" and "unused" are extremely conf

Re: Is using range() in for loops really Pythonic?

2008-05-11 Thread Ben Finney
John Salerno <[EMAIL PROTECTED]> writes: > Ben Finney wrote: > > > John Salerno <[EMAIL PROTECTED]> writes: > > > >> num = 33 > >> > >> for x in xrange(10): > >> print num += 1 > > > > Which is better done by 'num += 10'. > > > > Can you come up with an example that isn't trivially replaced

Re: Make Python create a tuple with one element in a clean way

2008-05-11 Thread MC
Hi! You want 2*(3+4) to return (7,7)? For have that: 2*(3+4,) -- @-salutations Michel Claveau -- http://mail.python.org/mailman/listinfo/python-list

Re: pickle problem

2008-05-11 Thread castironpi
On May 11, 6:21 pm, [EMAIL PROTECTED] wrote: > On May 8, 7:29 pm, [EMAIL PROTECTED] wrote: > > > > > > > On May 8, 4:35 pm, Hrvoje Niksic <[EMAIL PROTECTED]> wrote: > > > > Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> writes: > > > > > On Thu, 08 May 2008 08:55:35 -0700, krustymonkey wrote: > > > >

Re: Python, are you ill?

2008-05-11 Thread castironpi
On May 11, 6:26 pm, Tim Roberts <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > >If you are in the interactive prompt of the Python interpreter and you > >do this > > >print """Testing\"""   or   print '''Testing\''' > > >you get three dots [...] as if Python expects a code block. > > ...

Re: Accepting text input

2008-05-11 Thread Gabriel Genellina
En Mon, 12 May 2008 01:54:28 -0300, Collin <[EMAIL PROTECTED]> escribió: > Collin wrote: >> I'm pretty new to Python, but this has really bugged me. I can't find a >> way around it. >> >> >> The problem is that, when I use raw_input("sajfasjdf") whatever, or >> input("dsjfadsjfa"), you can only ha

Is there no single/uniform RDBMS access API module for Python ?

2008-05-11 Thread Banibrata Dutta
Hi, Again a noob question. Based on this URL http://wiki.python.org/moin/DatabaseInterfaces , is it correct to conclude that there is no RDBMS agnostic, single/uniform DB access API for Python ? Something in the lines of JDBC for Java, DBD for Perl etc. ? How is the RDBMS change handled for solu

Re: Mathematics in Python are not correct

2008-05-11 Thread Terry Reedy
"Mark Dickinson" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] On May 11, 9:36 pm, "Terry Reedy" <[EMAIL PROTECTED]> wrote: |> Do you have in mind any situations in which it is advantageous to have 0**0 |> undefined? | (Playing devil's advocate here.) If you regard x**y as exp(y*l

Re: anonymous assignment

2008-05-11 Thread Marc 'BlackJack' Rintsch
On Mon, 12 May 2008 03:40:03 +, Yves Dorfsman wrote: > Paul Rubin wrote: > >> You can just use a variable name than you ignore. It's traditional to >> use _ but it's not a special keyword, it's just a another variable >> name: >> >>y, _, d, _, _, _, _, _, _ = time.localtime() > > But yo

Re: Best technology for agent/web server architecture

2008-05-11 Thread Gabriel Genellina
> 2008/5/8 M.-A. Lemburg <[EMAIL PROTECTED]>: > >> SOAP would be a good choice if you want to send to data to other >> servers as well, e.g. Java-based ones. >> >> XML-RPC and JSON are better for simple data structures. >> >> If you have control over both client and server and don't >> need to both

hai friends

2008-05-11 Thread chandran . ramu1
hai dear, "may all good things come into your life today and always" www.goodhistory5.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Is using range() in for loops really Pythonic?

2008-05-11 Thread Ben Finney
Ivan Illarionov <[EMAIL PROTECTED]> writes: > >> In such cases, the name 'dummy' is conventionally bound to the items > >> from the iterator, for clarity of purpose > [..] > > If a value isn't used, then I think the most clear name for it is > > "unused". > [...] > > Maybe my brain works differen

Re: cgitb performance issue

2008-05-11 Thread Gabriel Genellina
En Mon, 05 May 2008 15:56:26 -0300, Ethan Furman <[EMAIL PROTECTED]> escribió: > I tried adding a form to our website for uploading large files. > Personally, I dislike the forms that tell you you did something wrong > and make you re-enter *all* your data again, so this one cycles and > remembers

Re: Is using range() in for loops really Pythonic?

2008-05-11 Thread Paddy
On May 11, 9:28 pm, Arnaud Delobelle <[EMAIL PROTECTED]> wrote: Hi John, Arnaud; > Contrived example: > > # Print 'hello' 10 times; x is not used > for x in xrange(10): > print 'hello' I've used Fortran and C and so would tend to use either i,j,k as the unused loop variable above, or, for cla

Re: anonymous assignment

2008-05-11 Thread Ben Finney
Yves Dorfsman <[EMAIL PROTECTED]> writes: > Paul Rubin wrote: > > Yves Dorfsman <[EMAIL PROTECTED]> writes: > >> import time > >> y, None, d, None, None, None, None = time.localtime() > >> > >> I know you can't assign anything to None, but I'm sure you get what I > >> mean, a special keyword that

Re: anonymous assignment

2008-05-11 Thread Arnaud Delobelle
Yves Dorfsman <[EMAIL PROTECTED]> writes: > Is there anyway to tell python I don't care about a value ? > > Say I want today's year and day, I'd like to do something like: > > import time > y, None, d, None, None, None, None = time.localtime() > > I know you can't assign anything to None, but I'm

Re: Module python-magic on/for Windows?

2008-05-11 Thread Larry Hale
On May 11, 11:42 pm, Larry Hale <[EMAIL PROTECTED]> wrote: > THANKS, AGAIN, for the reply! :) > > Okay, now I -really- feel silly... :> > > So, when I was going to try what you'd suggested, I noticed something > peculiar: I hadn't "changed" anything on my system, but now, when I > tried to "impor

Re: computing with characters

2008-05-11 Thread Gabriel Genellina
En Tue, 06 May 2008 08:16:55 -0300, <[EMAIL PROTECTED]> escribió: > I tend to do ", ".join("%s" % e for e in item) > > Is there any difference between this and str()? Use the timeit module to measure performance: C:\TEMP>python -m timeit "for i in xrange(1): str(i)" 10 loops, best of 3: 81.8

Re: Is there no single/uniform RDBMS access API module for Python ?

2008-05-11 Thread Laszlo Nagy
Banibrata Dutta írta: Hi, Again a noob question. Based on this URL http://wiki.python.org/moin/DatabaseInterfaces , is it correct to conclude that there is no RDBMS agnostic, single/uniform DB access API for Python ? Something in the lines of JDBC for Java, DBD for Perl etc. ? How is the

Re: Is there no single/uniform RDBMS access API module for Python ?

2008-05-11 Thread Banibrata Dutta
On 5/12/08, Laszlo Nagy <[EMAIL PROTECTED]> wrote: > > Banibrata Dutta írta: > >> Hi, >> Again a noob question. >> Based on this URL http://wiki.python.org/moin/DatabaseInterfaces , is it >> correct to conclude that there is no RDBMS agnostic, single/uniform DB >> access API for Python ? >> Somet

Re: Is there no single/uniform RDBMS access API module for Python ?

2008-05-11 Thread Banibrata Dutta
Found that SnakeSQL does implement DB2.0 API. However are there such implementations for MySQL ? On 5/12/08, Banibrata Dutta <[EMAIL PROTECTED]> wrote: > > > On 5/12/08, Laszlo Nagy <[EMAIL PROTECTED]> wrote: >> >> Banibrata Dutta írta: >> >>> Hi, >>> Again a noob question. >>> Based on this URL

Re: Module python-magic on/for Windows?

2008-05-11 Thread Larry Hale
On May 11, 11:42 pm, Larry Hale <[EMAIL PROTECTED]> wrote: > THANKS, AGAIN, for the reply! :) > > Okay, now I -really- feel silly... :> > > So, when I was going to try what you'd suggested, I noticed something > peculiar: I hadn't "changed" anything on my system, but now, when I > tried to "impor

Re: Initializing a subclass with a super object?

2008-05-11 Thread Francesco Bochicchio
On Sat, 10 May 2008 18:09:02 -0700, frankdmartinez wrote: > Hi, Terry. > Yeah, no. If we think of the inherited B as an object nested > within a1, I'm attempting to initialize that B with b1 by accessing > the B, say, via a function call. I don't see how using a python > factory achieves thi

Re: Is using range() in for loops really Pythonic?

2008-05-11 Thread XLiIV
On May 11, 4:19 am, John Salerno <[EMAIL PROTECTED]> wrote: > I know it's popular and very handy, but I'm curious if there are purists > out there who think that using something like: > > for x in range(10): >     #do something 10 times > > is unPythonic. The reason I ask is because the structure o

Re: Is using range() in for loops really Pythonic?

2008-05-11 Thread castironpi
On May 11, 12:38 am, Paul Rubin wrote: > John Salerno <[EMAIL PROTECTED]> writes: > > for x in range(10): > >     #do something 10 times > > > is unPythonic. The reason I ask is because the structure of the for loop > > seems to be for iterating through a sequence. It see

Some error messages in Python are ugly

2008-05-11 Thread wxPythoner
This really looks ugly for an error message: [1]+ Stopped python Please explain to me the role of the '+' sign. And why is there such a gap between 'Stopped' and 'python'? -- http://mail.python.org/mailman/listinfo/python-list

Re: Any other UI kits with text widget similar to that in Tk?

2008-05-11 Thread Neil Hodgson
Kenneth McDonald: I'm wondering if any of the other GUI kits have a text widget that is similar in power to the one in Tk. The main text widget in GTK+ was modeled after Tk but I don't know how well it succeeded in implementing this. Neil -- http://mail.python.org/mailman/listinfo/pyth

Unimport statement

2008-05-11 Thread wxPythoner
We should have that statement, so that problems, expressed in http://groups.google.com/group/comp.lang.python/browse_thread/thread/3bda1fc4895ec886/bc5fe40cfbd10124?lnk=raot#bc5fe40cfbd10124, would not occur. -- http://mail.python.org/mailman/listinfo/python-list

Re: Some error messages in Python are ugly

2008-05-11 Thread Marc 'BlackJack' Rintsch
On Sun, 11 May 2008 01:10:19 -0700, wxPythoner wrote: > This really looks ugly for an error message: > > [1]+ Stopped python It's neither an error message nor does it come from Python. It's a message from your shell about job control. Seems you have stopped the running process

Re: Some error messages in Python are ugly

2008-05-11 Thread Florencio Cano
This is not a Python error, this is a bash message that appears when you press ctrl+z and put the application in the background. Execute fg to return the app to the foreground. 2008/5/11 <[EMAIL PROTECTED]>: > This really looks ugly for an error message: > > [1]+ Stopped python >

Re: Unimport statement

2008-05-11 Thread Filip Štědronský
The main problem are references to objects within a module, because we can NEVER be sure there aren't any, even though we cleaned up everything, that's just a consequence of Python nature. We can keep the old objects referenced and it would make an equivalent to the reload() builting, just without

what does int means for python ?

2008-05-11 Thread alefajnie
#!/usr/bin/env python arr = [[0 for c in range(0, 10)] for r in range(0, 10)] # 10x10 array arr[2,3] # throws TypeError: list indices must be integers arr[int(2), int(3)] # also throws TypeError: list indices must be integers !

Re: what does int means for python ?

2008-05-11 Thread Irmen de Jong
alefajnie wrote: #!/usr/bin/env python arr = [[0 for c in range(0, 10)] for r in range(0, 10)] # 10x10 array arr[2,3] # throws TypeError: list indices must be integers arr[int(2), int(3)] # also throws TypeError: list indices must be integers ! -

Re: what does int means for python ?

2008-05-11 Thread alefajnie
> > try arr[2][3] instead. > > basically your version is trying to index an array with a tuple argument > (2,3). > > --irmen oh, you're right. btw, is any simple way to create multi-dimension array ? any built-in function ? -- http://mail.python.org/mailman/listinfo/python-list

How to uninstall something installed by "setup.py install"?

2008-05-11 Thread tinnews
I have installed a development version of rdiff-backup using its "setup.py install" but now find I need to uninstall it. Is there any 'easy' way to do this and/or can I find out what files it has installed where so I can remove them? -- Chris Green -- http://mail.python.org/mailman/listinfo/pyth

Re: what does int means for python ?

2008-05-11 Thread mimi.vx
On May 11, 12:05 pm, alefajnie <[EMAIL PROTECTED]> wrote: > > try arr[2][3] instead. > > > basically your version is trying to index an array with a tuple argument > > (2,3). > > > --irmen > > oh, you're right. > > btw, is any simple way to create multi-dimension array ? > any built-in function ?

Re: Mathematics in Python are not correct

2008-05-11 Thread Max M
[EMAIL PROTECTED] skrev: I have two another interesting things to discuss about, for which I'll open new posts on this group. Look for "Python doesn't recognize quote types" and "Python, are you ill?". You have a tendency to form your questions as complaints about Python being broken. You w

Re: Some error messages in Python are ugly

2008-05-11 Thread george . f . rice
On May 11, 3:10 am, [EMAIL PROTECTED] wrote: > This really looks ugly for an error message: > > [1]+ Stopped python > > Please explain to me the role of the '+' sign. And why is there such a > gap between 'Stopped' and 'python'? I suspect you were running the python command line i

Re: Python doesn't recognize quote types

2008-05-11 Thread Duncan Booth
[EMAIL PROTECTED] wrote: > There's a thing that bugs me in Python. Look at this... > print "Testing\" > SyntaxError: EOL while scanning single-quoted string > > > Please focus on the part of the error message that states "while > scanning single-quoted string". How can Python claim it scan

Make Python create a tuple with one element in a clean way

2008-05-11 Thread wxPythoner
To create a tuple with one element, you need to do this: >>> my_tuple = (1,)# Note the trailing comma after the value 1 >>> type(my_tuple) But if you do this >>> my_tuple = (1) >>> type(my_tuple) you don't get a tuple. I thought that just putting a value inside ( ) would make a tuple. Ap

Re: How to uninstall something installed by "setup.py install"?

2008-05-11 Thread Ben Finney
[EMAIL PROTECTED] writes: > I have installed a development version of rdiff-backup using its > "setup.py install" but now find I need to uninstall it. Is there any > 'easy' way to do this and/or can I find out what files it has > installed where so I can remove them? Sadly, the re-invention of pa

Re: Make Python create a tuple with one element in a clean way

2008-05-11 Thread Filip Štědronský
Hello, > so it would be clean if Python would convert anything put into ( ) to > be a tuple, even if just one value was put in (without having to use > that ugly looking comma with no value after it). if it worked that way, it will absolutely mess up Python syntax, because we mathematicians are u

Problem with custom events in wxpython

2008-05-11 Thread Jimmy
hi, all I'm having a problem with creating custom events in wxpython. I have a class A handling some data processing work and another class B of GUI matter. I need GUI to display information when data in A is updated. I know cutom events in wxpython may work. But I found no material paricularly h

Re: Make Python create a tuple with one element in a clean way

2008-05-11 Thread alex23
On May 11, 10:54 pm, [EMAIL PROTECTED] wrote: > I thought that just putting a value inside ( ) > would make a tuple. Apparently that is not the case. It's not the case at all. Check out the Tuples & Sequences section in the python docs at http://docs.python.org/tut/node7: "A tuple consists of a n

Re: Mathematics in Python are not correct

2008-05-11 Thread Grant Edwards
On 2008-05-11, Max M <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] skrev: > >> I have two another interesting things to discuss about, for >> which I'll open new posts on this group. Look for "Python >> doesn't recognize quote types" and "Python, are you ill?". > > You have a tendency to form your

  1   2   >