Re: "Super()" confusion

2009-02-09 Thread Chris Rebert
On Mon, Feb 9, 2009 at 4:18 PM, Lionel wrote: > On Feb 9, 4:04 pm, Jean-Paul Calderone wrote: >> On Mon, 9 Feb 2009 15:20:05 -0800 (PST), Lionel >> wrote: >> >Hello. I've been scouring the web looking for something to clear up a >> >little confusion about the use of "super()" but haven't found

Re: "Super()" confusion

2009-02-09 Thread Jean-Paul Calderone
On Mon, 9 Feb 2009 16:18:34 -0800 (PST), Lionel wrote: On Feb 9, 4:04 pm, Jean-Paul Calderone wrote: On Mon, 9 Feb 2009 15:20:05 -0800 (PST), Lionel wrote: >Hello. I've been scouring the web looking for something to clear up a >little confusion about the use of "super()" but haven't found any

how to find out vesion of a python module

2009-02-09 Thread Atishay
I have Python Image Library installed. I do not know how to find out its version. How can I do that? Secondly, I get error if I say "import ImageFont" ImportError: The _imaging C module is not installed I have _imaging module though [bash]# file PIL/_imaging.so PIL/_imaging.so: ELF 32-bit LSB

Re: Simple question - stock market simulation

2009-02-09 Thread cptn.spoon
On Feb 10, 10:26 am, Robert Kern wrote: > On 2009-02-09 17:10, cptn.spoon wrote: > > > > > On Feb 9, 6:48 pm, "Hendrik van Rooyen"  wrote: > >> "cptn.spoon"  wrote: > > >> On Feb 9, 3:58 pm, Paul Rubin  wrote: > > >>> Thanks Paul! I thought this might be the case. So

AJAX Post requests

2009-02-09 Thread PJ
Hi, I have a simple web server using BaseHTTPServer, and the def do_POST (self) function works fine for regular forms that are submitted to it, but when I send an AJAX POST to it it does nothing (I've tried to just get it to print to check it's nothing else but it doesn't even do that, although it

Re: how to find out vesion of a python module

2009-02-09 Thread Gary Herron
Atishay wrote: > I have Python Image Library installed. I do not know how to find out > its version. How can I do that? > There is no standard way. However many module authors do include soch information, usually in an attribute named version or __version__, or VERSION. PIL uses the VERSION

Re: "Super()" confusion

2009-02-09 Thread Daniel Fetchinson
>>Hello. I've been scouring the web looking for something to clear up a >>little confusion about the use of "super()" but haven't found anything >>that really helps. Here's my simple example: >> >> [snip] >> >>"super(Child,self).__init__(filePath) >>TypeError: super() argument 1 must be type, not c

Re: "Super()" confusion

2009-02-09 Thread Jean-Paul Calderone
On Mon, 9 Feb 2009 17:19:41 -0800, Daniel Fetchinson wrote: Hello. I've been scouring the web looking for something to clear up a little confusion about the use of "super()" but haven't found anything that really helps. Here's my simple example: [snip] "super(Child,self).__init__(filePath) Ty

PyCon 2009: Call for sprint projects

2009-02-09 Thread Jacob Kaplan-Moss
Python-related projects: join the PyCon Development Sprints! The development sprints are a key part of PyCon, a chance for the contributors to open-source projects to get together face-to-face for up to four days of intensive learning and development. Newbies sit at the same table as the gurus, go

Re: "Super()" confusion

2009-02-09 Thread Daniel Fetchinson
Hello. I've been scouring the web looking for something to clear up a little confusion about the use of "super()" but haven't found anything that really helps. Here's my simple example: [snip] "super(Child,self).__init__(filePath) TypeError: super() argument 1 mus

Re: wsdl2py/ZSI and complex types with arrays

2009-02-09 Thread Cameron Simpson
On 04Feb2009 15:55, eviljonny wrote: | I have been trying to write a web service using ZSI with wsdl2py. I have | read 'The Zolera Soap Infrastructure User’s Guide Release 2.0.0' and some | older guides (a guide by Nortel called Using ZSI with wsdl2py) and am | unable to find any working exampl

ANN: SuPy 1.0 for Windows

2009-02-09 Thread Greg Ewing
SuPy 1.0 - Windows -- I have created a Windows binary of SuPy. http://www.cosc.canterbury.ac.nz/greg.ewing/SuPy/ Currently only Python 2.3 is supported. (I'm working on a Python 2.5 version, but there are problems.) It has only been tested with Sketchup 7, although there's a

Re: how to find out vesion of a python module

2009-02-09 Thread Atishay
> > There is no standard way.  However many module authors do include soch > information, usually in an attribute named version or __version__, or > VERSION.  PIL uses the VERSION > > import Image > print Image.VERSION Thank you very much. This works > > > Secondly, I get error if I say "import

Re: "Super()" confusion

2009-02-09 Thread Jean-Paul Calderone
On Mon, 9 Feb 2009 17:34:05 -0800, Daniel Fetchinson wrote: Hello. I've been scouring the web looking for something to clear up a little confusion about the use of "super()" but haven't found anything that really helps. Here's my simple example: [snip] "super(Child,self).__init__(filePath) Ty

Re: "Super()" confusion

2009-02-09 Thread Benjamin Peterson
Jean-Paul Calderone divmod.com> writes: > Consider whether you really need to use super(). > > http://fuhm.net/super-harmful/ This article chiefly deals with super()'s harm in multiple inteheritance situations. For the simple case, though, like that presented by the OP, I believe super() is perf

python-list

2009-02-09 Thread Daniel Zhou
python-list -- http://mail.python.org/mailman/listinfo/python-list

Re: Scanning a file character by character

2009-02-09 Thread Spacebar265
On Feb 9, 5:13 pm, Steve Holden wrote: > Spacebar265 wrote: > > On Feb 7, 2:17 am, Jorgen Grahn wrote: > >> On Wed, 4 Feb 2009 22:48:13 -0800 (PST), Spacebar265 > >> wrote: > >>> Hi. Does anyone know how to scan a filecharacterbycharacterand > >>> have eachcharacterso I can put it into a variab

Re: "Super()" confusion

2009-02-09 Thread Gabriel Genellina
En Mon, 09 Feb 2009 23:34:05 -0200, Daniel Fetchinson escribió: Hello. I've been scouring the web looking for something to clear up a little confusion about the use of "super()" but haven't found anything that really helps. Here's my simple example: [snip] "super(Child,self).__init__(fil

Python Launcher.app on OS X

2009-02-09 Thread kpp9c
I am very confused about the current state of Python on OS X 10.5. Looks like Apple ships with 2.5.1 and that is also the latest installer for OS 10.5. The notes on the wiki page found here: http://wiki.python.org/moin/MacPython/Leopard Say: Mac OS X 10.5.x (Leopard) comes with the 2.5.1 Python

Re: "Super()" confusion

2009-02-09 Thread Steven D'Aprano
On Mon, 09 Feb 2009 17:34:05 -0800, Daniel Fetchinson wrote: ... Consider whether you really need to use super(). http://fuhm.net/super-harmful/ >>> >>>Did you actually read that article, understood it, went through the >>>tons of responses from python-dev team members, including Gu

Re: Scanning a file character by character

2009-02-09 Thread Steven D'Aprano
On Mon, 09 Feb 2009 19:10:28 -0800, Spacebar265 wrote: > How would I do separate lines into words without scanning one character > at a time? Scan a line at a time, then split each line into words. for line in open('myfile.txt'): words = line.split() should work for a particularly simple-

Re: Best 3d graphics kit for CAD program???

2009-02-09 Thread r
OpenCascade looks promising. I had look at this before a while back and forgot about it. For now i am taking the OpenGL plunge and I will see where that takes me...? Thanks Duane -- http://mail.python.org/mailman/listinfo/python-list

Re: Small socket problem

2009-02-09 Thread John O'Hagan
On Mon, 9 Feb 2009, Gabriel Genellina wrote: > En Mon, 09 Feb 2009 07:43:36 -0200, John O'Hagan > > escribió: > > I'm using the socket module (python 2.5) like this (where 'options' > > refers to > > an optparse object) to connect to the Fluidsynth program: > > > > host = "localhost" >

Re: adodb has no attribute connect

2009-02-09 Thread Rahul
On Feb 10, 5:01 am, "Diez B. Roggisch" wrote: > Rahul schrieb: > > > Hello all, > > > I have to access data from database usingadodbso I did > > > Importadodb > > Conn=adodb.NewADOConnection("odbc") > > > Upto this it works properly but when I say > > It does not. It returns None, thus the followi

Re: generator object or 'send' method?

2009-02-09 Thread John O'Hagan
On Mon, 9 Feb 2009, Aaron Brady wrote: > Hello, > > I am writing a generator to return a sequence of numbers with some > variation. The parameters of the variation can be changed by the > caller, even after the generator is started. [...] I would love to see a simple code example of this if you

Re: "Super()" confusion

2009-02-09 Thread Michele Simionato
On Feb 10, 4:29 am, "Gabriel Genellina" > AFAIK, all facts appearing in said article are still true (except for 3.x   > which uses a shorter form). If super usage had been clearly documented in   > the first place, this had not happened. > Perhaps you could point us to some resource explaining how

Re: generator object or 'send' method?

2009-02-09 Thread Steven D'Aprano
On Tue, 10 Feb 2009 05:28:26 +, John O'Hagan wrote: > On Mon, 9 Feb 2009, Aaron Brady wrote: >> Hello, >> >> I am writing a generator to return a sequence of numbers with some >> variation. The parameters of the variation can be changed by the >> caller, even after the generator is started. >

select error 10093 on winxp

2009-02-09 Thread Ken
I was testing select on windows xp with python 2.6.1, the code is simple: import sys import select def testSelect(): r = select.select([sys.stdin], [], [], 5.0) print r if __name__ == "__main__": try: testSelect() except select.error, e: print e While an error ra

can multi-core improve single funciton?

2009-02-09 Thread oyster
I mean this [code] def fib(n): if n<=1: return 1 return fib(n-1)+fib(n-2) useCore(1) timeit(fib(500)) #this show 20 seconds useCore(2) timeit(fib(500)) #this show 10 seconds [/code] Is it possible? and more, can threads/multi-processors/clusters be used to improve fib? thanx --

Re: can multi-core improve single funciton?

2009-02-09 Thread Chris Rebert
On Mon, Feb 9, 2009 at 10:28 PM, oyster wrote: > I mean this > [code] > def fib(n): >if n<=1: >return 1 >return fib(n-1)+fib(n-2) > > useCore(1) > timeit(fib(500)) #this show 20 seconds > > useCore(2) > timeit(fib(500)) #this show 10 seconds > [/code] > > Is it possible? > > and mo

Re: 'Import sys' succeeds in C++ embedded code, but module is not fully visible

2009-02-09 Thread greg
Ben Sizer wrote: Yes, this seems to fix it, thanks. But why? Can some Python guru explain why these two dictionaries must be the same? (Or what steps we must take if we want them to be separate?) What's happening is that the import statement is binding the name 'sys' in the locals, not the glob

Re: select error 10093 on winxp

2009-02-09 Thread Gabriel Genellina
En Tue, 10 Feb 2009 04:11:31 -0200, Ken escribió: I was testing select on windows xp with python 2.6.1, the code is simple: See the note in the documentation of module select: http://docs.python.org/library/select.html#select.select "Note: File objects on Windows are not acceptable, but sock

Re: wxPython vs Glade?

2009-02-09 Thread Hendrik van Rooyen
"Steve Holden" wrote: > There's something called PythonCard built on top of wxPython that's > fairly newb-friendly, though it gets clunkier as your demands grow. > > You might also want to look at Dabo, which is a much more comprehensive > framework that also hides much of wxPython's complexity.

What's wrong with my python? I can't use string

2009-02-09 Thread Frank Potter
I have a xxx.py which has code as below: import string print dir(string) print string.printable when I run it, I got the strange error: "\n" "\n" "##result##\n" "##msg##\n" "##pass_no##\n" "##pot_num##\n" "##pots_mashed##\n" "##yb_used##\n" "##right##\n" "\n" ['__builtins__', '__doc__', '__fil

Re: What's wrong with my python? I can't use string

2009-02-09 Thread Chris Rebert
On Mon, Feb 9, 2009 at 11:13 PM, Frank Potter wrote: > I have a xxx.py which has code as below: > > import string > > print dir(string) > print string.printable > > > when I run it, I got the strange error: > > "\n" > "\n" > "##result##\n" > "##msg##\n" > "##pass_no##\n" > "##pot_num##\n" > "##pot

Re: What's wrong with my python? I can't use string

2009-02-09 Thread Frank Potter
On Feb 10, 3:20 pm, Chris Rebert wrote: > On Mon, Feb 9, 2009 at 11:13 PM, Frank Potter wrote: > > I have a xxx.py which has code as below: > > > import string > > > print dir(string) > > print string.printable > > > when I run it, I got the strange error: > > > "\n" > > "\n" > > "##result##\n" >

Re: Python binaries with VC++ 8.0?

2009-02-09 Thread Tim Roberts
Carl Banks wrote: > >I'm pretty sure 2.6.1 is compiled with 8.0. However, I think the >Visual C++ 8.0 uses msvcrt90.dll. No, the two digits of the DLL match the version number of C++. The confusion arises because the product is called "Visual Studio 2008", but it includes Visual C++ 9.0, and he

Re: can multi-core improve single funciton?

2009-02-09 Thread Steven D'Aprano
On Tue, 10 Feb 2009 14:28:15 +0800, oyster wrote: > I mean this > [code] > def fib(n): > if n<=1: > return 1 > return fib(n-1)+fib(n-2) > > useCore(1) > timeit(fib(500)) #this show 20 seconds > > useCore(2) > timeit(fib(500)) #this show 10 seconds [/code] > > Is it possible? Wh

Problem with Tkinter's scale function.

2009-02-09 Thread Nicholas Feinberg
Not the widget, the function in Canvas. So far as I can tell, integer values for scale work fine; you can scale something to a factor of 2, 3, 17, etc. Float values for scale - such as you might use if you were, say, trying to scale a rectangle to half its current size - also work, insofar as the t

Re: AJAX Post requests

2009-02-09 Thread Tim Roberts
PJ wrote: > >I have a simple web server using BaseHTTPServer, and the def do_POST >(self) function works fine for regular forms that are submitted to it, >but when I send an AJAX POST to it it does nothing (I've tried to just >get it to print to check it's nothing else but it doesn't even do >tha

Re: can multi-core improve single funciton?

2009-02-09 Thread Paul McGuire
On Feb 10, 12:43 am, Chris Rebert wrote: > Considering the GIL, I highly doubt it so. Also, the algorithm is > fundamentally linear -- each result depends on previous results -- so > I don't think you can easily parallelize it (if at all). You'd > probably get greater speedup using memoization. >

Re: Python binaries with VC++ 8.0?

2009-02-09 Thread Paul Rubin
In case anyone is interested: Gideon Smeding of the University of Utrecht has written a masters' thesis titled "An executable operational semantics for Python". It is actually a formal semantics for a Python subset called minpy. Per the blurb, the semantics are described in literate Haskell that

Re: Variable + String Format

2009-02-09 Thread Joel Ross
Joel Ross wrote: Hi all, I have this piece of code: # wordList = "/tmp/Wordlist" file = open(wordList, 'r+b') def readLines(): for line in file.read(): if not line: break print line + '.co

<    1   2