Python C API String Memory Consumption

2009-04-07 Thread k3xji
When I run the following function, I seem to have a mem leak, a 20 mb of memory is allocated and is not freed. Here is the code I run: >>> import esauth >>> for i in range(100): ... ss = esauth.penc('sumer') ... >>> for i in range(100): ... ss = esauth.penc('sumer') ... And here

Re: How can I change size of GUI?

2009-04-07 Thread Eric Brunel
Muddy Coder wrote: > Hi Folks, > > I copied code from book: > > class ScrolledText(Frame): > def __init__(self, parent=None, text='', file=None): > Frame.__init__(self, parent) > self.pack(expand=YES, fill=BOTH) > self.makeWidgets() > self.settext(text, file) >

Re: Anyone mannaged to access parallel port on windows xp?

2009-04-07 Thread Daniel Fetchinson
> I have a switch that I should connect to the parallel port, but had no luck > with it. Tha guy that made it for me told me that it would be easyer to > connect via parallel instead the USB > So did anyone have success? I only get suckess!! :-)) > tryed giveio.sys but it doesn't wort (can't f

Re: in place list modification necessary? What's a better idiom?

2009-04-07 Thread Peter Otten
MooMaster wrote: > Now we can't calculate a meaningful Euclidean distance for something > like "Iris-setosa" and "Iris-versicolor" unless we use string-edit > distance or something overly complicated, so instead we'll use a > simple quantization scheme of enumerating the set of values within the >

Re: in place list modification necessary? What's a better idiom?

2009-04-07 Thread Peter Otten
Peter Otten wrote: > MooMaster wrote: > >> Now we can't calculate a meaningful Euclidean distance for something >> like "Iris-setosa" and "Iris-versicolor" unless we use string-edit >> distance or something overly complicated, so instead we'll use a >> simple quantization scheme of enumerating th

Re: in place list modification necessary? What's a better idiom?

2009-04-07 Thread Carl Banks
On Apr 7, 12:38 am, Peter Otten <__pete...@web.de> wrote: > MooMaster wrote: > > Now we can't calculate a meaningful Euclidean distance for something > > like "Iris-setosa" and "Iris-versicolor" unless we use string-edit > > distance or something overly complicated, so instead we'll use a > > simpl

Re: Anyone mannaged to access parallel port on windows xp?

2009-04-07 Thread alejandro
I have a PC at work and at home. I wanted to write the errors it throws out when i try to use the module but now it work on this PC(the one at work). I don't get it?!?! I tryed so many things and now I can't remember what I have done :-))) This is worse than before! I will post the errors when i

Re: Anyone mannaged to access parallel port on windows xp?

2009-04-07 Thread alejandro
Yes that module is the one to blame for my headache! :-)) > Have you tried http://pyserial.wiki.sourceforge.net/pyParallel ? > > Cheers, > Daniel > > -- > Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: Python C API String Memory Consumption

2009-04-07 Thread k3xji
Interestaing I changed malloc()/free() usage with PyMem_xx APIs and the problem resolved. However, I really cannot understand why the first version does not work. Here is the latest code that has no problems at all: static PyObject * penc(PyObject *self, PyObject *args) { PyObject * result

pseudo-code

2009-04-07 Thread r-w
If no internet connection: if have files: run anyway, with warning else: ERROR else: if error getting hash/files: if have files: run anyway, with warning else: ERROR else: run -- http://mail.python.org/mailman/listinfo

Re: in place list modification necessary? What's a better idiom?

2009-04-07 Thread Peter Otten
Carl Banks wrote: > On Apr 7, 12:38 am, Peter Otten <__pete...@web.de> wrote: >> MooMaster wrote: >> > Now we can't calculate a meaningful Euclidean distance for something >> > like "Iris-setosa" and "Iris-versicolor" unless we use string-edit >> > distance or something overly complicated, so inst

Re: Python C API String Memory Consumption

2009-04-07 Thread Carl Banks
On Apr 7, 12:01 am, k3xji wrote: > When I run the following function, I seem to have a mem leak, a 20 mb > of memory > is allocated and is not freed. Here is the code I run: > > >>> import esauth > >>> for i in range(100): > > ...     ss = esauth.penc('sumer') > ... > > >>> for i in range(1000

PIL\Tkinter and Transparencies, Rubber Lines, and Dragging Image Objects

2009-04-07 Thread W. eWatson
Basically, I'd like to know how one (broadly, e.g., references in Win-land) does IP (image processing) and drawing techniques such as rubber lines, and dragging image objects across the canvas. I know there are some pretty powerful toolkits out there, but I'd like to limit this to PIL and Tkinte

Re: Issue with subprocess Module

2009-04-07 Thread Dave Angel
tarun wrote: Hello All, I've a batch file to be invoke using a python script. The batch file has pause, and the time, I need to send some command to the batch file from my scripts. I placed both, the batch file (test.bat) and the python script (test.py) in the same folder. And executed 'test.py

Re: Some test fail on my new Python 2.6

2009-04-07 Thread R. David Murray
Sorin Schwimmer wrote: > > > Run 'make test' instead of running them one by one. > > I did it *before* going one by one. I then tried individual tests in hope of > getting hints of what to look for. Actualy, for the first three tests, the > "make test" script commented that it is unusual for t

On Integration Testing

2009-04-07 Thread Emanuele D'Arrigo
Hi everybody, I just finished unit-testing a couple of tightly related modules and it's now time to test them together to a) check if they do talk to each other in the ways they should, b) check how fast they can talk to each other. The problem? Well, the problem is that potentially they can have

Scraping a web page

2009-04-07 Thread Ronn Ross
I'm using the following to scrape a web page: import urllib f = urllib.urlopen("http://www.google.com";) s = f.read() It is working, but it's returning the source of the page. Is there anyway I can get almost a screen capture of the page? Dankon -- http://mail.python.org/mailman/listinfo/python-

Re: Issue with subprocess Module

2009-04-07 Thread Tim Golden
Dave Angel wrote: tarun wrote: Hello All, I've a batch file to be invoke using a python script. The batch file has pause, and the time, I need to send some command to the batch file from my scripts. I placed both, the batch file (test.bat) and the python script (test.py) in the same folder.

Re: Python C API String Memory Consumption

2009-04-07 Thread MRAB
k3xji wrote: Interestaing I changed malloc()/free() usage with PyMem_xx APIs and the problem resolved. However, I really cannot understand why the first version does not work. Here is the latest code that has no problems at all: static PyObject * penc(PyObject *self, PyObject *args) { Py

Re: in place list modification necessary? What's a better idiom?

2009-04-07 Thread andrew cooke
Carl Banks wrote: > import collections > import itertools > > def createInitialCluster(fileName): > fixedPoints = [] > # quantization is a dict that assigns sequentially-increasing > numbers > # to values when reading keys that don't yet exit > quantization = defaultdict.collections

Re: building release - assert-free python library

2009-04-07 Thread Ben Finney
grbgooglefan writes: > I would like to avoid [exceptions] when compiling the libpython.a > library because when this libpython gets used for production purpose > and it aborts, the application goes down without any means of > graceful handling that error condition. How can we handle this? Except

Re: [Python-Dev] PEP 382: Namespace Packages

2009-04-07 Thread M.-A. Lemburg
[Resent due to a python.org mail server problem] On 2009-04-03 22:07, Martin v. Löwis wrote: >> I'd like to extend the proposal to Python 2.7 and later. > > I don't object, but I also don't want to propose this, so > I added it to the discussion. > > My (and perhaps other people's) concern is th

cgi file limit size?

2009-04-07 Thread R. David Murray
davidj411 wrote: > I am wondering where the limitation of filesize comes from when i > upload a large file. > it uploads when the filesize is less than 20 MB (but not if larger). > the script does not limit the filesize so it is either an HTTP > specification or a webserver limit, right? > maybe m

Re: building release - assert-free python library

2009-04-07 Thread Ulrich Eckhardt
grbgooglefan wrote: > How can I build a release and not the debug version of libpython.a? > I have seen that there are assert, abort statements in lot many > functions in Python code. I would like to avoid those when compiling > the libpython.a library because when this libpython gets used for > pr

Re: pseudo-code

2009-04-07 Thread Chris Rebert
On Tue, Apr 7, 2009 at 2:00 AM, r-w wrote: > If no internet connection: >    if have files: >        run anyway, with warning >    else: >        ERROR > else: >    if error getting hash/files: >        if have files: >            run anyway, with warning >        else: >            ERROR >    els

Re: Issue with subprocess Module

2009-04-07 Thread Albert Hopkins
On Tue, 2009-04-07 at 07:53 -0400, Dave Angel wrote: > > > subprocess.Popen() is expecting the name of a program, which should > normally have an extension of .exe You're handing it a .bat file, > which is not executable. It only executes in the context of a command > interpreter (shell),

Re: Some test fail on my new Python 2.6

2009-04-07 Thread Sorin Schwimmer
> Run 'make test' instead of running them one by one. I did it *before* going one by one. I then tried individual tests in hope of getting hints of what to look for. Actualy, for the first three tests, the "make test" script commented that it is unusual for them to fail on my platform (linux2)

Issue with subprocess Module

2009-04-07 Thread tarun
Hello All, I've a batch file to be invoke using a python script. The batch file has pause, and the time, I need to send some command to the batch file from my scripts. I placed both, the batch file (test.bat) and the python script (test.py) in the same folder. And executed 'test.py' (Please find

Re: PIL\Tkinter and Transparencies, Rubber Lines, and Dragging Image Objects

2009-04-07 Thread Eric Brunel
W. eWatson wrote: > Basically, I'd like to know how one (broadly, e.g., references in Win-land) > does IP (image processing) and drawing techniques such as rubber lines, and > dragging image objects across the canvas. I know there are some pretty > powerful toolkits out there, but I'd like to limit

Re: Eval Problem

2009-04-07 Thread Victor Subervi
Yes, Python is dynamic, but my server farm, in this era of big business screwing the client and cutting all services and customer support, uses such crappy hardware that all normal code breaks, so I am forced to find work-arounds. Here is more complete code: ourFile = string.split(__file__, "/") p

nonlocal in Python 2.6

2009-04-07 Thread Kay Schluehr
I always wondered about the decision to omit the nonlocal statement from the Python 2.X series because it seems to be orthogonal to Python 2.5. Are there any chances for it to be back ported? -- http://mail.python.org/mailman/listinfo/python-list

Re: Web validation

2009-04-07 Thread J. Clifford Dyer
On Tue, 2009-04-07 at 08:44 +1000, r-w wrote: > If no internet connection: > if have files: > run anyway, with warning > else: > ERROR > else: > if error getting hash/files: > if have files: > run anyway, with warning > else: >

Re: How to go about. On read/write locks

2009-04-07 Thread Piet van Oostrum
> "Diez B. Roggisch" (DBR) wrote: >>> This is a classical synchronization problem with a classical solution: >>> You treat the readers as a group, and the writers individually. So you >>> have a write lock that each writer has to acquire and release, but it is >>> acquired only by the first r

Re: in place list modification necessary? What's a better idiom?

2009-04-07 Thread R. David Murray
"andrew cooke" wrote: > Carl Banks wrote: > > import collections > > import itertools > > > > def createInitialCluster(fileName): > > fixedPoints = [] > > # quantization is a dict that assigns sequentially-increasing > > numbers > > # to values when reading keys that don't yet exit > >

building release - assert-free python library

2009-04-07 Thread grbgooglefan
How can I build a release and not the debug version of libpython.a? I have seen that there are assert, abort statements in lot many functions in Python code. I would like to avoid those when compiling the libpython.a library because when this libpython gets used for production purpose and it aborts

Re: Scraping a web page

2009-04-07 Thread Tim Chase
f = urllib.urlopen("http://www.google.com";) s = f.read() It is working, but it's returning the source of the page. Is there anyway I can get almost a screen capture of the page? This is the job of a browser -- to render the source HTML. As such, you'd want to look into any of the browser-aut

Re: pseudo-code

2009-04-07 Thread Steven D'Aprano
On Tue, 07 Apr 2009 19:00:30 +1000, r-w wrote: > If no internet connection: > if have files: > run anyway, with warning > else: > ERROR > else: > if error getting hash/files: > if have files: > run anyway, with warning > else: >

Re: extract Infobox contents

2009-04-07 Thread J. Clifford Dyer
On Mon, 2009-04-06 at 23:41 +0100, Rhodri James wrote: > On Mon, 06 Apr 2009 23:12:14 +0100, Anish Chapagain > wrote: > > > Hi, > > I was trying to extract wikipedia Infobox contents which is in format > > like given below, from the opened URL page in Python. > > > > {{ Infobox Software > > | n

Re: [Python-Dev] PEP 382: Namespace Packages

2009-04-07 Thread M.-A. Lemburg
On 2009-04-03 02:44, P.J. Eby wrote: > At 10:33 PM 4/2/2009 +0200, M.-A. Lemburg wrote: >> Alternative Approach: >> - >> >> Wouldn't it be better to stick with a simpler approach and look for >> "__pkg__.py" files to detect namespace packages using that O(1) check ? > >> One of

Re: in place list modification necessary? What's a better idiom?

2009-04-07 Thread MRAB
Carl Banks wrote: MooMaster wrote: So I'm reading in values from a file, and for each column I need to dynamically discover the range of possible values it can take and quantize if necessary. This is the solution I've come up with: [snip] #harvested from http://www.rosettacode.org/wiki/IsNume

Re: in place list modification necessary? What's a better idiom?

2009-04-07 Thread andrew cooke
just playing around - doesn't work with 3.0 due to lack of pattern binding (which i think is coming back in 3.1?) >>> from collections import defaultdict >>> from itertools import count >>> def mkdict(): return defaultdict(count().next) ... >>> converters = defaultdict(mkdict) >>> def to_float((i

Re: in place list modification necessary? What's a better idiom?

2009-04-07 Thread andrew cooke
R. David Murray wrote: >> [...] >> try: >> dimensions.append(float(s)) >> except: >> dimensions.append(float(quantization[s])) > > No, no, no; never use a bare except! :) can you explain why? i can't think of any reason why the code would be better catching a specific exception. as

Re: Issue with subprocess Module

2009-04-07 Thread Tim Golden
tarun wrote: Hello All, I've a batch file to be invoke using a python script. The batch file has pause, and the time, I need to send some command to the batch file from my scripts. I placed both, the batch file (test.bat) and the python script (test.py) in the same folder. And executed 'test.py

Re: Re: How can I change size of GUI?

2009-04-07 Thread John Posner
For what definition of 'did not work'? Seems perfectly fine to me. Just try to add the lines: root = Tk() Try adding a line like this: root.geometry("400x300+100+75") ... which means: "make the window 400 pixels wide and 300 pixels high, with the upperleft corner at point (100,75)"

Re: Python C API String Memory Consumption

2009-04-07 Thread John Machin
On Apr 7, 9:19 pm, MRAB wrote: > k3xji wrote: > > Interestaing I changed malloc()/free() usage with PyMem_xx APIs and > > the problem resolved. However, I really cannot understand why the > > first version does not work. Here is the latest code that has no > > problems at all: > > > static PyObjec

Re: Issue with subprocess Module

2009-04-07 Thread MRAB
Tim Golden wrote: tarun wrote: Hello All, I've a batch file to be invoke using a python script. The batch file has pause, and the time, I need to send some command to the batch file from my scripts. I placed both, the batch file (test.bat) and the python script (test.py) in the same folder.

Re: in place list modification necessary? What's a better idiom?

2009-04-07 Thread MRAB
andrew cooke wrote: R. David Murray wrote: [...] try: dimensions.append(float(s)) except: dimensions.append(float(quantization[s])) No, no, no; never use a bare except! :) can you explain why? i can't think of any reason why the code would be better catching a specific exceptio

hashing and collision detection

2009-04-07 Thread Aaron Brady
Hi group, You are making good on your promise from a year ago: "This is a helpful group. Give us more to go on, and you are likely to receive thousands of dollars worth of consulting for free." http://groups.google.com/group/comp.lang.python/msg/2e2906eaa804812c - Bryan Olson I have an idea, whic

Re: Weird Tk Canvas coordinate issue

2009-04-07 Thread Tim Shannon
Here's my actual code, but I've tried to strip out the irrelevant parts, but it should compile. FYI, I'm using 2.6 not 3. The code is basically drawing a grid with points in it. I'm fairly new to Python, so constructive criticism is appreciated. class Editor: GSPACE = 80 OFFSET = 50

Re: Eval Problem

2009-04-07 Thread J. Cliff Dyer
OK. You still haven't shown the code where tableTop gets defined, so your code is unrunnable. However, I think your problem is that wherever tableTop lives, it isn't part of your globals or locals in eval. See the documentation on evals here: http://www.python.org/doc/1.4/lib/node26.html Somet

Re: in place list modification necessary? What's a better idiom?

2009-04-07 Thread R. David Murray
On Tue, 7 Apr 2009 at 09:01, andrew cooke wrote: R. David Murray wrote: [...] try: dimensions.append(float(s)) except: dimensions.append(float(quantization[s])) No, no, no; never use a bare except! :) can you explain why? i can't think of any reason why the code would be bette

RE: Scraping a web page

2009-04-07 Thread Support Desk
You could do something like below to get the rendered page. Import os site = 'website.com' X = os.popen('lynx --dump %s' % site).readlines() -Original Message- From: Tim Chase [mailto:python.l...@tim.thechases.com] Sent: Tuesday, April 07, 2009 7:45 AM To: Ronn Ross Cc: python-list

Re: PIL\Tkinter and Transparencies, Rubber Lines, and Dragging Image Objects

2009-04-07 Thread W. eWatson
You got it. That lamda did look a little odd. The white background is opaque and the telescope is seen as green. The program will ask for a file. I didn't write the code. Eric Brunel wrote: W. eWatson wrote: Basically, I'd like to know how one (broadly, e.g., references in Win-land) does IP (

Re: [Python-Dev] PEP 382: Namespace Packages

2009-04-07 Thread P.J. Eby
At 02:30 PM 4/7/2009 +0200, M.-A. Lemburg wrote: >> Wouldn't it be better to stick with a simpler approach and look for >> "__pkg__.py" files to detect namespace packages using that O(1) check ? > > Again - this wouldn't be O(1). More importantly, it breaks system > packages, which now again have

PyXML and Python-2.6

2009-04-07 Thread Andrew MacKeith
The Python.org "SIG for XML Processing in Python" page indicates that "The SIG, through the mailing list and the PyXML project hosted on SourceForge...". The PyXML project on SourceForge " is no longer maintained. ", so perhaps the SIG page could be updated. Is there a guide to porting proje

Re: nonlocal in Python 2.6

2009-04-07 Thread Benjamin Peterson
Kay Schluehr gmx.net> writes: > > I always wondered about the decision to omit the nonlocal statement > from the Python 2.X series because it seems to be orthogonal to Python > 2.5. Are there any chances for it to be back ported? The only reason it was not backported was that either no one prov

Re: Python C API String Memory Consumption

2009-04-07 Thread Benjamin Peterson
Carl Banks gmail.com> writes: > However, Python apparently does leak a reference if passed a Unicode > object; PyArg_ParseTuple automatically creates an encoded string but > never decrefs it. (That might be necessary evil to preserve > compatibility, though. PyString_AS_STRING does it too.) Uni

Re: Issue with subprocess Module

2009-04-07 Thread Dave Angel
Tim Golden wrote: Dave Angel wrote: tarun wrote: Hello All, I've a batch file to be invoke using a python script. The batch file has pause, and the time, I need to send some command to the batch file from my scripts. I placed both, the batch file (test.bat) and the python script (test.py)

Re: in place list modification necessary? What's a better idiom?

2009-04-07 Thread andrew cooke
MRAB wrote: > andrew cooke wrote: >> R. David Murray wrote: [...] try: dimensions.append(float(s)) except: dimensions.append(float(quantization[s])) >>> No, no, no; never use a bare except! :) >> >> can you explain why? i can't think of any reason why the cod

Python syntax

2009-04-07 Thread janus99
well i'm pretty much a newb on python, it's my first comp lang. and i've been having some diffuclties, i want to get the hang of it and i'm wondering if u could help me understand the syntax structure. I messed around with my own comp (windos xp) command prompt and i currently play a mud, but the

Adding method to class at run-time: bad style?

2009-04-07 Thread Grant Edwards
I realize that technically all methods are added to classes at "run-time", but what I'm talking about is this: import ClientForm def controlEqual(self,other): return (self.type == other.type) and \ (self.name == other.name) and \ (self.value == other.value

Re: Adding method to class at run-time: bad style?

2009-04-07 Thread Michele Simionato
On Apr 7, 4:37 pm, Grant Edwards wrote: > I realize that technically all methods are added to classes at > "run-time", but what I'm talking about is this: Raymond Hettinger solves this problem nicely with a class decorator: http://code.activestate.com/recipes/576685/ -- http://mail.python.org/ma

Re: Python syntax

2009-04-07 Thread dorzey
http://wiki.python.org/moin/BeginnersGuide is probably a good place to start. I found lots of useful info from the links on this page when I started programming in Python. Dorzey -- http://mail.python.org/mailman/listinfo/python-list

Re: PyXML and Python-2.6

2009-04-07 Thread Paul Boddie
On 7 Apr, 16:01, Andrew MacKeith wrote: > The Python.org "SIG for XML Processing in Python" page indicates that > "The SIG, through the mailing list and the PyXML project hosted on > SourceForge...". > > The PyXML project on SourceForge " is no longer maintained. ", so > perhaps the SIG page could

Re: [Python-Dev] PEP 382: Namespace Packages

2009-04-07 Thread M.-A. Lemburg
On 2009-04-07 16:05, P.J. Eby wrote: > At 02:30 PM 4/7/2009 +0200, M.-A. Lemburg wrote: >> >> Wouldn't it be better to stick with a simpler approach and look for >> >> "__pkg__.py" files to detect namespace packages using that O(1) >> check ? >> > >> > Again - this wouldn't be O(1). More importantl

Expression

2009-04-07 Thread Lydia
I am working on calculating one of the fields in a feature class based on other 2 fields. The logic is, A (the resulting field) is calculated from B, but C and D have part of the value that could fill the blank of B, which meaning that combine three fields of values can make A. Field A is what

RE: Scraping a web page

2009-04-07 Thread Support Desk
If your only interested in the Images, perhaps you want to use wget like: wget -r --accept=jpg,jpeg www.xyz.org or maybe this http://www.vex.net/~x/python_stuff.html BackCrawler 1.1 A crude web spider with only one purpose: merciless

Re: Scraping a web page

2009-04-07 Thread cgoldberg
> Is there anyway I > can get almost a screen capture of the page? I'm not sure exactly what you mean by "screen capture". But the webbrowser module in the standard lib might be of some help. You can use it to drive a web browser from Python. to load a page in your browser, you can do something

Re: New online docs broken?

2009-04-07 Thread Jim Garrison
Ye Liu wrote: On Apr 6, 6:33 pm, Jim Garrison wrote: I notice the online docs (at docs.python.org/3.0/index.html) were updated today. It seems some of the top-level pages, like Tutorial, "Using Python", "Language Reference" are truncated after the first few paragraphs. Yea, same here. Hope i

Re: [Python-Dev] PEP 382: Namespace Packages

2009-04-07 Thread David Cournapeau
On Tue, Apr 7, 2009 at 11:58 PM, M.-A. Lemburg wrote: >> >> This means your proposal actually doesn't add any benefit over the >> status quo, where you can have an __init__.py that does nothing but >> declare the package a namespace.  We already have that now, and it >> doesn't need a new filenam

SoHo Book Problem

2009-04-07 Thread David C. Ullrich
Just curious - has anyone else bought the printed Python 3 Reference Manual published by SoHo Books? Talking about what they call "Part 2" of their Python Documentation. I haven't looked in detail - Part 1 seems fine, but the typesetting in Part 2 is totally screwed up. I mean totally - on more o

Re: Best way to start

2009-04-07 Thread Tairic
I was looking for a language that seemed easier to learn and that was powerful, so I just started learning Python myself. I'm using some online tutorials and The book "Python Power!" by Matt Telles. Some of the O'Reilley books looked ok (I spent a while in the bookstore deciding), but this one was

Re: Python C API String Memory Consumption

2009-04-07 Thread Floris Bruynooghe
On Apr 7, 2:10 pm, John Machin wrote: > On Apr 7, 9:19 pm, MRAB wrote: > > > > > k3xji wrote: > > > Interestaing I changed malloc()/free() usage with PyMem_xx APIs and > > > the problem resolved. However, I really cannot understand why the > > > first version does not work. Here is the latest cod

Re: Delicious API and urllib2

2009-04-07 Thread Max Erickson
Bill wrote: > The delicious api requires http authorization (actually https). A > generic delicious api post url is "https:// > username:passw...@api.api.del.icio.us/v1/posts/add?url=http:// > example.com/&description=interesting&tags=whatever". > The simplest way is probably to manually add th

Re: Issue with subprocess Module

2009-04-07 Thread R. David Murray
Tim Golden wrote: > tarun wrote: > > Hello All, > > > > I've a batch file to be invoke using a python script. The batch file has > > pause, and the time, I need to send some command to the batch file from my > > scripts. I placed both, the batch file (test.bat) and the python script > > (test.py

Re: On Integration Testing

2009-04-07 Thread Scott David Daniels
Emanuele D'Arrigo wrote: Hi everybody, I just finished unit-testing a couple of tightly related modules and it's now time to test them together to a) check if they do talk to each other in the ways they should, b) check how fast they can talk to each other. The problem? Well, the problem is that

Re: Adding method to class at run-time: bad style?

2009-04-07 Thread Scott David Daniels
Grant Edwards wrote: I realize that technically all methods are added to classes at "run-time", but what I'm talking about is this: import ClientForm def controlEqual(self,other): return (self.type == other.type) and \ (self.name == other.name) and \ (se

named pipe and Linux

2009-04-07 Thread akineko
Hello everyone, I'm trying to use named pipes to fuse a Python program and a C program. One side creates pipes using os.mkfifo() and both sides use the same named pipes (one side reads, another side writes). The read side uses select.select() to wait for incoming messages and read the message when

extracting plain text from RTF-file ?

2009-04-07 Thread Stef Mientki
hello, I'm looking for a library to extract plain text from RTF-files. I found these only RTF generation http://pyrtf.sourceforge.net/ should be able to parse, but no download files http://code.google.com/p/pyrtf-ng/ any suggestions ? thanks, Stef Mientki -- http://mail.python.org/mailman/lis

Re: extracting plain text from RTF-file ?

2009-04-07 Thread Brent Bloxam
Stef Mientki wrote: hello, I'm looking for a library to extract plain text from RTF-files. I found these only RTF generation http://pyrtf.sourceforge.net/ should be able to parse, but no download files http://code.google.com/p/pyrtf-ng/ any suggestions ? thanks, Stef Mientki -- http://mail.p

Re: Call to PyEval_EvalCodeEx crashes in PyFrame_New with abort

2009-04-07 Thread Aahz
[posted and e-mailed] In article <72593fd7-4500-4ea9-b54e-1637d07b5...@s12g2000prc.googlegroups.com>, grbgooglefan wrote: > >I've emabedded Python(2.6) in my C++ application and using on Solaris >5.10. When the application calls Py_Eval, it causes an abort & >application core dumps. But this is

Re: UnknownTimeZoneError

2009-04-07 Thread Aahz
[posted & e-mailed] In article <7c101864-308c-468a-9053-819af2f57...@o6g2000yql.googlegroups.com>, Brian wrote: > >I'm running App Engine with Django. I'm having troubles executing >timezone conversion via pytz. What version of Python are you using? IIRC, GAE uses Python 2.3. Do other timezo

Re: [Python-Dev] PEP 382: Namespace Packages

2009-04-07 Thread P.J. Eby
At 04:58 PM 4/7/2009 +0200, M.-A. Lemburg wrote: On 2009-04-07 16:05, P.J. Eby wrote: > At 02:30 PM 4/7/2009 +0200, M.-A. Lemburg wrote: >> >> Wouldn't it be better to stick with a simpler approach and look for >> >> "__pkg__.py" files to detect namespace packages using that O(1) >> check ? >> >

Re: python for loop

2009-04-07 Thread Aahz
In article , Lou Pecora wrote: >In article ><5c92e9bd-1fb4-4c01-a928-04d7f6733...@e21g2000yqb.googlegroups.com>, > Aaron Brady wrote: >> >> Did I tell you guys that 'natural' has 38 definitions at >> dictionary.com? > >Amazing. I suggest you pick the one that fits best. "The wonderful thing

Re: PyXML and Python-2.6

2009-04-07 Thread Stefan Behnel
Andrew MacKeith wrote: > The Python.org "SIG for XML Processing in Python" page indicates that > "The SIG, through the mailing list and the PyXML project hosted on > SourceForge...". > > The PyXML project on SourceForge " is no longer maintained. ", so > perhaps the SIG page could be updated. > >

Re: Q: "Best" book for teaching

2009-04-07 Thread Mike Driscoll
On Apr 6, 9:37 am, grkunt...@gmail.com wrote: > I am considering teaching an "introduction to programming" course for > continuing education adults at a local  community college. These would > people with no programming experience, but I will require a reasonable > facility with computers. > > What

Re: Adding method to class at run-time: bad style?

2009-04-07 Thread Grant Edwards
On 2009-04-07, Grant Edwards wrote: > On 2009-04-07, Scott David Daniels wrote: >> Grant Edwards wrote: >>> I realize that technically all methods are added to classes at >>> "run-time", but what I'm talking about is this: > ... >> >>>ClientForm.Control.__eq__ = controlEqual >>>ClientForm

3D plotting in a GUI

2009-04-07 Thread Baris Demir
Hi all, I need to develop a GUI for some scientific data processing operations and this GUI should work well with a 3D plotting module, also with NumPy and SciPy for sure. I made a search about packages but, there are plenty of these modules available. What kind of a package or a package of p

Re: Tkinter, tkFileDialog - how to select multiple files ?

2009-04-07 Thread Steve Offutt
Hmm ... sorry folks - this works for me everywhere except on the machine I wrote it on ... Must be some sort of configuration problem... Steve -- http://mail.python.org/mailman/listinfo/python-list

Re: Issue with subprocess Module

2009-04-07 Thread Tim Golden
Tim Golden wrote: So it looks as though the MS docs are simply wrong? I haven't tried it with ctypes or a native C program, but I can't see that they should be any different. If I get a chance later I'll knock something up in C. OK, copying the standard MS example for creating a process: http

Re: Python syntax

2009-04-07 Thread Dave Angel
janus99 wrote: well i'm pretty much a newb on python, it's my first comp lang. and i've been having some diffuclties, i want to get the hang of it and i'm wondering if u could help me understand the syntax structure. I messed around with my own comp (windos xp) command prompt and i currently pla

PyCon Italy 2009: Early Bird Deadline

2009-04-07 Thread Alan Franzoni
The early-bird registration deadline for PyCon Tre (PyCon Italy 2009) is April 13th, just a few days from now. The conference will take place in Florence from May 8th till May 10th 2009, and features guests like Guido Van Rossum, Alex Martelli, Raymond Hettinger, Fredrik Lundh and Antonio Cangiano

PyCon Italy 2009: Early Bird Deadline

2009-04-07 Thread Alan Franzoni
The early-bird registration deadline for PyCon Tre (PyCon Italy 2009) is April 13th, just a few days from now. The conference will take place in Florence from May 8th till May 10th 2009, and features guests like Guido Van Rossum, Alex Martelli, Raymond Hettinger, Fredrik Lundh and Antonio Cangi

Re: Issue with subprocess Module

2009-04-07 Thread Tim Golden
Tim Golden wrote: Sounds reasonable, but isn't actually true. This works fine: import subprocess open ("t.bat", "w").write ("echo hello") subprocess.Popen ("t.bat") TJG Dave Angel wrote: The docs of Popen() state that it uses CreateProcess() on Windows, so I didn't even try it. I o

Re: Returning different types based on input parameters

2009-04-07 Thread Adam Olsen
On Apr 6, 3:02 pm, George Sakkis wrote: > For example, it is common for a function f(x) to expect x to be simply > iterable, without caring of its exact type. Is it ok though for f to > return a list for some types/values of x, a tuple for others and a > generator for everything else (assuming it'

Tkinter, tkFileDialog - how to select multiple files ?

2009-04-07 Thread Steve Offutt
Let me preface by saying that I don't do much Python, however, I am in my spare time, attempting to become somewhat comfortable with Python/ Tkinter. I just can't seem to understand what is the problem with this: -- import Tkinter, tkFileDialog root = Tkinter.Tk() files = tkFileDialog.askop

Request For Comment

2009-04-07 Thread Aahz
How RFC1 got created: http://www.nytimes.com/2009/04/07/opinion/07crocker.html -- Aahz (a...@pythoncraft.com) <*> http://www.pythoncraft.com/ "...string iteration isn't about treating strings as sequences of strings, it's about treating strings as sequences of characters. The

Re: Adding method to class at run-time: bad style?

2009-04-07 Thread Grant Edwards
On 2009-04-07, Scott David Daniels wrote: > Grant Edwards wrote: >> I realize that technically all methods are added to classes at >> "run-time", but what I'm talking about is this: >> >>import ClientForm >> >>def controlEqual(self,other): >>return (self.type == other.type) and \

Re: Creating Linked Lists in Python

2009-04-07 Thread andrew cooke
J-Burns wrote: > How can I do this? And if I could do this by some other way than using > linked lists than do tell me about that as well. replying to this dead thread mainly for anyone using google. there's now a python regular expression engine in lepl and the source code can be seen via http:/

xml.dom.minidom getElementsByTagName white space issue

2009-04-07 Thread Leonardo lozanne
Hi,   I'm getting some XML tags with white spaces from a web service and when I try to get them with the getElements ByTagName I'm not able to do so. I'm getting an empty list. What I'm doing is:   #XML_response is an xml string xml_msg = xml.dom.minidom.parseString(XML_response)   nodes = xml_ms

  1   2   >