Python-URL! - weekly Python news and links (Nov 5)

2007-11-05 Thread Gabriel Genellina
QOTW: I've just done my first serious work in Python/IDLE, a small dot pre-processor for software modeling diagrams and I am very enthused. It should be called Pytho; it has the positive qualities of Play-Do and Lego: you get ideas squishing it through your fingers and it snaps together nicely

Pydev 1.3.10 Released

2007-11-05 Thread Fabio Zadrozny
Hi All, Pydev and Pydev Extensions 1.3.10 have been released Details on Pydev Extensions: http://www.fabioz.com/pydev Details on Pydev: http://pydev.sf.net Details on its development: http://pydev.blogspot.com Release Highlights in Pydev Extensions:

Failed to create bitmap image

2007-11-05 Thread Handrix
Hello, i'm using python 2.5 on vista, when i compile my script i got this error. wx._core.PyAssertionError: C++ assertion image.Ok() failed at ..\..\src\msw\bitmap.cpp(799) in wxBitmap::CreateFromImage(): invalid image Any idea about this error message ? Thanks, --

Re: python at command prompt

2007-11-05 Thread Ton van Vliet
On Sat, 03 Nov 2007 22:51:05 GMT, Tim Roberts [EMAIL PROTECTED] wrote: Ton van Vliet [EMAIL PROTECTED] wrote: There's could also be an issue with entering 'python' at the command line, and not 'python.exe'. Once the PATH is setup correctly, try to enter 'python.exe', and check whether that

parsing string to a list of objects - help!

2007-11-05 Thread Donn Ingle
Hi, I really hope someone can help me -- I'm stuck. I have written three versions of code over a week and still can't get past this problem, it's blocking my path to getting other code written. This might be a little hairy, but I'll try to keep it short. Situation: I want to pass a string to

Re: python newbie

2007-11-05 Thread Duncan Booth
Steven D'Aprano [EMAIL PROTECTED] wrote: As far as I know, all it would take to allow modules to be callable would be a single change to the module type, the equivalent of: def __call__(self, *args, **kwargs): try: # Special methods are retrieved from the class, not #

Re: __file__ vs __FILE__

2007-11-05 Thread sandipm
interestingly... I wanted to reuse this code so i wrote function in a file def getParentDir(): import os return os.path.dirname(os.path.abspath(__file__)) and called this function, in another file, its giving me parent directory of file where this function is defined.? how to reuse this

Re: Descriptors and side effects

2007-11-05 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : Hello everyone, I'm trying to do seemingly trivial thing with descriptors: have another attribute updated on dot access in object defined using descriptors. For example, let's take a simple example where you set an attribute s to a string and have another

Re: achieving performance using C/C++

2007-11-05 Thread Palindrom
Hi all, I'd be very interseted in a good tutorial for using C/C++ to optimize python code too ! Thanks in advance. sandipm wrote: I did fair amount of programming in python but never used c/c++ as mentioned below. any good tutorials for using C/C++ to optimize python codebase for

Re: parsing string to a list of objects - help!

2007-11-05 Thread Paul McGuire
On Nov 5, 3:00 am, Donn Ingle [EMAIL PROTECTED] wrote: I have glanced around at parsing and all the tech-speak confuses the heck out of me. I am not too smart and would appreciate any help that steers away from cold theory and simply hits at this problem. Donn - Here is a pyparsing version

Re: parsing string to a list of objects - help!

2007-11-05 Thread Donn Ingle
Wow Paul, you have given me much to chew. I'll start testing it in my slow way -- it looks so simple! Thank you. \d -- http://mail.python.org/mailman/listinfo/python-list

Re: Is pyparsing really a recursive descent parser?

2007-11-05 Thread Neil Cerutti
On 2007-11-05, Just Another Victim of the Ambient Morality [EMAIL PROTECTED] wrote: Neil Cerutti [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] There are different kinds of recursion. Compare: While interesting, none of this actually addresses the point I was making. I

Re: parsing string to a list of objects - help!

2007-11-05 Thread Donn Ingle
Paul, I quickly slapped your example into a py file for a first-glance test and the first part works, but the second gives me the error below. Could I have an old version of pyparser? I will dig into it anyway, just being lazy :) code: from pyparsing import * frame = Literal(#) tween = Word(-) #

Re: parsing string to a list of objects - help!

2007-11-05 Thread Donn Ingle
Wow Paul, you have given me much to chew. I'll start testing it in my slow way -- it looks so simple! Thank you. \d -- http://mail.python.org/mailman/listinfo/python-list

Re: Assertion for python scripts

2007-11-05 Thread Carl Banks
On Nov 2, 11:22 pm, Carl Banks [EMAIL PROTECTED] wrote: On Nov 2, 2:14 pm, matthias [EMAIL PROTECTED] wrote: Here is my question: How do I maintain debug / release builds that allow me to switch debug stmts, like assert, on / off ? If you want to distribute a single-file optimized

Re: achieving performance using C/C++

2007-11-05 Thread Filip Wasilewski
On Nov 5, 7:40 am, sandipm [EMAIL PROTECTED] wrote: I did fair amount of programming in python but never used c/c++ as mentioned below. any good tutorials for using C/C++ to optimize python codebase for performance? how widely do they use such kind of mixed coding practices? [...] Since you

Re: (MAC) CoreGraphics module???

2007-11-05 Thread David C. Ullrich
On Sun, 04 Nov 2007 15:56:21 -0600, Robert Kern [EMAIL PROTECTED] wrote: David C. Ullrich wrote: On Fri, 02 Nov 2007 14:09:25 -0500, Robert Kern [EMAIL PROTECTED] wrote: David C. Ullrich wrote: [???] Okay, which version of OS X do you have? In 10.3 and 10.4 it used to be here:

Downloading file from cgi application

2007-11-05 Thread sophie_newbie
Hi, I'm writing a cgi application in Python that generates a PDF file for the user and then allows them to download that file. Currently I'm just writing the PDF file to the 'htdocs' directory and giving the user a link to this file to download it. But the problem is that another user could

Re: Python good for data mining?

2007-11-05 Thread Greg Lindstrom
-- Forwarded message -- From: D.Hering [EMAIL PROTECTED] To: python-list@python.org Date: Sun, 04 Nov 2007 19:42:16 -0800 Subject: Re: Python good for data mining? On Nov 3, 9:02 pm, Jens [EMAIL PROTECTED] wrote: I'm starting a project indatamining, and I'm considering

Re: how does google search in phrase

2007-11-05 Thread Dustan
On Nov 4, 6:21 am, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: hi my friends; google can searching in phrase but it is imposible. it have a lot of page in data base and quadrillions sentence it can't search in fulltxt all of them .it need a super algorithm. ý need the algorithm now. if you

Re: how does google search in phrase

2007-11-05 Thread Jeff
Here is a detailed explanation: http://www.google.com/technology/pigeonrank.html -- http://mail.python.org/mailman/listinfo/python-list

Re: python at command prompt

2007-11-05 Thread Ton van Vliet
On Mon, 05 Nov 2007 11:03:36 +1100, [david] [EMAIL PROTECTED] wrote: Tim Roberts wrote: Ton van Vliet [EMAIL PROTECTED] wrote: There's could also be an issue with entering 'python' at the command line, and not 'python.exe'. Once the PATH is setup correctly, try to enter 'python.exe', and

pyparsing frames and tweens - take 2

2007-11-05 Thread Donn Ingle
Paul, frame = Literal(#) tween = Word(-) # that is, it is a word composed of 1 or more -'s copy = Literal(=) blank = Literal(_) animation = OneOrMore((frame + Optional( (tween + FollowedBy(frame)) | OneOrMore(copy | blank) ) ) ) I found that this form insists on having a # in char 0.

Re: how does google search in phrase

2007-11-05 Thread Dustan
On Nov 5, 7:14 am, Jeff [EMAIL PROTECTED] wrote: Here is a detailed explanation: http://www.google.com/technology/pigeonrank.html Ha ha... Hilarious. -- http://mail.python.org/mailman/listinfo/python-list

Re: Downloading file from cgi application

2007-11-05 Thread Jeff
Store the file in a database. When an authorized user clicks the link, send the proper headers ('Content-Type: application/pdf') and then print the file. -- http://mail.python.org/mailman/listinfo/python-list

Re: achieving performance using C/C++

2007-11-05 Thread Luis M . González
On Nov 5, 8:51 am, Filip Wasilewski [EMAIL PROTECTED] wrote: On Nov 5, 7:40 am, sandipm [EMAIL PROTECTED] wrote: I did fair amount of programming in python but never used c/c++ as mentioned below. any good tutorials for using C/C++ to optimize python codebase for performance? how widely

Re: achieving performance using C/C++

2007-11-05 Thread Jeff
shameless_self_promotion http://artfulcode.nfshost.com/files/extending_python_with_pyrex.html /shameless_self_promotion -- http://mail.python.org/mailman/listinfo/python-list

Re: Downloading file from cgi application

2007-11-05 Thread Diez B. Roggisch
sophie_newbie wrote: Hi, I'm writing a cgi application in Python that generates a PDF file for the user and then allows them to download that file. Currently I'm just writing the PDF file to the 'htdocs' directory and giving the user a link to this file to download it. But the problem is

Library package import question

2007-11-05 Thread Frank Aune
Hello, I have a python library package 'Foo', which contains alot of submodules: Foo/: __init__.py module1.py: class Bar() class Hmm() module2.py class Bee() class Wax() module3.py etc

Re: how does google search in phrase

2007-11-05 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: hi my friends; google can searching in phrase but it is imposible. it have a lot of page in data base and quadrillions sentence it can't search in fulltxt all of them .it need a super algorithm. ı need the algorithm now. if you have a idea ,pls share to me use

Re: Downloading file from cgi application

2007-11-05 Thread Jeff McNeil
You could also just store the files outside of the document root if you don't want to worry about a database. Then, as Jeff said, just print the proper Content-Type header and print the file out. On Nov 5, 2007, at 8:26 AM, Jeff wrote: Store the file in a database. When an authorized user

Re: Python good for data mining?

2007-11-05 Thread Jens
On 5 Nov., 04:42, D.Hering [EMAIL PROTECTED] wrote: On Nov 3, 9:02 pm, Jens [EMAIL PROTECTED] wrote: I'm starting a project indatamining, and I'm considering Python and Java as possible platforms. I'm conserned by performance. Most benchmarks report that Java is about 10-15 times

Re: Downloading file from cgi application

2007-11-05 Thread sophie_newbie
On Nov 5, 1:50 pm, Jeff McNeil [EMAIL PROTECTED] wrote: You could also just store the files outside of the document root if you don't want to worry about a database. Then, as Jeff said, just print the proper Content-Type header and print the file out. On Nov 5, 2007, at 8:26 AM, Jeff wrote:

Re: PyObjC with Xcode 3.0 Leopard

2007-11-05 Thread Kevin Walzer
flyfree wrote: I got an error during making a python application with xcode 3.0 in OS X Leopard. (KeyError: 'NSUnknownKeyException - [NSObject 0xd52fe0 valueForUndefinedKey:]: this class is not key value coding-compliant for the key calculatedMean.') The application is a simple example

Re: pyparsing frames and tweens - take 2

2007-11-05 Thread Paul McGuire
Donn - The exception you posted is from using an old version of pyparsing. You can get the latest from SourceForge - if you download the Windows binary install, please get the docs package too. It has a full doc directory (generated with epydoc), plus example scripts for a variety of

httplib.HTTPSConnection with timeout support (pyton 2.5.1)

2007-11-05 Thread mmomar
Hi, I am using a HTTPS connection to invoke a cgi-script. I want to use a timeout between the sending the request and receiving the response, so what I want to do is when the request is send, the client should wait for a specified time, drop the connection and then do some thing else. I found

Re: Python good for data mining?

2007-11-05 Thread Aaron Watters
On Nov 3, 9:02 pm, Jens [EMAIL PROTECTED] wrote: How good is the integration with MySQL in Python? I think it's very good. However, I'm not sure how good SQL really is for data mining, depending on what you mean by that. Please have a look at nucular for this kind of thing -- I've advertised

Re: Descriptors and side effects

2007-11-05 Thread Rich Harkins
[EMAIL PROTECTED] wrote: Hello everyone, I'm trying to do seemingly trivial thing with descriptors: have another attribute updated on dot access in object defined using descriptors. [snip] A setter function should have updated self.l just like it updated self.s: def

Python thinks file is empty

2007-11-05 Thread loial
I am writing a file in python with writelines f = open('/home/john/myfile',w) f.writelines(line1\n) f.writelines(line2\n) f.close() But whenever I try to do anything with the file in python it finds no data. I am trying ftp, copying the file...the resultant file is always 0 bytes, although if I

Re: pyparsing frames and tweens - take 2

2007-11-05 Thread Paul McGuire
Here is a first cut at processing the parsed objects, given a list of Property objects representing the frames at each '#': class Property(object): def __init__(self,**kwargs): self.__dict__.update(kwargs) def copy(self): return Property(**self.__dict__)

Re: Python good for data mining?

2007-11-05 Thread Maarten
On Nov 5, 1:51 pm, Jens [EMAIL PROTECTED] wrote: On 5 Nov., 04:42, D.Hering [EMAIL PROTECTED] wrote: On Nov 3, 9:02 pm, Jens [EMAIL PROTECTED] wrote: I then leaned C and then C++. I am now coming home to Python realizing after my self-eduction, that programming in Python is truly a

Re: Low-overhead GUI toolkit for Linux w/o X11?

2007-11-05 Thread Chris Mellon
On Nov 3, 2007 6:06 PM, Grant Edwards [EMAIL PROTECTED] wrote: On 2007-11-03, David Bolen [EMAIL PROTECTED] wrote: Grant Edwards [EMAIL PROTECTED] writes: I'm looking for GUI toolkits that work with directly with the Linux frambuffer (no X11). It's an embedded device with limited

Re: Python thinks file is empty

2007-11-05 Thread kyosohma
On Nov 5, 9:19 am, loial [EMAIL PROTECTED] wrote: I am writing a file in python with writelines f = open('/home/john/myfile',w) f.writelines(line1\n) f.writelines(line2\n) f.close() But whenever I try to do anything with the file in python it finds no data. I am trying ftp, copying the

Re: Python thinks file is empty

2007-11-05 Thread Tim Chase
loial wrote: I am writing a file in python with writelines f = open('/home/john/myfile',w) f.writelines(line1\n) f.writelines(line2\n) f.close() But whenever I try to do anything with the file in python it finds no data. I am trying ftp, copying the file...the resultant file is always

How can i find the form name without nr=0

2007-11-05 Thread scripteaze
Im using mechanize method for retrieving the form so that i may log into it. I need to find a way to get the form name. Its not listed anywhere in the html source.The reason i need to do this is because im tryin not to use the for loop below. Someone told me that the form name should be listed in

Re: How can i find the form name without nr=0

2007-11-05 Thread Diez B. Roggisch
scripteaze wrote: Im using mechanize method for retrieving the form so that i may log into it. I need to find a way to get the form name. Its not listed anywhere in the html source.The reason i need to do this is because im tryin not to use the for loop below. Someone told me that the form

Re: Python launcher not working on Mac after Leopard upgrade?

2007-11-05 Thread kyosohma
On Nov 3, 7:57 am, André [EMAIL PROTECTED] wrote: I just installed Leopard on my Mac. I already was using Python 2.5. I can run a Python script from a terminal window by typing python script.py as one would expect ... but not using the Python launcher either directly or indirectly (by double

Re: Adding GNU Readline after installation?

2007-11-05 Thread [EMAIL PROTECTED]
I really just want to get my up arrow history working... Google for rlwrap. Thanks for the rlwrap tip - much easier than reinstalling Python (for the short term). For anyone interested, I installed it and put this in my .bashrc file: alias python='rlwrap python' Now I have my up-arrow

Re: Descriptors and side effects

2007-11-05 Thread Bruno Desthuilliers
Rich Harkins a écrit : [EMAIL PROTECTED] wrote: Hello everyone, I'm trying to do seemingly trivial thing with descriptors: have another attribute updated on dot access in object defined using descriptors. [snip] A setter function should have updated self.l just like it updated self.s:

Re: Low-overhead GUI toolkit for Linux w/o X11?

2007-11-05 Thread Grant Edwards
On 2007-11-05, Chris Mellon [EMAIL PROTECTED] wrote: Yes, it's modern enough to run Linux/X11 -- horsepower-wise it's sort of in the PDA class of devices. wxWidgets has been tried, but it's pretty sluggish. Hence the search for something a little lighter weight. Using Python is probably

Re: Poor python and/or Zope performance on Sparc

2007-11-05 Thread pythoncurious
On Nov 3, 2:35 pm, joa2212 [EMAIL PROTECTED] wrote: Result: Almost even worse. The application is not scaling at all. Every time you start a request it is hanging around on one cpu and is devouring it at about 90-100% load. The other 31 CPUs which are shown in mpstat are bored at 0% load.

wxPython ListCtrl

2007-11-05 Thread vedrandekovic
Hello, How can I Insert image with string in ListCtrl with this example: # Import ftputil module - like ftplib from ftputil import FTPHost # Create connection ftp=FTPHost(ftp.someserver.com,user,password) # LIST ALL FILES/FOLDERS ON SERVER for item in ftp._dir(/): # Now check if item is

Re: How can i find the form name without nr=0

2007-11-05 Thread scripteaze
On Nov 5, 8:52 am, Diez B. Roggisch [EMAIL PROTECTED] wrote: scripteaze wrote: Im using mechanize method for retrieving the form so that i may log into it. I need to find a way to get the form name. Its not listed anywhere in the html source.The reason i need to do this is because im

Re: How can i find the form name without nr=0

2007-11-05 Thread Diez B. Roggisch
Well, i wasnt sure if you could have a form without a form name, i was just thinking that it had one but maybe hidden and that i could retrieve it How hidden? HTML source is ... THE source. there is nothing hidden in there. Diez -- http://mail.python.org/mailman/listinfo/python-list

Re: wxPython ListCtrl

2007-11-05 Thread kyosohma
On Nov 5, 11:00 am, [EMAIL PROTECTED] wrote: Hello, How can I Insert image with string in ListCtrl with this example: # Import ftputil module - like ftplib from ftputil import FTPHost # Create connection ftp=FTPHost(ftp.someserver.com,user,password) # LIST ALL FILES/FOLDERS ON SERVER

instance as a sequence

2007-11-05 Thread sndive
suppose i want to make foo.childNodes[bar] available as foo[bar] (while still providing access to the printxml/printprettyxml() functions and other functionality of dom/minidom instance). What is a good way to accomplish that? -- http://mail.python.org/mailman/listinfo/python-list

Re: Descriptors and side effects

2007-11-05 Thread Rich Harkins
Bruno Desthuilliers wrote: [snip] I'm sorry, but this looks like a very complicated way to do a simple thing: class MySimpleClass(object): def __init__(self, x): self.x = x self.y = x ** 2 Sure, for the absurdly simplified case I posed as an example. ;) Here's another:

Re: Descriptors and side effects

2007-11-05 Thread Rich Harkins
Bruno Desthuilliers wrote: Rich Harkins a écrit : [EMAIL PROTECTED] wrote: Hello everyone, I'm trying to do seemingly trivial thing with descriptors: have another attribute updated on dot access in object defined using descriptors. [snip] A setter function should have updated self.l just

Re: instance as a sequence

2007-11-05 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: suppose i want to make foo.childNodes[bar] available as foo[bar] (while still providing access to the printxml/printprettyxml() functions and other functionality of dom/minidom instance). What is a good way to accomplish that? Using element-tree. That already

Re: instance as a sequence

2007-11-05 Thread Paul McGuire
On Nov 5, 11:32 am, [EMAIL PROTECTED] wrote: suppose i want to make foo.childNodes[bar] available as foo[bar] (while still providing access to the printxml/printprettyxml() functions and other functionality of dom/minidom instance). What is a good way to accomplish that? define

Re: instance as a sequence

2007-11-05 Thread sndive
On Nov 5, 9:40 am, Paul McGuire [EMAIL PROTECTED] wrote: On Nov 5, 11:32 am, [EMAIL PROTECTED] wrote: suppose i want to make foo.childNodes[bar] available as foo[bar] (while still providing access to the printxml/printprettyxml() functions and other functionality of dom/minidom

Re: (MAC) CoreGraphics module???

2007-11-05 Thread Robert Kern
David C. Ullrich wrote: On Sun, 04 Nov 2007 15:56:21 -0600, Robert Kern [EMAIL PROTECTED] wrote: David C. Ullrich wrote: On Fri, 02 Nov 2007 14:09:25 -0500, Robert Kern [EMAIL PROTECTED] wrote: David C. Ullrich wrote: [???] Okay, which version of OS X do you have? In 10.3 and 10.4 it

Re: Python good for data mining?

2007-11-05 Thread Jens
On 5 Nov., 16:29, Maarten [EMAIL PROTECTED] wrote: On Nov 5, 1:51 pm, Jens [EMAIL PROTECTED] wrote: Premature optimization is the root of all evil, to quote a famous person. And he's right, as most people working larger codes will confirm. I guess I'll have to agree with that. Still, I would

Re: Python good for data mining?

2007-11-05 Thread Robert Kern
Jens wrote: On 5 Nov., 16:29, Maarten [EMAIL PROTECTED] wrote: On Nov 5, 1:51 pm, Jens [EMAIL PROTECTED] wrote: Premature optimization is the root of all evil, to quote a famous person. And he's right, as most people working larger codes will confirm. I guess I'll have to agree with

Re: Python good for data mining?

2007-11-05 Thread Jens
On 5 Nov., 16:29, Maarten [EMAIL PROTECTED] wrote: As for pytables: it is the most elegant programming interface for HDF on any platform that I've encountered so far. Most other platforms stay close the HDF5 library C-interface, which is low-level, and quite complex. PyTables was written with

Re: __file__ vs __FILE__

2007-11-05 Thread Matimus
On Nov 5, 1:07 am, sandipm [EMAIL PROTECTED] wrote: interestingly... I wanted to reuse this code so i wrote function in a file def getParentDir(): import os return os.path.dirname(os.path.abspath(__file__)) and called this function, in another file, its giving me parent directory

Re: Python good for data mining?

2007-11-05 Thread Aaron Watters
On Nov 4, 4:36 pm, Bruno Desthuilliers [EMAIL PROTECTED] wrote: How good is the integration with MySQL in Python? Pretty good - but I wouldn't call MySQL a serious RDBMS. I would disagree with this, for this particular case. I think it's probably better than most other rdbms's for apps like

Re: (MAC) CoreGraphics module???

2007-11-05 Thread David Ullrich
Robert Kern wrote: David C. Ullrich wrote: On Sun, 04 Nov 2007 15:56:21 -0600, Robert Kern [EMAIL PROTECTED] wrote: David C. Ullrich wrote: On Fri, 02 Nov 2007 14:09:25 -0500, Robert Kern [EMAIL PROTECTED] wrote: David C. Ullrich wrote: [???] Okay, which version of OS X do you have? In

Re: instance as a sequence

2007-11-05 Thread Matimus
On Nov 5, 9:59 am, [EMAIL PROTECTED] wrote: On Nov 5, 9:40 am, Paul McGuire [EMAIL PROTECTED] wrote: On Nov 5, 11:32 am, [EMAIL PROTECTED] wrote: suppose i want to make foo.childNodes[bar] available as foo[bar] (while still providing access to the printxml/printprettyxml()

Thread Profiling

2007-11-05 Thread JamesHoward
Are there any good thread profilers available that can profile a thread as it is running instead of after execution is completed? I would like to find a python class which looks at a currently running thread and if its memory exceeds a certain amount than kill it. Ideally I would like the program

IDLE won't color code!

2007-11-05 Thread [EMAIL PROTECTED]
Please help! IDLE color codes only the shell, not the open files! How can I solve this? -- http://mail.python.org/mailman/listinfo/python-list

Re: Python good for data mining?

2007-11-05 Thread Bruno Desthuilliers
Aaron Watters a écrit : On Nov 4, 4:36 pm, Bruno Desthuilliers [EMAIL PROTECTED] wrote: How good is the integration with MySQL in Python? Pretty good - but I wouldn't call MySQL a serious RDBMS. I would disagree with this, for this particular case. I think it's probably better than

Re: IDLE won't color code!

2007-11-05 Thread JamesHoward
On Nov 5, 12:33 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Please help! IDLE color codes only the shell, not the open files! How can I solve this? My first guess is that idle is opening files without the .py extension. If that isn't it, what operating system are you using? What version of

Functions as Objects, and persisting values

2007-11-05 Thread Falcolas
Please help me understand the mechanics of the following behavior. def d(): header = 'I am in front of ' def e(something): print header + something return e f = d() f('this') I am in front of this del(d) f('this') I am in front of this The way I

Re: IDLE won't color code!

2007-11-05 Thread [EMAIL PROTECTED]
On Nov 5, 9:41 pm, JamesHoward [EMAIL PROTECTED] wrote: On Nov 5, 12:33 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Please help! IDLE color codes only the shell, not the open files! How can I solve this? My first guess is that idle is opening files without the .py extension. If

Re: instance as a sequence

2007-11-05 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : On Nov 5, 9:40 am, Paul McGuire [EMAIL PROTECTED] wrote: On Nov 5, 11:32 am, [EMAIL PROTECTED] wrote: suppose i want to make foo.childNodes[bar] available as foo[bar] (while still providing access to the printxml/printprettyxml() functions and other functionality

Pydev 1.3.10 Released

2007-11-05 Thread Fabio Zadrozny
Hi All, Pydev and Pydev Extensions 1.3.10 have been released Details on Pydev Extensions: http://www.fabioz.com/pydev Details on Pydev: http://pydev.sf.net Details on its development: http://pydev.blogspot.com Release Highlights in Pydev Extensions:

Re: Functions as Objects, and persisting values

2007-11-05 Thread Diez B. Roggisch
Falcolas schrieb: Please help me understand the mechanics of the following behavior. def d(): header = 'I am in front of ' def e(something): print header + something return e f = d() f('this') I am in front of this del(d) f('this') I am in front of

Re: Descriptors and side effects

2007-11-05 Thread Bruno Desthuilliers
Rich Harkins a écrit : Bruno Desthuilliers wrote: [snip] I'm sorry, but this looks like a very complicated way to do a simple thing: class MySimpleClass(object): def __init__(self, x): self.x = x self.y = x ** 2 Sure, for the absurdly simplified case I posed as an example.

Re: Python thinks file is empty

2007-11-05 Thread Gabriel Genellina
En Mon, 05 Nov 2007 12:57:15 -0300, Tim Chase [EMAIL PROTECTED] escribió: To confuse matters, it happens to work in your example, because a string is an iterable that returns each character in that string as the result, so code like this f.writelines('hello\n') is effectively doing

Re: Functions as Objects, and persisting values

2007-11-05 Thread Rich Harkins
[snip] The thing you observe here is a called a closure. It consists of the local variables surrounding e. So as long as you keep a reference to e, you keep one to the variables of d itself. Diez More specifically though it keeps references to the requested variables only: def closed():

Python-URL! - weekly Python news and links (Nov 5)

2007-11-05 Thread Gabriel Genellina
QOTW: I've just done my first serious work in Python/IDLE, a small dot pre-processor for software modeling diagrams and I am very enthused. It should be called Pytho; it has the positive qualities of Play-Do and Lego: you get ideas squishing it through your fingers and it snaps together nicely

Re: Descriptors and side effects

2007-11-05 Thread Rich Harkins
Bruno Desthuilliers wrote: Which is easy to do with properties too. True enough. It's the caching of the return value that's the value add of course. ;) After it is applied, then the penalties for function call of the property and the computation are wiped out once the second access is

Re: Functions as Objects, and persisting values

2007-11-05 Thread Bruno Desthuilliers
Falcolas a écrit : Please help me understand the mechanics of the following behavior. def d(): header = 'I am in front of ' def e(something): print header + something return e f = d() f('this') I am in front of this del(d) f('this') I am in

Re: Python good for data mining?

2007-11-05 Thread Paul Rudin
Maarten [EMAIL PROTECTED] writes: Premature optimization is the root of all evil, to quote a famous person. And he's right, as most people working larger codes will confirm. But note that it's premature optimization..., not optimization... :) --

dictionary viewer

2007-11-05 Thread Erika Skoe
-- http://mail.python.org/mailman/listinfo/python-list

CIA Squashes Democracy in Pakistan

2007-11-05 Thread zionist . news
http://www.youtube.com/watch?v=BdB2r1ss5Wk http://www.jewwatch.com/ - excellent source for well researched news on world events and the big movers of history -- http://mail.python.org/mailman/listinfo/python-list

Re: Python launcher not working on Mac after Leopard upgrade?

2007-11-05 Thread André
On Nov 5, 11:57 am, [EMAIL PROTECTED] wrote: On Nov 3, 7:57 am, André [EMAIL PROTECTED] wrote: I just installed Leopard on my Mac. I already was using Python 2.5. I can run a Python script from a terminal window by typing python script.py as one would expect ... but not using the Python

Re: How can i find the form name without nr=0

2007-11-05 Thread scripteaze
b Well, i wasnt sure if you could have a form without a form name, i was just thinking that it had one but maybe hidden and that i could retrieve it How hidden? HTML source is ... THE source. there is nothing hidden in there. Is it possible then to have a form with no name and if so, how

Re: dictionary viewer

2007-11-05 Thread [EMAIL PROTECTED]
On Nov 5, 3:10 pm, Erika Skoe [EMAIL PROTECTED] wrote: That's funny, I can't see anything. -- http://mail.python.org/mailman/listinfo/python-list

Eclipse3.3 with Pydev 1.3.10 Mylar problem, have Mylyn

2007-11-05 Thread crybaby
Right now I am trying to install pydev 1.3.10 on Eclipse 3.3. I am getting an Mylar error org.eclipse.mylar (2.0.0.v20070403-1300) or something needed. Mylyn is mylar, now. How do you disable the mylar dependency, so that Mylyn is used by PyDev? --

Re: Thread Profiling

2007-11-05 Thread Chris Mellon
On Nov 5, 2007 1:32 PM, JamesHoward [EMAIL PROTECTED] wrote: Are there any good thread profilers available that can profile a thread as it is running instead of after execution is completed? I would like to find a python class which looks at a currently running thread and if its memory

Re: dictionary viewer

2007-11-05 Thread Martin Marcher
2007/11/5, [EMAIL PROTECTED] [EMAIL PROTECTED]: On Nov 5, 3:10 pm, Erika Skoe [EMAIL PROTECTED] wrote: That's funny, I can't see anything. Of course, it's an empty dict! tzz, *shaking head* martin -- http://noneisyours.marcher.name http://feeds.feedburner.com/NoneIsYours --

Re: Library package import question

2007-11-05 Thread Martin Marcher
2007/11/5, Frank Aune [EMAIL PROTECTED]: To prevent namespace pollution, I want to import and use this library in the following way: import Foo (...) t = Foo.module2.Bee() from x import y as z that has always worked for me to prevent pollution... -- http://noneisyours.marcher.name

Re: Thread Profiling

2007-11-05 Thread James Matthews
Try passing the verbose=1 flag when creating the tread! On 11/6/07, Chris Mellon [EMAIL PROTECTED] wrote: On Nov 5, 2007 1:32 PM, JamesHoward [EMAIL PROTECTED] wrote: Are there any good thread profilers available that can profile a thread as it is running instead of after execution is

Re: Eclipse3.3 with Pydev 1.3.10 Mylar problem, have Mylyn

2007-11-05 Thread Fabio Zadrozny
In the dialog where you select pydev (in the installation -- it'll appear in the 5th screenshot at http://fabioz.com/pydev/manual_101_install.html), you can expand it and uncheck mylyn... I'll update the install instructions to better specify that... Cheers, Fabio On 11/5/07, crybaby [EMAIL

Re: Library package import question

2007-11-05 Thread Gabriel Genellina
En Mon, 05 Nov 2007 10:34:26 -0300, Frank Aune [EMAIL PROTECTED] escribió: I have a python library package 'Foo', which contains alot of submodules: Foo/: __init__.py module1.py: class Bar() class Hmm() module2.py class Bee()

Re: CIA Squashes Democracy in Pakistan

2007-11-05 Thread Ivar Rosquist
On Mon, 05 Nov 2007 21:43:09 +, zionist.news wrote: http://www.youtube.com/watch?v=BdB2r1ss5Wk http://www.jewwatch.com/ - excellent source for well researched news on world events and the big movers of history What democracy? Pakistan will be either a military dictatorship

Re: How can i find the form name without nr=0

2007-11-05 Thread alex23
On Nov 6, 8:56 am, scripteaze [EMAIL PROTECTED] wrote: Is it possible then to have a form with no name and if so, how can i access this form Hey scripteaze, I'm not sure about mechanize, but you might have more success using another one of the author's modules, ClientForm:

Re: CIA Squashes Democracy in Pakistan

2007-11-05 Thread zionist . news
On Nov 5, 4:55 pm, Ivar Rosquist [EMAIL PROTECTED] wrote: On Mon, 05 Nov 2007 21:43:09 +, zionist.news wrote: http://www.youtube.com/watch?v=BdB2r1ss5Wk http://www.jewwatch.com/ - excellent source for well researched news on world events and the big movers of history What

  1   2   >