Re: Detecting memory leaks on apache, mod_python

2007-12-21 Thread Fredrik Lundh
Steven D'Aprano wrote: > Not me. You're quite knew to this internet thing, aren't you? ;-) > So... how do you measure memory usage in Python? Every programming > language I've used before (not a huge range, I'll admit) had *some* sort > of facility to measure memory usage, typically things li

Re: How to get Python to default to UTF8

2007-12-21 Thread Fredrik Lundh
weheh wrote: > I'm developing a cgi-bin application that must be unicode sensitive. I'm > striving for a UTF8 implementation. I'm running python 2.3 on a development > machine (windows xp) and a server (windows xp server). Both environments are > running Apache 2.2 with the same configuration fi

Re: Odd behavior in Python/Tkinter?

2007-12-21 Thread Fredrik Lundh
Lie wrote: >>> Inspect the following code: >>> >>> --- start of code --- >>> import Tkinter as Tk >>> from Tkconstants import * >>> root = Tk.Tk() >>> e1 = Tk.Entry(root, text = 'Hello World') >>> e2 = Tk.Entry(root, text = 'Hello World') >> >> the "text" (or "textvariable") option to the Entry

Re: Detecting memory leaks on apache, mod_python

2007-12-21 Thread Steven D'Aprano
On Fri, 21 Dec 2007 14:21:27 +0100, Diez B. Roggisch wrote: >>> So, anyone who hit's on this thread via a search will think >>> >>> a) that there's really no memory leak detection for python b) that >>> this community is not very helpful > > c) That finally people in this forum are smart enough t

How to get Python to default to UTF8

2007-12-21 Thread weheh
I'm developing a cgi-bin application that must be unicode sensitive. I'm striving for a UTF8 implementation. I'm running python 2.3 on a development machine (windows xp) and a server (windows xp server). Both environments are running Apache 2.2 with the same configuration file. The problem is t

Re: How to draw IE browser content in a window created with PythonWin

2007-12-21 Thread shaik_saleem
On Dec 21, 3:49 pm, [EMAIL PROTECTED] wrote: > On Dec 21, 1:45 pm, [EMAIL PROTECTED] wrote: > > > > > > > I'm pretty new to Python and I've been searching all over the place > > to > > find a solution for this. > > I have a html page with some javascript in it and I need to load this > > page in my

Re: 3D plotting with python 2.5 on win32

2007-12-21 Thread sturlamolden
On 22 Des, 03:19, sturlamolden <[EMAIL PROTECTED]> wrote: > If you are going to do 3D plotting of data, the tool to use is VTK. It > is the de facto standard for 3D scientific/technical visualization, > regardless of programming language. VTK has Python bindings, but you > need to build the librar

Re: 3D plotting with python 2.5 on win32

2007-12-21 Thread sturlamolden
On 19 Des, 15:15, anton <[EMAIL PROTECTED]> wrote: > Package/Lib to do 3D plotting out of the box. > > I know matplotlib. If you are going to do 3D plotting of data, the tool to use is VTK. It is the de facto standard for 3D scientific/technical visualization, regardless of programming language.

Re: Why does __builtins__ mean different things...

2007-12-21 Thread James Stroud
Fredrik Lundh wrote: > James Stroud wrote: >> Erik Max Francis wrote: >>> randomly dropping letters in >>> names is going to result in bad behavior, so be more careful about it. Implying I've randomly dropped a letter? Where did I randomly drop a letter? > From what I can tell, the message Eri

Re: smtplib problem, Unable to relay for

2007-12-21 Thread Tim Williams
On 21/12/2007, Benedict Verheyen <[EMAIL PROTECTED]> wrote: > Hi, > > i get an "Unable to relay for" when trying to send an email from within > my network to an email address not on my domain. > I don't understand why it says "relaying" as i'm sending from an > internal domain user to an external u

Re: Is there *any* real documentation to PyWin32?

2007-12-21 Thread sturlamolden
On 21 Des, 21:07, Gilles Ganault <[EMAIL PROTECTED]> wrote: > Like others have mentionned, apparently the only book available is > this: > > www.oreilly.com/catalog/pythonwin32/chapter/ch12.html PyWin32 follows the Windows API quite pedantically, except for GUI where it wraps MFC. If you can rea

Re: Changing intobject to use int rather than long

2007-12-21 Thread Hrvoje Niksic
"Terry Reedy" <[EMAIL PROTECTED]> writes: > "Christian Heimes" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > | Terry Reedy wrote: > | > Good idea. I think people who moved to 64 bits to get 64 bits would be > | > upset if they did not ;-). > | > | Windows X64 users still get 32

Re: Understanding memory leak reports

2007-12-21 Thread Istvan Albert
On Dec 21, 1:44 pm, "Giampaolo Rodola'" <[EMAIL PROTECTED]> wrote: > Since the main module is very big (more than 2800 lines of code) maybe that is the actual problem to begin with, you should refactor it so it it more modular and trackable, otherwise this is just one of the many issues that wil

Re: Newbie question - what's the term for input/output to a web page?

2007-12-21 Thread Rick Dooling
On Dec 21, 7:03 pm, Rachel Garrett <[EMAIL PROTECTED]> wrote: > I'd like to write a simple application that will accept input from the > user, go out to a particular web page, and submit the user's input to > the website. The results that are displayed by the web page should > then be sent back to

Re: 2D Game Development in Python

2007-12-21 Thread Istvan Albert
On Dec 20, 8:16 pm, PatrickMinnesota <[EMAIL PROTECTED]> wrote: > seen all the lists. I've done my reading. What I don't have is > actual testimonials by people who have used a chunk of code to program > an animated 2D game and had a great experience. You could use Panda3D to create the game, w

Re: Understanding memory leak reports

2007-12-21 Thread Giampaolo Rodola'
On 22 Dic, 01:27, Ross Ridge <[EMAIL PROTECTED]> wrote: > Giampaolo Rodola' <[EMAIL PROTECTED]> wrote: > >I'm in a big trouble since I don't know how to find some memory leaks > ... > >The message printed on screen is the following: > > >gc: collectable > >gc: collectable > >gc: collectable > >g

Re: Newbie question - what's the term for input/output to a web page?

2007-12-21 Thread Ismail Dönmez
Saturday 22 December 2007 03:03:47 tarihinde Rachel Garrett şunları yazmıştı: > I'd like to write a simple application that will accept input from the > user, go out to a particular web page, and submit the user's input to > the website. The results that are displayed by the web page should > then

Newbie question - what's the term for input/output to a web page?

2007-12-21 Thread Rachel Garrett
I'd like to write a simple application that will accept input from the user, go out to a particular web page, and submit the user's input to the website. The results that are displayed by the web page should then be sent back to the application. This seems like something where I could find some ea

Re: 2D Game Development in Python

2007-12-21 Thread Terry Reedy
"Steven Clark" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | Pyglet does NOT, to my knowledge, "wrap ogre". Pyglet is a lean-and-mean | standalone library, and gets a big, big thumbs up from me. Check it out. | http://pyglet.org/ | 2D sprites can be accomplished pretty easily with

Re: Understanding memory leak reports

2007-12-21 Thread Ross Ridge
Giampaolo Rodola' <[EMAIL PROTECTED]> wrote: >I'm in a big trouble since I don't know how to find some memory leaks ... >The message printed on screen is the following: > >gc: collectable >gc: collectable >gc: collectable >gc: collectable >gc: collectable >gc: collectable >gc: collectable >

Re: exception message output problem

2007-12-21 Thread Russ P.
On Dec 21, 2:58 pm, Lie <[EMAIL PROTECTED]> wrote: > Change the exception into this: > class InconsistentUnits(Exception): > def __init__(self, args=""): self.args = (args,) > # Python have an odd (read: broken) singleton implementation > # single member tuple must have a comma behind it

Re: exception message output problem

2007-12-21 Thread Bruno Desthuilliers
Lie a écrit : (snip) > # Python have an odd (read: broken) singleton implementation > # single member tuple must have a comma behind it You may call it weird or even a wart if you want, but given that what makes the tuple is the comma - not the parens[1] -, it is _not_ broken. [1] with the excep

Re: detecting property modification

2007-12-21 Thread Bruno Desthuilliers
Mangabasi a écrit : > On Dec 21, 4:46 pm, Bruno Desthuilliers > <[EMAIL PROTECTED]> wrote: > >>Mangabasi a écrit : >>(snip) >> >> >> >> >>>When you say "The Body gets asked for the value of the attribute" that >>>means that Body's __dict__ is being asked to provide a value >>>corresponding to its

Re: exception message output problem

2007-12-21 Thread Lie
On Dec 22, 2:57 am, "Russ P." <[EMAIL PROTECTED]> wrote: > I am baffled about why my exception messages are not displaying > properly. > > I have a class that represents physical scalars with units. If I type > > >>> 3 * s + 4 * m > > I should get something like this: > > scalar.InconsistentUnits:

Re: detecting property modification

2007-12-21 Thread Mangabasi
On Dec 21, 4:46 pm, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > Mangabasi a écrit : > (snip) > > > > > When you say "The Body gets asked for the value of the attribute" that > > means that Body's __dict__ is being asked to provide a value > > corresponding to its 'pos' key, right? > > Wrong. T

Re: mac dashboad

2007-12-21 Thread Carl K
Chris Mellon wrote: > On Dec 21, 2007 3:25 PM, Carl K <[EMAIL PROTECTED]> wrote: >> ianaré wrote: >>> On Dec 21, 12:37 pm, Carl K <[EMAIL PROTECTED]> wrote: How do I hang an app off the mac dashboard? The goal is a python version of Weatherbug. something like: read xml

Re: Understanding memory leak reports

2007-12-21 Thread Giampaolo Rodola'
On 21 Dic, 20:10, [EMAIL PROTECTED] wrote: > On Dec 21, 12:44 pm, "Giampaolo Rodola'" <[EMAIL PROTECTED]> wrote: > > > > > > > Hi, > > I'm in a big trouble since I don't know how to find some memory leaks > > I just discovered in a program of mine. > > By putting: > > > import gc > > gc.set_debug(g

Re: It's ok to __slots__ for what they were intended

2007-12-21 Thread MrJean1
You are correct. Mea culpa. /Jean Brouwers On Dec 21, 1:41 pm, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > MrJean1 wrote: > > My milage does vary, see this older post > > >   > > > Similar figures are shown with Python 2.5, bot

Re: huge slowdown on append

2007-12-21 Thread Peter Otten
ianaré wrote: > On Dec 21, 3:29 pm, "ianaré" <[EMAIL PROTECTED]> wrote: >> Hey all, >> >> I have a for loop which included the line: >> >> items_ren.append(join(newPath,renamedItem)) >> >> I changed it to this: >> items_ren.append([join(newPath,renamedItem), False]) >> >> And processing speed is n

Re: mac dashboad

2007-12-21 Thread Chris Mellon
On Dec 21, 2007 3:25 PM, Carl K <[EMAIL PROTECTED]> wrote: > ianaré wrote: > > On Dec 21, 12:37 pm, Carl K <[EMAIL PROTECTED]> wrote: > >> How do I hang an app off the mac dashboard? > >> > >> The goal is a python version of Weatherbug. > >> > >> something like: > >> read xml data from a URL, > >>

Re: Odd behavior in Python/Tkinter?

2007-12-21 Thread Lie
On Dec 22, 4:05 am, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > Lie wrote: > > Inspect the following code: > > > --- start of code --- > > import Tkinter as Tk > > from Tkconstants import * > > > root = Tk.Tk() > > > e1 = Tk.Entry(root, text = 'Hello World') > > e2 = Tk.Entry(root, text = 'Hello Wor

Re: mac dashboad

2007-12-21 Thread Paul McNett
Carl K wrote: > Yes. But I don't want to rely on wx - trying to use just native mac python > (whatever they ship with) Since OSX 10.4, Mac ships with wxPython installed. Paul -- http://paulmcnett.com -- http://mail.python.org/mailman/listinfo/python-list

Re: detecting property modification

2007-12-21 Thread Bruno Desthuilliers
Mangabasi a écrit : (snip) > > When you say "The Body gets asked for the value of the attribute" that > means that Body's __dict__ is being asked to provide a value > corresponding to its 'pos' key, right? Wrong. That means that attribute lookup rules are invoked, which may *or not* end up call

Re: It's ok to __slots__ for what they were intended

2007-12-21 Thread Chris Mellon
On Dec 21, 2007 2:07 PM, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > John Nagle wrote: > > > I'd like to hear more about what kind of performance gain can be > > obtained from "__slots__". I'm looking into ways of speeding up > > HTML parsing via BeautifulSoup. If a significant speedup can be

Re: It's ok to __slots__ for what they were intended

2007-12-21 Thread Fredrik Lundh
MrJean1 wrote: > My milage does vary, see this older post > > > > Similar figures are shown with Python 2.5, both for 32- and 64-bit. unless I'm missing something, you're measuring object creation time. I'm measuring attribu

Re: huge slowdown on append

2007-12-21 Thread Fredrik Lundh
ianaré wrote: >> I changed it to this: >> items_ren.append([join(newPath,renamedItem), False]) >> >> And processing speed is now much much slower. For 5780 items the old >> function would take 9.5 seconds (there is other stuff going on >> obviously), after changing that single line, speed is now 5

Re: How to handle multi-line quotes

2007-12-21 Thread [EMAIL PROTECTED]
On 21 Dic, 22:13, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] a écrit : > > > Thinking about unclosed multi-line quotes. > > > When you open a multi-line quote (type '"""') what does your editor > > do? > > The RightThing(tm), that is: > > > Does it color the remainder of you

Re: mac dashboad

2007-12-21 Thread Carl K
ianaré wrote: > On Dec 21, 12:37 pm, Carl K <[EMAIL PROTECTED]> wrote: >> How do I hang an app off the mac dashboard? >> >> The goal is a python version of Weatherbug. >> >> something like: >> read xml data from a URL, >> display some numbers, >> mouse over shows more details >> >> Carl K > > What

2.5.1 rpms?

2007-12-21 Thread gamename
Hi, Where can I find python 2.5.1 rpm's for redhat9 and fedora6/7? Thanks, -T -- http://mail.python.org/mailman/listinfo/python-list

Re: How to handle multi-line quotes

2007-12-21 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : > Thinking about unclosed multi-line quotes. > > When you open a multi-line quote (type '"""') what does your editor > do? The RightThing(tm), that is: > Does it color the remainder of your text as a quote, Indeed. -- http://mail.python.org/mailman/listinfo/python-

Re: Odd behavior in Python/Tkinter?

2007-12-21 Thread Simon Forman
On Dec 21, 12:30 pm, Lie <[EMAIL PROTECTED]> wrote: > Inspect the following code: > > --- start of code --- > import Tkinter as Tk > from Tkconstants import * > > root = Tk.Tk() > > e1 = Tk.Entry(root, text = 'Hello World') > e2 = Tk.Entry(root, text = 'Hello World') > > e1.grid(row = 1, column = 1

Re: Passing by reference

2007-12-21 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : > Hi, Bruno. Merry Christmas! > By "constant" I meant that it did not change during the lifetime of > the Toker. That's still a variable to me. It's even the essence of the variable, since it's the main input of your program. And that's definitively not something I

Re: huge slowdown on append

2007-12-21 Thread ianaré
On Dec 21, 3:29 pm, "ianaré" <[EMAIL PROTECTED]> wrote: > Hey all, > > I have a for loop which included the line: > > items_ren.append(join(newPath,renamedItem)) > > I changed it to this: > items_ren.append([join(newPath,renamedItem), False]) > > And processing speed is now much much slower. For 57

Re: Odd behavior in Python/Tkinter?

2007-12-21 Thread Fredrik Lundh
Lie wrote: > Inspect the following code: > > --- start of code --- > import Tkinter as Tk > from Tkconstants import * > > root = Tk.Tk() > > e1 = Tk.Entry(root, text = 'Hello World') > e2 = Tk.Entry(root, text = 'Hello World') the "text" (or "textvariable") option to the Entry widget is the na

Re: Beginner question!

2007-12-21 Thread Bruno Desthuilliers
SMALLp a écrit : (snip) > One more question. How does my code looks like. I couldn't find any open > source program written in python You must be jocking ? -- http://mail.python.org/mailman/listinfo/python-list

Re: Beginner question!

2007-12-21 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : > On Dec 21, 9:11 am, SMALLp <[EMAIL PROTECTED]> wrote: > (snip) >>class insertData: >>def insert(self, dataTable, data): (snip) > > I think you need to post the real traceback or the real code since > your error message doesn't look like it has anything to do

RE: pyTTS broken SOLVED

2007-12-21 Thread Bell, Kevin
I was using python 2.4.1 which was the problem. Upgrading to 2.4.4 fixed it... Thanks! -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Fredrik Lundh Sent: Friday, December 21, 2007 12:41 PM To: python-list@python.org Subject: Re: pyTTS broken : ( Bell

Re: Beginner question!

2007-12-21 Thread kyosohma
On Dec 21, 1:44 pm, SMALLp <[EMAIL PROTECTED]> wrote: > Carsten Haese wrote: > > On Fri, 2007-12-21 at 18:06 +0100, SMALLp wrote: > sql ="INSERT INTO "+dataTable+" (user_name, file_name, > file_size, > file_path_local, file_path_FTP, curent_location, FTP_valid_time,

Re: How to draw IE browser content in a window created with PythonWin

2007-12-21 Thread kyosohma
On Dec 21, 1:45 pm, [EMAIL PROTECTED] wrote: > I'm pretty new to Python and I've been searching all over the place > to > find a solution for this. > I have a html page with some javascript in it and I need to load this > page in my own window (which I will create using PythonWin). The > reason for

Re: mac dashboad

2007-12-21 Thread ianaré
On Dec 21, 12:37 pm, Carl K <[EMAIL PROTECTED]> wrote: > How do I hang an app off the mac dashboard? > > The goal is a python version of Weatherbug. > > something like: > read xml data from a URL, > display some numbers, > mouse over shows more details > > Carl K What is the dashboard - is it anyt

Re: How to handle multi-line quotes

2007-12-21 Thread Lie
On Dec 22, 2:15 am, [EMAIL PROTECTED] wrote: > Thinking about unclosed multi-line quotes. > > When you open a multi-line quote (type '"""') what does your editor > do? Does it color the remainder of your text as a quote, or does it > color the line with the open quote as a quote and leave the rest

Re: How to handle multi-line quotes

2007-12-21 Thread ianaré
On Dec 21, 2:15 pm, [EMAIL PROTECTED] wrote: > Thinking about unclosed multi-line quotes. > > When you open a multi-line quote (type '"""') what does your editor > do? Does it color the remainder of your text as a quote, or does it > color the line with the open quote as a quote and leave the rest

Re: It's ok to __slots__ for what they were intended

2007-12-21 Thread MrJean1
My milage does vary, see this older post Similar figures are shown with Python 2.5, both for 32- and 64-bit. /Jean Brouwers On Dec 21, 12:07 pm, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > John Nagle wrote: > >      I'd like

Odd behavior in Python/Tkinter?

2007-12-21 Thread Lie
Inspect the following code: --- start of code --- import Tkinter as Tk from Tkconstants import * root = Tk.Tk() e1 = Tk.Entry(root, text = 'Hello World') e2 = Tk.Entry(root, text = 'Hello World') e1.grid(row = 1, column = 1) e2.grid(row = 2, column = 1) e1.insert(END, 'Hello Python') root.mai

huge slowdown on append

2007-12-21 Thread ianaré
Hey all, I have a for loop which included the line: items_ren.append(join(newPath,renamedItem)) I changed it to this: items_ren.append([join(newPath,renamedItem), False]) And processing speed is now much much slower. For 5780 items the old function would take 9.5 seconds (there is other stuff g

Re: It's ok to __slots__ for what they were intended

2007-12-21 Thread Fredrik Lundh
John Nagle wrote: > I'd like to hear more about what kind of performance gain can be > obtained from "__slots__". I'm looking into ways of speeding up > HTML parsing via BeautifulSoup. If a significant speedup can be > obtained when navigating large trees of small objects, that's worth > qu

Re: replace c-style comments with newlines (regexp)

2007-12-21 Thread Fredrik Lundh
lex __ wrote: > background: I'm trying to create a 'intelligent' source-code security > analysis tool for c/c++ , python and php files, but filtering the > comments seems to be the biggest problem. :( for C/C++, why not just use "gcc -E source.c" (or equivalent), and use the line markers to

Re: pyTTS broken : (

2007-12-21 Thread Fredrik Lundh
Bell, Kevin wrote: > Importing pyTTS works, but then it bombs… any ideas? This worked > without a hitch on my old computer! > >> >> import pyTTS > >> >> tts = pyTTS.Create() > > Traceback (most recent call last): > File "C:\", line 1, in ? > File "c:\Python24\Lib\site-packages\pyTTS\__in

Re: Is there *any* real documentation to PyWin32?

2007-12-21 Thread Gilles Ganault
On Thu, 20 Dec 2007 03:35:23 -0800 (PST), Benoit <[EMAIL PROTECTED]> wrote: >I understand that the Win32 has been said to be itself poorly >documented, so perhaps that the documentation that comes with the >modules is of similar quality is no coincidence. PyWin32 is free, and writing extensive doc

Re: Passing by reference

2007-12-21 Thread MartinRinehart
Hi, Bruno. Merry Christmas! By "constant" I meant that it did not change during the lifetime of the Toker. -- http://mail.python.org/mailman/listinfo/python-list

exception message output problem

2007-12-21 Thread Russ P.
I am baffled about why my exception messages are not displaying properly. I have a class that represents physical scalars with units. If I type >>> 3 * s + 4 * m I should get something like this: scalar.InconsistentUnits: 3 s, 4 m to show that seconds cannot be added to meters. Instead, the m

How to draw IE browser content in a window created with PythonWin

2007-12-21 Thread shaik_saleem
I'm pretty new to Python and I've been searching all over the place to find a solution for this. I have a html page with some javascript in it and I need to load this page in my own window (which I will create using PythonWin). The reason for this is to have capability to control the window propert

Re: Beginner question!

2007-12-21 Thread SMALLp
Carsten Haese wrote: > On Fri, 2007-12-21 at 18:06 +0100, SMALLp wrote: sql ="INSERT INTO "+dataTable+" (user_name, file_name, file_size, file_path_local, file_path_FTP, curent_location, FTP_valid_time, uploaded, last_modified, last_verified, file_type, file_cat

Re: readlines() reading incorrect number of lines?

2007-12-21 Thread Gerry
Something I've occasionally found helpful with problem text files is to build a histogram of character counts, something like this: """ chist.py print a histogram of character frequencies in a nemed input file """ import sys whitespace = ' \t\n\r\v\f' lowercase = 'abcdefghijklmnopqrs

Re: How to in Python

2007-12-21 Thread Chris Mellon
On Dec 21, 2007 1:02 PM, <[EMAIL PROTECTED]> wrote: > > > Chris Mellon wrote: > > Is there some reason that you think Python is incapable of > > implementing lexers that do this, just because Python lexer accepts > > it? > > Absolutely not. My opinion is that it's a bug. A very, very minor bug, >

How to handle multi-line quotes

2007-12-21 Thread MartinRinehart
Thinking about unclosed multi-line quotes. When you open a multi-line quote (type '"""') what does your editor do? Does it color the remainder of your text as a quote, or does it color the line with the open quote as a quote and leave the rest of your code alone? What do you want it to do? This

Re: Why does __builtins__ mean different things...

2007-12-21 Thread Fredrik Lundh
James Stroud wrote: >>> Butwhat the heck? You mean if I drop an s I get predictable >>> behavior and if I don't, I get unpredictable behavior? >> >> You don't get unpredictable behavior, you just get different behavior >> you didn't expect, which is not the same thing. Python is a programm

Re: Understanding memory leak reports

2007-12-21 Thread kyosohma
On Dec 21, 12:44 pm, "Giampaolo Rodola'" <[EMAIL PROTECTED]> wrote: > Hi, > I'm in a big trouble since I don't know how to find some memory leaks > I just discovered in a program of mine. > By putting: > > import gc > gc.set_debug(gc.DEBUG_LEAK) > > ..at the end of a script which imports a module I

Re: How to in Python

2007-12-21 Thread MartinRinehart
Chris Mellon wrote: > Is there some reason that you think Python is incapable of > implementing lexers that do this, just because Python lexer accepts > it? Absolutely not. My opinion is that it's a bug. A very, very minor bug, but still six-legged. > Note that if you're using your lexer to mar

Understanding memory leak reports

2007-12-21 Thread Giampaolo Rodola'
Hi, I'm in a big trouble since I don't know how to find some memory leaks I just discovered in a program of mine. By putting: import gc gc.set_debug(gc.DEBUG_LEAK) ..at the end of a script which imports a module I wrote it seems I have some memory leaks scattered around. The message printed on sc

Re: detecting property modification

2007-12-21 Thread Jean-Paul Calderone
On Fri, 21 Dec 2007 10:30:31 -0800 (PST), Mangabasi <[EMAIL PROTECTED]> wrote: >On Dec 21, 1:11 pm, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: >> On Fri, 21 Dec 2007 09:49:51 -0800 (PST), Mangabasi <[EMAIL PROTECTED]> >> wrote: >> > [snip] >> >> >Hi Jean-Paul, >> >> >Sorry, I should have spell

Re: detecting property modification

2007-12-21 Thread Mangabasi
On Dec 21, 1:11 pm, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: > On Fri, 21 Dec 2007 09:49:51 -0800 (PST), Mangabasi <[EMAIL PROTECTED]> wrote: > > [snip] > > >Hi Jean-Paul, > > >Sorry, I should have spelled this out in my post but I did not.  For > >several reasons I do not wish to couple the

Re: detecting property modification

2007-12-21 Thread Jean-Paul Calderone
On Fri, 21 Dec 2007 09:49:51 -0800 (PST), Mangabasi <[EMAIL PROTECTED]> wrote: > [snip] > >Hi Jean-Paul, > >Sorry, I should have spelled this out in my post but I did not. For >several reasons I do not wish to couple the pos object with the Body >instances. In my case, I did not want pos objects

Re: Beginner question!

2007-12-21 Thread Carsten Haese
On Fri, 2007-12-21 at 18:06 +0100, SMALLp wrote: > >> sql ="INSERT INTO "+dataTable+" (user_name, file_name, > >> file_size, > >> file_path_local, file_path_FTP, curent_location, FTP_valid_time, > >> uploaded, last_modified, last_verified, file_type, file_category) VLAUES > >> "+da

Re: detecting property modification

2007-12-21 Thread Mangabasi
On Dec 21, 12:40 pm, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: > On Fri, 21 Dec 2007 09:26:36 -0800 (PST), Mangabasi <[EMAIL PROTECTED]> wrote: > >Howdy, > > >I think it is easier to explain my question with a short example: > > >class Body: > >    def __init__(self, pos): > >        self.__di

Re: detecting property modification

2007-12-21 Thread Jean-Paul Calderone
On Fri, 21 Dec 2007 09:26:36 -0800 (PST), Mangabasi <[EMAIL PROTECTED]> wrote: >Howdy, > >I think it is easier to explain my question with a short example: > >class Body: >def __init__(self, pos): >self.__dict__['pos'] = pos > >def __setattr__(self, name, value): >if name ==

mac dashboad

2007-12-21 Thread Carl K
How do I hang an app off the mac dashboard? The goal is a python version of Weatherbug. something like: read xml data from a URL, display some numbers, mouse over shows more details Carl K -- http://mail.python.org/mailman/listinfo/python-list

detecting property modification

2007-12-21 Thread Mangabasi
Howdy, I think it is easier to explain my question with a short example: class Body: def __init__(self, pos): self.__dict__['pos'] = pos def __setattr__(self, name, value): if name == 'pos': print 'pos changed to', value self.__dict__[name] = value >>

Re: Beginner question!

2007-12-21 Thread SMALLp
[EMAIL PROTECTED] wrote: >> Traceback (most recent call last): >>File "/home/pofuk/MzMFIleShare/sharePanel.py", line 130, in share >> self.scanDirsAndFiles(dirPath) >>File "/home/pofuk/MzMFIleShare/sharePanel.py", line 158, in >> scanDirsAndFiles >> sql.insertData.insert("files",

Re: It's ok to __slots__ for what they were intended

2007-12-21 Thread John Nagle
Chris Mellon wrote: > On 20 Dec 2007 19:50:31 -0800, Aahz <[EMAIL PROTECTED]> wrote: >> In article <[EMAIL PROTECTED]>, >> Carl Banks <[EMAIL PROTECTED]> wrote: Someday I'll have time to write up a proper page about why you shouldn't use __slots__ > Barking out your blanket warning

smtplib problem, Unable to relay for

2007-12-21 Thread Benedict Verheyen
Hi, i get an "Unable to relay for" when trying to send an email from within my network to an email address not on my domain. I don't understand why it says "relaying" as i'm sending from an internal domain user to an external user. Email server is exchange 2003 See this trace >>> smtp.sendmai

pyTTS broken : (

2007-12-21 Thread Bell, Kevin
Importing pyTTS works, but then it bombs... any ideas? This worked without a hitch on my old computer! >>> import pyTTS >>> tts = pyTTS.Create() Traceback (most recent call last): File "C:\", line 1, in ? File "c:\Python24\Lib\site-packages\pyTTS\__init__.py", line 28, in Create

Re: Beginner question!

2007-12-21 Thread kyosohma
> Traceback (most recent call last): >File "/home/pofuk/MzMFIleShare/sharePanel.py", line 130, in share > self.scanDirsAndFiles(dirPath) >File "/home/pofuk/MzMFIleShare/sharePanel.py", line 158, in > scanDirsAndFiles > sql.insertData.insert("files", data) > TypeError: unbound met

Re: Sorting Objects by property using locale

2007-12-21 Thread Donn Ingle
> Which is even more correct than I hoped for -- in Norwegian, aa is > pronounced the same as å (which is the 29th letter in the Norwegian > alphabet) and is sorted according to pronunciation. Much appreciated bjorn. \d -- http://mail.python.org/mailman/listinfo/python-list

Re: Sorting Objects by property using locale

2007-12-21 Thread Donn Ingle
In follow-up: I think this should work: # -*- coding: utf8 -*- import locale locale.setlocale( locale.LC_ALL, "" ) class Test(object): def __init__(self,nam): self.name = nam def __cmp__(self, other): return cmp(self.name, other.name) l = [ Test("ABILENE.ttf"), Te

Re: Beginner question!

2007-12-21 Thread Chris Mellon
On Dec 21, 2007 9:11 AM, SMALLp <[EMAIL PROTECTED]> wrote: > Hy! I have error something like this > > TypeError: unbound method insert() must be called with insertData > instance as first argument (got str instance instead) > > CODE: > > File1.py > sql.insertData.insert("files", data) > > sql.py >

Re: It's ok to __slots__ for what they were intended (was: Don't use __slots__ (was Re: Why custom objects take so much memory?))

2007-12-21 Thread Chris Mellon
On 20 Dec 2007 19:50:31 -0800, Aahz <[EMAIL PROTECTED]> wrote: > In article <[EMAIL PROTECTED]>, > Carl Banks <[EMAIL PROTECTED]> wrote: > >On Dec 18, 4:49 pm, [EMAIL PROTECTED] (Aahz) wrote: > >> In article <[EMAIL PROTECTED]>, > >> Chris Mellon <[EMAIL PROTECTED]> wrote: > >>> > >>>You can reduc

Re: Beginner question!

2007-12-21 Thread SMALLp
[EMAIL PROTECTED] wrote: > On Dec 21, 9:11 am, SMALLp <[EMAIL PROTECTED]> wrote: >> Hy! I have error something like this >> >> TypeError: unbound method insert() must be called with insertData >> instance as first argument (got str instance instead) >> >> CODE: >> >> File1.py >> sql.insertData.inse

Re: Beginner question!

2007-12-21 Thread kyosohma
On Dec 21, 9:11 am, SMALLp <[EMAIL PROTECTED]> wrote: > Hy! I have error something like this > > TypeError: unbound method insert() must be called with insertData > instance as first argument (got str instance instead) > > CODE: > > File1.py > sql.insertData.insert("files", data) > > sql.py > > cla

Re: How to in Python

2007-12-21 Thread Chris Mellon
On Dec 21, 2007 7:25 AM, <[EMAIL PROTECTED]> wrote: > > > John Machin wrote: > > Use a proper lexer written by somebody who knows what they are doing, > > as has already been recommended to you. > > My lexer returns a MALFORMED_NUMBER token on '0x' or '0x '. Try that > in Python. > Is there some

Beginner question!

2007-12-21 Thread SMALLp
Hy! I have error something like this TypeError: unbound method insert() must be called with insertData instance as first argument (got str instance instead) CODE: File1.py sql.insertData.insert("files", data) sql.py class insertData: def insert(self, dataTable, data):

Re: Extract a number from a complicated string

2007-12-21 Thread Sion Arrowsmith
Gerardo Herzig <[EMAIL PROTECTED]> wrote: >>My problem is that I need to extract from this string the number. For >>instance in xyz.vs.1-81_1 I have to extract the number 81, and in >>xyz.vs.1-1234_1 I need to get the number 1234. >> >>What is the easiest way of doing this ? >If the strings looks

Re: Sorting Objects by property using locale

2007-12-21 Thread thebjorn
Donn Ingle wrote: > Hi, > Well, I'm beat. I can't wrap my head around this stuff. > > I need to create a list that will contain objects sorted by a "name" > property that is in the alphabetical order of the user's locale. > > I used to have a simple list that I got from os.listdir and I could do

Sorting Objects by property using locale

2007-12-21 Thread Donn Ingle
Hi, Well, I'm beat. I can't wrap my head around this stuff. I need to create a list that will contain objects sorted by a "name" property that is in the alphabetical order of the user's locale. I used to have a simple list that I got from os.listdir and I could do this: l = os.listdir(".") l.so

Re: replace c-style comments with newlines (regexp)

2007-12-21 Thread Neil Cerutti
On 2007-12-21, lex __ <[EMAIL PROTECTED]> wrote: > I'm tryin to use regexp to replace multi-line c-style comments > (like /* this /n */ ) with /n (newlines). I tried someting > like re.sub('/\*(.*)/\*' , '/n' , file) but it doesn't > work for multiple lines. > > besides that I want to keep a

Re: Extract a number from a complicated string

2007-12-21 Thread Neil Cerutti
On 2007-12-21, Horacius ReX <[EMAIL PROTECTED]> wrote: > Hi, > > I have to read some data from a file, and on each block it always > appears the followng string; xyz.vs.1-81_1 . It appears a lot of time > with different numbers like; > > xyz.vs.1-81_1 > xyz.vs.1-1234_1 > xyz.vs.1-56431_1 > > and so

Re: How to in Python

2007-12-21 Thread MartinRinehart
If I get to add multi-line strings today, I'll have a complete tokenizer. Interior looks a lot like C minus semi-colons. (Though I did figure out that there wasn't any need for tokens that didn't come from a real to have a doubleValue field. In C++ or Java all the Tokens had a doubleValue, because

Re: Detecting memory leaks on apache, mod_python

2007-12-21 Thread Ilias Lazaridis
On Dec 21, 3:21 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: [...] Please get serious, Mr.! (and avoid further off-topics) . -- http://mail.python.org/mailman/listinfo/python-list

Re: How to delete this file ???

2007-12-21 Thread Gerardo Herzig
hank/ann wrote: >pop up that says: error loading c:/progra~1\mywebs~1bar\2bin\mwsbar.dll the >specified module could not be found > >this pop up appeares on desktop each time we log on cannot get rid off it >can you help Ann > > import os.Linux :P -- http://mail.python.org/mailman/listinf

Re: Passing by reference

2007-12-21 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : > > Sion Arrowsmith wrote: >> Michael Sparks <[EMAIL PROTECTED]> wrote: >>> def bar(): >>>global x >>>x[0] += " another" >>>print id(x[0]) >> ... and for bonus marks, explain why the "global x" in this function >> is not required. > > Because x does not ap

  1   2   >