Re: py3k s***s

2008-04-16 Thread Carl Banks
On Apr 16, 12:40 pm, Aaron Watters <[EMAIL PROTECTED]> wrote: > On Apr 16, 12:27 pm, Rhamphoryncus <[EMAIL PROTECTED]> wrote: > > > On Apr 16, 6:56 am, Aaron Watters <[EMAIL PROTECTED]> wrote: > > > > I don't get it. It ain't broke. Don't fix it. > > > So how would you have done the old-style cla

Re: Brand New!

2008-04-16 Thread s0suk3
On Apr 14, 9:00 pm, agent E 10 <[EMAIL PROTECTED]> wrote: >Hi, I'm brand new to programming. Have any suggestions? I'm young. > Was it a good idea to start with python? I was planning on creating a > very simple program that asked yes/no questions for a school project. > > -Thanks! Hey! That's

Re: Passing the output of a thread to the caller.

2008-04-16 Thread Gabriel Genellina
En Wed, 16 Apr 2008 16:29:48 -0300, Marlin Rowley <[EMAIL PROTECTED]> escribió: > I have a thread that I've created from a main program. I started this > thread and passed it a function to execute. Within this function are > 'print' statements. While they are directly translated to the st

Death of NNTP greatly exaggerated (was: Finally had to plonk google gorups.)

2008-04-16 Thread Ben Finney
Michael Torrie <[EMAIL PROTECTED]> writes: > I rarely use NNTP these days. I access c.l.py exclusively via e-mail, > and that works very well. I rarely use email for technical mailing lists these days. I access such forums exclusively via NNTP nntp://news.gmane.org>, and that works very well. >

Re: def power, problem when raising power to decimals

2008-04-16 Thread John Machin
[EMAIL PROTECTED] wrote: > how do i solve power(5,1.3)? Is this a trick question? OK, I'll bite: >>> 5 ** 1.3 8.1032829834638136 >>> > > def power(nbr, po): > if po==0: > return 1 > if po>0: > return nbr*power(nbr, po-1) > if po<0: > return 1/power(nbr, -1*

Re: Profiling, recursive func slower than imperative, normal?

2008-04-16 Thread Gabriel Genellina
En Wed, 16 Apr 2008 17:53:16 -0300, <[EMAIL PROTECTED]> escribió: > On Apr 16, 3:27 pm, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: > >> Any function can be implemented without recursion, although it isn't >> always easy or fun. >> > Really? I'm curious about that, I can't figure out how that w

Re: How to have unittest tests to be executed in the order they appear?

2008-04-16 Thread Ben Finney
Matthew Woodcraft <[EMAIL PROTECTED]> writes: > Ben Finney <[EMAIL PROTECTED]> wrote: > > Your test cases should *not* depend on any state from other test > > cases; they should function equally well when executed in any > > arbitrary sequence. Dependencies between separate test cases (e.g. > > "

Re: def power, problem when raising power to decimals

2008-04-16 Thread Gabriel Genellina
En Wed, 16 Apr 2008 19:21:18 -0300, John Machin <[EMAIL PROTECTED]> escribió: > [EMAIL PROTECTED] wrote: >> also i found a link which states 0^0 isnt 1 even though every >> calculator ive tried says it is. >> it doesnt say what it is but i presume 0 then. >> but it seems the dude is wrong and it

Re: def power, problem when raising power to decimals

2008-04-16 Thread Mensanator
On Apr 16, 5:49 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Wed, 16 Apr 2008 19:21:18 -0300, John Machin <[EMAIL PROTECTED]>   > escribió: > > > [EMAIL PROTECTED] wrote: > >> also i found a link which states 0^0 isnt 1 even though every > >> calculator ive tried says it is. > >> it does

Re: import hooks

2008-04-16 Thread Gabriel Genellina
En Wed, 16 Apr 2008 09:04:36 -0300, Patrick Stinson <[EMAIL PROTECTED]> escribió: > I am defining a simple finder/loader object and adding it to > sys.meta_path > like this: > > PyRun_SimpleString("import sys; import ousiainternal; sys.meta_path = > [ousiainternal.OusiaImporter]"); You should

Re: Creating arithmetic sequences

2008-04-16 Thread Robert Kern
mmm wrote: > I wrote the code below to create simple arithmetic sequences that are > iter-able > I.e., this would basically combine the NUMPY arange(start,end,step) > to range(start,end), with step not necessarily an integer. > > The code below is in its simplest form and I want to generalize th

Re: [Python-Dev] Global Python Sprint Weekends: May 10th-11th and June 21st-22nd.

2008-04-16 Thread Thomas Lee
Anyone in Melbourne, Australia keen for the first sprint? I'm not sure if I'll be available, but if I can it'd be great to work with some others. Failing that, it's red bull and pizza in my lounge room :) I've been working on some neat code for an AST optimizer. If I'm free that weekend, I'll p

Re: How to have unittest tests to be executed in the order they appear?

2008-04-16 Thread Matthew Woodcraft
Ben Finney <[EMAIL PROTECTED]> wrote: > Surely, since "suddenly" implies you changed one small area of the > code, that area of the code is the best place to look for what caused > the failure. Imagine that "suddenly" immediately follows "I upgraded to etch". -M- -- http://mail.python.org/mailm

Re: How to have unittest tests to be executed in the order they appear?

2008-04-16 Thread Roy Smith
Ben Finney <[EMAIL PROTECTED]> wrote: > Surely, since "suddenly" implies you changed one small area of the > code, that area of the code is the best place to look for what caused > the failure. Sometimes it's the environment that's changed. Yes, I know, a good unit test doesn't depend on the en

Re: Death of NNTP greatly exaggerated

2008-04-16 Thread Steve Holden
Ben Finney wrote: > Michael Torrie <[EMAIL PROTECTED]> writes: > >> I rarely use NNTP these days. I access c.l.py exclusively via e-mail, >> and that works very well. > > I rarely use email for technical mailing lists these days. I access > such forums exclusively via NNTP nntp://news.gmane.org>

Re: Finally had to plonk google gorups.

2008-04-16 Thread Kam-Hung Soh
On Apr 17, 1:14 am, Mike Kent <[EMAIL PROTECTED]> wrote: > On Apr 16, 10:26 am, Mike Driscoll <[EMAIL PROTECTED]> wrote: > > > Yeah, I noticed that Google Groups has really sucked this week. I'm > > using the Google Groups Killfile for Greasemonkey now and it helps a > > lot. I like Google, but my

TypeNone field detection

2008-04-16 Thread Joe Blow
What is the best way to detect a TypeNone field in a tuple, or in a list? I am accessing a MySQL database using the MySQLdb Python interface... this interface returns a tuple object type in response to SQL SELECT statements. My understanding of the MySQLdb interface is that NULL database values a

I just killed GIL!!!

2008-04-16 Thread sturlamolden
Hello Guys... I just had one moment of exceptional clarity, during which realized how I could get the GIL out of my way... It's so simple, I cannot help wondering why nobody has thought of it before. Duh! Now I am going to sit and and marvel at my creation for a while, and then go to bed (it's pas

Logical Operator and code block not executing (newbie question)

2008-04-16 Thread python newbie
Hello, I am running into a small problem of not having a code block not executing after after a logical operator is true. What am I missing or doing wrong. Any thoughts or opinions would be greatly appreciated. The block that isn't being executed follows: elif (guess == the_number) and (

Re: How is GUI programming in Python?

2008-04-16 Thread sturlamolden
On Apr 16, 4:17 am, [EMAIL PROTECTED] wrote: > Reformulating my question: > > Which GUI tool, wxPython or PyQt, is more pythonic? (Please, ignore > the license issue because I am thinking about FOSS) None of them, all three of them (you forgot PyGTK), or it doesn't matter more. Nobody with their

Re: Logical Operator and code block not executing (newbie question)

2008-04-16 Thread Ben Kaplan
The problem is that your loop says "while guess != number". When guess is equal to the number, the code in the loop is not executed. Instead, do something like while guess != number and tries < total_attempts: if guess > number: ... elif guess < number: ... if guess == number :

Re: TypeNone field detection

2008-04-16 Thread Steve Holden
Joe Blow wrote: > What is the best way to detect a TypeNone field in a tuple, or in a list? > > I am accessing a MySQL database using the MySQLdb Python interface... this > interface returns a tuple object type in response to SQL SELECT > statements. My understanding of the MySQLdb interface is t

Re: TypeNone field detection

2008-04-16 Thread Mensanator
On Apr 16, 7:24 pm, Joe Blow <[EMAIL PROTECTED]> wrote: > What is the best way to detect a TypeNone field in a tuple, or in a list? > > I am accessing a MySQL database using the MySQLdb Python interface... this > interface returns a tuple object type in response to SQL SELECT > statements.  My unde

index of list of lists

2008-04-16 Thread Daniel NL
yes, there's a thread with the same title, but I believe mine is more appropriate title. so, as much as I search on the web, read manuals, tutorials, mail-lists (including this one) I cannot figure it out how to search a string in a list of lists. like this one: someList = [['somestring', 1, 2]

Re: I just killed GIL!!!

2008-04-16 Thread Daniel Fetchinson
> Hello Guys... > > I just had one moment of exceptional clarity, during which realized > how I could get the GIL out of my way... It's so simple, I cannot help > wondering why nobody has thought of it before. Duh! Now I am going to > sit and and marvel at my creation for a while, and then go to be

Python and stale file handles

2008-04-16 Thread tgiles
Hi, All! I started back programming Python again after a hiatus of several years and run into a sticky problem that I can't seem to fix, regardless of how hard I try- it it starts with tailing a log file. Basically, I'm trying to tail a log file and send the contents elsewhere in the script (here

Re: index of list of lists

2008-04-16 Thread Daniel Fetchinson
> yes, there's a thread with the same title, but I believe mine is more > appropriate title. > so, as much as I search on the web, read manuals, tutorials, mail-lists > (including this one) I cannot figure it out how to search a string in a > list of lists. > like this one: > > someList = [['somest

Metaprogramming Example

2008-04-16 Thread andrew cooke
Hi, Thanks for the help a couple of days ago. I completed what I was doing and wrote a summary which I've posted at http://acooke.org/cute/PythonMeta0.html (it's kind of long to post here). I hope it might be useful to someone else - it's complete code for a simple metaprogramming task that us

Re: Profiling, recursive func slower than imperative, normal?

2008-04-16 Thread Terry Reedy
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | the 0.409 vs 0.095 is the total times right? | so the imperative function is >4 times faster than the recursive. | or what does tottime stand for? | | is this always the case that the recursive function is slower? | the gain is less co

Re: Finally had to plonk google gorups.

2008-04-16 Thread John Salerno
Grant Edwards wrote: > This morning almost half of c.l.p was spam. In order to try to > not tar both the benign google group users and the malignant > ones with the same brush, I've been trying to kill usenet spam > with subject patterns. But that's not a battle you can win, so > I broke down and

RE: Splitting MainWindow Class over several modules.

2008-04-16 Thread Ryan Ginstrom
> On Behalf Of Mike Driscoll > I don't think there's anything wrong with it. The main thing > to remember is to try to keep the interface and the logic > separate. I have a fairly complex program with lots of tabs > and sub tabs. So I stuck each of the tab's display code in a > separate file an

Re: def power, problem when raising power to decimals

2008-04-16 Thread Terry Reedy
"Mark Dickinson" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] On Apr 16, 4:19 pm, [EMAIL PROTECTED] wrote: > how do i solve power(5,1.3)? > [...] > > also i found a link which states 0^0 isnt 1 even though every > calculator ive tried says it is. > it doesnt say what it is but i pr

Re: Default parameter for a method

2008-04-16 Thread Terry Reedy
"John Nagle" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | [EMAIL PROTECTED] wrote: | > I wanted to know if there's any way to create a method that takes a | > default parameter, and that parameter's default value is the return | > value of another method of the same class. For ex

Re: urllib working differently when run from crontab

2008-04-16 Thread VictorMiller
On Apr 14, 8:33 am, Matthew Woodcraft <[EMAIL PROTECTED]> wrote: > In article <[EMAIL PROTECTED]>, > > VictorMiller <[EMAIL PROTECTED]> wrote: > > I've written a python script which, using urllib, and urllib2 will > > fetch a number of files that that I'm interested in from various > > websites (t

DBXML and removeDocument in Python

2008-04-16 Thread Peter Robinson
I am trying to add and remove documents in a container in Berkeley/ Oracle DB XML within Python, on Mac OS X Leopard. putDocument works fine, but I keep getting 'attributeError' when I try removeDocument. I can't find any documentation on removeDocument in Python and it is not in the examples.

Python plugin for Firefox

2008-04-16 Thread zelegolas
Hi, It's may be a stupid question but do you if someone tried to create a python plugin for firefox? If you know an Open Source project let me know... Thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: Default parameter for a method

2008-04-16 Thread George Sakkis
On Apr 16, 4:21 pm, John Nagle <[EMAIL PROTECTED]> wrote: > In general, default values should be immutable constants only. This is more restrictive than necessary; it should rather read "In general, default values should be *treated as* immutable objects only". It's perfectly fine for a default v

Re: I just killed GIL!!!

2008-04-16 Thread Tim Daneliuk
Daniel Fetchinson wrote: >> Hello Guys... >> >> I just had one moment of exceptional clarity, during which realized >> how I could get the GIL out of my way... It's so simple, I cannot help >> wondering why nobody has thought of it before. Duh! Now I am going to >> sit and and marvel at my creation

Re: I just killed GIL!!!

2008-04-16 Thread Torsten Bronger
Hallöchen! Tim Daneliuk writes: > Daniel Fetchinson wrote: > >> [...] >> >>> I just had one moment of exceptional clarity, during which >>> realized how I could get the GIL out of my way... It's so >>> simple, I cannot help wondering why nobody has thought of it >>> before. [...] >> >> If I were

Re: Python plugin for Firefox

2008-04-16 Thread Steve Holden
zelegolas wrote: > Hi, > > It's may be a stupid question but do you if someone tried to create a > python plugin for firefox? > If you know an Open Source project let me know... > > Thanks Look for references to Mark Hammond's PyCon keynote and the work he's been doing with the Mozilla team. r

sampling without replacement

2008-04-16 Thread braver
Greetings -- I am doing a sampling without replacement, taking out random elements from an array. The picked element is then removed from the array. When my arrays were on the order of 10,000 elements long, everything was fast. But when I increased them to 1,000,000 it suddenly was hours. I tra

the best ABOUT MP3 this year. have alook...

2008-04-16 Thread ghgggu
http://www.soundofmp3.info -- http://mail.python.org/mailman/listinfo/python-list

<    1   2   3