Re: 3D plotting with python 2.5 on win32

2007-12-21 Thread anton
Hi Peter, have setuptools installed. Then, you should run: easy_install -fhttp://code.enthought.com/enstaller/eggs/windows/xp VTK enthought.mayavi[nonets] It's important to include [nonets] so that you will get scipy and numpy as well. I have already scipy 0.6.0 and numpy 1.0.4

Re: Detecting memory leaks on apache, mod_python

2007-12-21 Thread Ilias Lazaridis
On Dec 19, 5:40 am, Ilias Lazaridis [EMAIL PROTECTED] wrote: On Dec 17, 8:41 am, Ilias Lazaridis [EMAIL PROTECTED] wrote: How to detect memory leaks of python programms, which run in an environment like this: * Suse Linux 9.3 * Apache * mod_python The problem occoured after some

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

2007-12-21 Thread Peter Otten
Steven D'Aprano wrote: On Fri, 21 Dec 2007 00:00:47 +, lex __ 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.

POpen - Wait For Process To Complete

2007-12-21 Thread McGirr, Mark A ILMB:EX
Rob. Did you ever figure this out. It's driving me crazy too. Mark McGirr Land Information Specialist Regional Client Services Division Integrated Land Management Bureau Ministry of Agriculture and Lands 201

Re: 3D plotting with python 2.5 on win32

2007-12-21 Thread anton
Hi Peter, I tried it, but I have problems downloading with easy_setup. If I download files with firefox and a downloadmanager it works (I also ha transferrates of 3kB/s which is quite slow) easy_install -fhttp://code.enthought.com/enstaller/eggs/windows/xp VTK enthought.mayavi[nonets] My

Re: Why does __builtins__ mean different things...

2007-12-21 Thread Erik Max Francis
James Stroud wrote: Thank you for your help. I will import the __builtin__ module as you have suggested--it is what I need. 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

Re: Why does __builtins__ mean different things...

2007-12-21 Thread James Stroud
Erik Max Francis wrote: James Stroud wrote: Thank you for your help. I will import the __builtin__ module as you have suggested--it is what I need. 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

Re: Detecting memory leaks on apache, mod_python

2007-12-21 Thread Graham Dumpleton
On Dec 21, 7:42 pm, Ilias Lazaridis [EMAIL PROTECTED] wrote: On Dec 19, 5:40 am, Ilias Lazaridis [EMAIL PROTECTED] wrote: On Dec 17, 8:41 am, Ilias Lazaridis [EMAIL PROTECTED] wrote: How to detect memory leaks of python programms, which run in an environment like this:  * Suse

Re: Does fileinput.input() read STDIN all at once?

2007-12-21 Thread Adam Funk
On 2007-12-20, Tim Roberts wrote: As a test, I tried this: for line in fileinput.input(): print '**', line and found that it would print nothing until I hit Ctl-D, then print all the lines, then wait for another Ctl-D, and so on (until I pressed Ctl-D twice in succession to end the

Re: Instrospection question

2007-12-21 Thread thebjorn
On Dec 21, 11:28 am, Matias Surdi [EMAIL PROTECTED] wrote: I have the following code: [...] As you can see, what I'm trying to do is replace a method with another one wich is the same method but with a function applied to it (in this case, a string concatenation ( + modified)) Can anybody

Instrospection question

2007-12-21 Thread Matias Surdi
I have the following code: -- import new class A: def a(self): print Original def other(cad): return cad + modified def replace_method(method): def b(self,*args,**kwargs): result = method(*args,**kwargs) return other(result)

Re: Question about email-handling modules

2007-12-21 Thread thebjorn
On Dec 20, 4:15 pm, Robert Latest [EMAIL PROTECTED] wrote: Steven D'Aprano wrote: [...] All methods are attributes (although the opposite is not the case), so if a method doesn't exist, you will get an AttributeError. I see. I've already gathered that Python likes to use different words for

Re: Instrospection question

2007-12-21 Thread Duncan Booth
Matias Surdi [EMAIL PROTECTED] wrote: I have the following code: -- import new class A: def a(self): print Original def other(cad): return cad + modified def replace_method(method): def b(self,*args,**kwargs): result =

Re: In an inherited class, embedded classes is referenced?

2007-12-21 Thread Christian Joergensen
Diez B. Roggisch [EMAIL PROTECTED] writes: [...] The more important question is: what do you need C for? Do you have by any chance a Java-background and think of C as inner/nested class as in Java? This feature doesn't exist in Python. I was working on some framework code where each class

Re: In an inherited class, embedded classes is referenced?

2007-12-21 Thread Christian Joergensen
Carl Banks [EMAIL PROTECTED] writes: [...] No, when a class inherits a class member from a subclass, both classes reference the same object. This is true of any object: classes, lists, sets, etc. For instance, if you were to do this, class A(object): class C(object): pass d =

Re: Instrospection question

2007-12-21 Thread Peter Otten
Matias Surdi wrote: I have the following code: -- import new class A: def a(self): print Original def other(cad): return cad + modified def replace_method(method): def b(self,*args,**kwargs): result =

Re: Instrospection question

2007-12-21 Thread Peter Otten
Duncan Booth wrote: Matias Surdi [EMAIL PROTECTED] wrote: setattr(a,a,new.instancemethod(replace_method(a.a) ,a,A)) a.__dict__['a'] = new.instancemethod(replace_method(a.a),a,A) Or even a.a = new.instancemethod(...) Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: socket in python with proxies

2007-12-21 Thread Jean-Paul Calderone
On Fri, 21 Dec 2007 15:38:03 +1100, Astan Chee [EMAIL PROTECTED] wrote: Hi, I have a proxy server that requires authentication on a non-standard port and Im trying to connect to it via socket.connect() I tried doing this: import socket server = (username:[EMAIL PROTECTED],1234) s =

Re: Passing by reference

2007-12-21 Thread MartinRinehart
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 appear as an LHS in bar(), just about the first thing I

Re: Extract a number from a complicated string

2007-12-21 Thread Bruno Desthuilliers
Horacius ReX a écrit : 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 on My problem is that I need to

Re: Extract a number from a complicated string

2007-12-21 Thread Gerardo Herzig
Horacius ReX 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 on My problem is that I need to extract from this

Extract a number from a complicated string

2007-12-21 Thread Horacius ReX
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 on My problem is that I need to extract from this string the number.

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

2007-12-21 Thread Gerrit Muller
[EMAIL PROTECTED] schreef: ...snip... Personally I consider Python-win32 to be docware -- software that is sufficiently difficult to use with the included free documentation that many people will just buy the $$$ documentation. Numpy is another prominent example of docware. A

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

Problem with parsing email message with extraneous MIME information

2007-12-21 Thread Steven Allport
I am working on processing eml email message using the email module (python 2.5), on files exported from an Outlook PST file, to extract the composite parts of the email. In most instances this works fine, the message is read in using message_from_file, is_multipart returns True and I can process

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 appear as an LHS in bar(),

Re: Detecting memory leaks on apache, mod_python

2007-12-21 Thread Diez B. Roggisch
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 to detect your flamebait refuse to comment on it, Ilias... Comments like

How to delete this file ???

2007-12-21 Thread hank/ann
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-- http://mail.python.org/mailman/listinfo/python-list

Re: Passing by reference

2007-12-21 Thread Sion Arrowsmith
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. -- \S -- [EMAIL PROTECTED] -- http://www.chaos.org.uk/~sion/ Frankly I have no feelings towards

How do I use the Proxy recipe ?

2007-12-21 Thread English, Mark
The proxy recipe http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/252151 (*) by Goncalo Rodrigues shows how to wrap an existing instance of a new or old style class in a Proxy instance. I'm just wondering what a programmer does once that's been achieved ? Is he or she supposed to patch the

Re: 2D Game Development in Python

2007-12-21 Thread Paul Boddie
On 21 Des, 02:16, PatrickMinnesota [EMAIL PROTECTED] wrote: I've been playing with Pygame some in my late night hobby time. I'm wondering what else I should be looking at since I'm not all that impressed with Pygame so far. Maybe it is the right library, but maybe it's not. Please don't

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

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

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

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(.)

Re: Need to open an Url and display it in a window created using Python win extensions

2007-12-21 Thread shaik_saleem
On Dec 20, 6:50 pm, Farsheed Ashouri [EMAIL PROTECTED] wrote: Can you post your basic wx part code? I have not started writing any code yet. I just wanted to see if it is do-able and find out if there are any examples on the web -- http://mail.python.org/mailman/listinfo/python-list

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 all

Re: Is this a bug in int()?

2007-12-21 Thread MartinRinehart
Tokenizer bug reported. [EMAIL PROTECTED] wrote: int('0x', 16) 0 I'm working on a tokenizer and I'm thinking about returning a MALFORMED_NUMBER token (1.2E, .5E+) -- http://mail.python.org/mailman/listinfo/python-list

Re: Is this a bug in int()?

2007-12-21 Thread MartinRinehart
Duncan Booth wrote: Why would you return a token rather than throwing an exception? Tokenizers have lots of uses. Colorizing text in an editor, for example. We've got a MALFORMED_NUMBER when you type '0x'. We've got an INTEGER when we get your next keystroke (probably). --

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

Re: Detecting memory leaks on apache, mod_python

2007-12-21 Thread Ilias Lazaridis
On Dec 21, 12:25 pm, Graham Dumpleton [EMAIL PROTECTED] wrote: On Dec 21, 7:42 pm, Ilias Lazaridis [EMAIL PROTECTED] wrote: On Dec 19, 5:40 am, Ilias Lazaridis [EMAIL PROTECTED] wrote: On Dec 17, 8:41 am, Ilias Lazaridis [EMAIL PROTECTED] wrote: How to detect memory leaks of python

Re: How to in Python

2007-12-21 Thread MartinRinehart
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. -- http://mail.python.org/mailman/listinfo/python-list

Re: How to in Python

2007-12-21 Thread MartinRinehart
Gabriel Genellina wrote: Do you have to validate input based on that grammar? I've built a standalone tokenizer. It returns an array of Token objects. These include tokens such as UNCLOSED_QUOTE and MALFORMED_NUMBER ('1E' not followed by sign or digit, for instance). You could use this in a

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

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.insert(files, data)

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

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 reduce the size of new-style

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 class

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

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 method insert()

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:\string, line 1, in ? File c:\Python24\Lib\site-packages\pyTTS\__init__.py, line 28, in Create

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

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

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 in a thread on *the

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.__dict__['pos'] =

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

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

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, data) TypeError:

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

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 == 'pos':

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 (in my

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 spelled this out in my post

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

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

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 mark

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 is

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 programming

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

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, but still

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 =

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

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

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

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:\string, line 1, in ? File c:\Python24\Lib\site-packages\pyTTS\__init__.py,

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

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_category) VLAUES

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

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

2007-12-21 Thread MrJean1
My milage does vary, see this older post http://mail.python.org/pipermail/python-list/2004-May/261985.html 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 to

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 of

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 this

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

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 anything 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')

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 of

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

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

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 http://mail.python.org/pipermail/python-list/2004-May/261985.html 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 attribute

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

Re: Passing by reference

2007-12-21 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : Hi, Bruno. Merry Christmas! aol / 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

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

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: 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 name of the

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 5780 items the

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

  1   2   >