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: 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: 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 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: 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: 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: 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: 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: 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: 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 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

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: 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

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: 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

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: 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

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: 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: 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: 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: 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: 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

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: 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

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: 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: 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: 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: 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: 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: 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

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
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

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: 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: 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:

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 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

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

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: 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

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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: >

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: 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

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: 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

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: 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

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: 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: 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: 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: 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: 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 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: 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: 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

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: 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

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: 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: 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: 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: 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: 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: 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 7stud
On May 11, 2:11 pm, bc90021 <[EMAIL PROTECTED]> wrote: > [CUT] > > > I have in no way assumed that you are stupid.  I have tried to help you > > formulate your problem better so that people on the list can help you. > > I believe I have done so respectfully, with the aim of introducing you > > to t

Re: File Creation Not Working In A Thread Class?

2008-05-11 Thread Ville M. Vainio
bc90021 <[EMAIL PROTECTED]> writes: > The error message was at the top of the thread (am I incapable of posting > it, or are you incapable of following a thread?), but here it is again: > > IOError: [Errno 2] no such file u'tempfileName' Typically, when you report an error message, it helps to

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

2008-05-11 Thread Arnaud Delobelle
John Salerno <[EMAIL PROTECTED]> writes: > John Salerno 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

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

2008-05-11 Thread John Salerno
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: --- people = ['Sam', 'Bob', 'Fred'] for name in people: print name --- AND --- num = 33 fo

Re: File Creation Not Working In A Thread Class?

2008-05-11 Thread bc90021
On Sun, 11 May 2008 19:55:31 +, Duncan Booth wrote: > 7stud <[EMAIL PROTECTED]> wrote: > > >>                             tempfileName = "\"proctemp\\" >>                             + >> self.matrix[c][0] + "_other.txt\"" > > It wouldn't exactly result in either of the error messages you p

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

2008-05-11 Thread John Salerno
John Salerno 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 of the for loop seems to be for iterating through a

Re: File Creation Not Working In A Thread Class?

2008-05-11 Thread bc90021
[CUT] > I have in no way assumed that you are stupid. I have tried to help you > formulate your problem better so that people on the list can help you. > I believe I have done so respectfully, with the aim of introducing you > to the modus operandi of this group. I appreciate your help. However

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

2008-05-11 Thread Terry Reedy
"XLiIV" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] 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 ti

Re: File Creation Not Working In A Thread Class?

2008-05-11 Thread 7stud
On May 11, 2:01 pm, 7stud <[EMAIL PROTECTED]> wrote: > On May 11, 1:28 pm, bc90021 <[EMAIL PROTECTED]> 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 anymo

Re: File Creation Not Working In A Thread Class?

2008-05-11 Thread 7stud
On May 11, 1:28 pm, bc90021 <[EMAIL PROTECTED]> 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

Re: observer pattern (notification chain synchronization)

2008-05-11 Thread Ville M. Vainio
Alan Isaac <[EMAIL PROTECTED]> writes: > OK, thanks. > > Another approach is to begin with a set of stocks > > and remove them as they report. You can then trigger > > a report with the empty set instead of repeatedly > > calling ``all``. After a report the set can be > > "refilled". Ah, and I

Re: observer pattern (notification chain synchronization)

2008-05-11 Thread Ville M. Vainio
Alan Isaac <[EMAIL PROTECTED]> writes: > Here is one way: > > - for each fund, create a ``reportreceived`` dict that maps stocks to > booleans (initially False) > - as each stock notifies its funds, the fund changes False to True and checks > ``all(reportreceived.values())`` to determine whethe

Re: File Creation Not Working In A Thread Class?

2008-05-11 Thread Duncan Booth
7stud <[EMAIL PROTECTED]> wrote: >>                                     >                             tempfileName = "\"proctemp\\" + > self.matrix[c][0] + "_other.txt\"" It wouldn't exactly result in either of the error messages you posted, but I expect the spurious quote marks round the file

Re: File Creation Not Working In A Thread Class?

2008-05-11 Thread Duncan Booth
bc90021 <[EMAIL PROTECTED]> wrote: > The error message was at the top of the thread (am I incapable of > posting it, or are you incapable of following a thread?), but here it > is again: > > IOError: [Errno 2] no such file u'tempfileName' So which was it? At the top of the thread you said it wa

Re: File Creation Not Working In A Thread Class?

2008-05-11 Thread Arnaud Delobelle
bc90021 <[EMAIL PROTECTED]> writes: >> ...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

Re: File Creation Not Working In A Thread Class?

2008-05-11 Thread 7stud
bc90021 wrote: > Hi All, > > Thanks in advance for any and all help! > > I have this code: > > g = open(fileName, 'a') > > where fileName is defined before the line it's used in. It works fine > when I use it outside a thread class. > > When I put the same line in a thread class, it no longer work

Re: diffing and uniqing directories

2008-05-11 Thread Dan Stromberg
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 find through a pair of directory trees, makes a SHA1 of each file and >

Re: File Creation Not Working In A Thread Class?

2008-05-11 Thread bc90021
> ...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 people who have

Re: File Creation Not Working In A Thread Class?

2008-05-11 Thread 7stud
On May 11, 12:42 pm, bc90021 <[EMAIL PROTECTED]> wrote: > > It's difficult to know what's wrong with the code you posted because: > > > * it is not self-contained: otherFile, fileName, pattern are names > >   which you do not define; > > > * the IOError you reported earlier can't arise as a result

Re: Problem with custom events in wxpython

2008-05-11 Thread 7stud
On May 11, 7:23 am, Jimmy <[EMAIL PROTECTED]> wrote: > 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

frameword vs application server?

2008-05-11 Thread walterbyrd
Can somebody help me understand the difference? Not just where Python is concerned, but in general? As I understand it, an application server is supposed to be a great help in developing apps, because most of the business logic is already there. It seems to me that, usually when applications serve

Re: File Creation Not Working In A Thread Class?

2008-05-11 Thread bc90021
> It's difficult to know what's wrong with the code you posted because: > > * it is not self-contained: otherFile, fileName, pattern are names > which you do not define; > > * the IOError you reported earlier can't arise as a result of running > this code. > > * you claim it works unless you

Re: File Creation Not Working In A Thread Class?

2008-05-11 Thread Arnaud Delobelle
Arnaud Delobelle <[EMAIL PROTECTED]> writes: > bc90021 <[EMAIL PROTECTED]> writes: > >> On Sun, 11 May 2008 18:36:25 +0100, Arnaud Delobelle wrote: >> >>> bc90021 <[EMAIL PROTECTED]> writes: >>> Hi All, Thanks in advance for any and all help! I have this code: g

  1   2   >