Re: Injecting python function in an embedded python engine

2009-04-07 Thread Gabriel Genellina
En Mon, 06 Apr 2009 13:58:12 -0300, Roberto Fichera escribió: I've embedded python v2.6.x engine into my application without any problem. Now I would like to inject some additional functions after importing a python module. So, basically I'm importing a python module via PyImport_ImportModu

Re: Incomplete exception tracebacks when importing from zipped modules

2009-04-07 Thread Gabriel Genellina
En Thu, 02 Apr 2009 09:35:53 -0300, arve.knud...@gmail.com escribió: I can't seem to get complete tracebacks when modules imported from zip archives raise exceptions. [...] As you can see, the code for each stack entry is omitted. Is this normal?? A known problem, at least... You should be

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

2009-04-07 Thread prakash jp
Hi all, just would like to say that most of the parallel port preexistant code is usually blinking leds, which is the not the true reprsentation of the paralle port behaviour. Here one needs to think that data is coming out byte after byte. Now plz look out for the sequence to push data byte afte

Re: Converting a PIL image object to a buffer

2009-04-07 Thread Gabriel Genellina
En Wed, 01 Apr 2009 19:20:43 -0300, Simon Hibbs escribió: On 1 Apr, 21:43, Gary Herron wrote: Simon Hibbs wrote: > I'm trying to dump a snapshot of my application window to the > clipboard. I can use ImageGrab in PIL to get the screen data into a > PIL image object, which i have converted

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

2009-04-07 Thread alejandro
Now it doesn't throw exceptions but it doesn't work. I tryed to connect a LED light to the port and it wan't glow. Do you know a way to check if the port work? -- http://mail.python.org/mailman/listinfo/python-list

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

2009-04-07 Thread Gabriel Genellina
En Tue, 07 Apr 2009 20:45:15 -0300, Grant Edwards escribió: On 2009-04-07, Scott David Daniels wrote: Grant Edwards wrote: On 2009-04-07, Scott David Daniels wrote: File "/usr/lib/python2.5/site-packages/ClientForm.py", line 2016, in add_to_form Control.add_to_form(self, for

Re: Python syntax

2009-04-07 Thread Lawrence D'Oliveiro
In message , Steve Holden wrote: > Lawrence D'Oliveiro wrote: > >> In message <7dd228af- >> e549-444d-8623-11e951851...@y9g2000yqg.googlegroups.com>, janus99 wrote: >> >>> I messed around with my own comp (windos xp) command prompt ... >> >> Try a Linux command prompt. You'll learn a bit more t

Re: Some test fail on my new Python 2.6

2009-04-07 Thread Sorin Schwimmer
I wanted to replace my old Python 2.4 and tcl/tk 8.4 with tcl/tk 8.5.6 and Python 2.6, mainly so that I can enjoy ttk. tcl/tk was installed from sources without any problem, I started a wish and worked. Now, for the Python, here are all the issues signaled by make test: running build running b

Re: Python syntax

2009-04-07 Thread Steve Holden
Lawrence D'Oliveiro wrote: > In message <7dd228af- > e549-444d-8623-11e951851...@y9g2000yqg.googlegroups.com>, janus99 wrote: > >> I messed around with my own comp (windos xp) command prompt ... > > Try a Linux command prompt. You'll learn a bit more that way. > Great advice when Linux is availa

RELEASED Python 2.6.2 candidate 1

2009-04-07 Thread Barry Warsaw
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I'm happy to announce the release of Python 2.6.2 candidate 1. This release contains dozens of bug fixes since Python 2.6.1. Please see the NEWS file for a detailed list of changes. Barring unforeseen problems, Python 2.6.2 final will be relea

Re: is there a way to collect twitts with python?

2009-04-07 Thread Aahz
In article , Nick Stinemates wrote: > >You mean you don't want to read every detail of someone's life? Damn.. Someone has probably done this already, but I've been tempted to set up a Twitter feed that lists every time I visit the loo. -- Aahz (a...@pythoncraft.com) <*> http://

Re: Lock down Internet Access from Python script?

2009-04-07 Thread Lawrence D'Oliveiro
In message <97995159-9dfd-44e5-8c00-441c0699a...@f19g2000yqo.googlegroups.com>, roschler wrote: > I know it's not possible to "sandbox" the Python Interpreter ... The Google App Engine does exactly that. How could you do it? My guess is, use some kind of virtualization (if you have the hardwa

Re: 3D plotting in a GUI

2009-04-07 Thread Eric Carlson
Baris Demir wrote: 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 packag

Re: object knows which object called it?

2009-04-07 Thread afriere
On Apr 7, 2:53 am, "R. David Murray" wrote: > I think the OO way to do this is to provide a method on A that does the > right thing: > >     def Bfoo_func(self): >         self.B.foo_func(self) > > Or maybe you could look at generic methods, which provide a way > to do multiple dispatch. +1 Whic

cross platform ping module

2009-04-07 Thread Eugene Yunak
Hi all! I'm interested in developing a cross platform module that will allow a simple 'ping' functionality, i mean sending icmp type 8 code 0 and receiving appropriate answers. This sound like a simple work, but i ask for your help with architectural decision. I can implement icmp communications

Re: extract Infobox contents

2009-04-07 Thread Rhodri James
On Tue, 07 Apr 2009 12:46:18 +0100, J. Clifford Dyer wrote: 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 UR

Lock down Internet Access from Python script?

2009-04-07 Thread roschler
I know it's not possible to "sandbox" the Python Interpreter like you can the Java VM, but I'm wondering if there is a way to at least lock down internet access? Trying to do it at the O/S service level on Windows like ZoneAlarm does isn't feasible for me, but I thought there might be a way to do

Re: object knows which object called it?

2009-04-07 Thread Ricardo Aráoz
Reckoner wrote: >> hi, >> >> I have the following problem: I have two objects, say, A and B, which >> are both legitimate stand-alone objects with lives of their own. >> >> A contains B as a property, so I often do >> >> A.B.foo() >> >> the problem is that some functions inside of B actually need A

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: >> On 2009-04-07, Scott David Daniels wrote: >> File "/usr/lib/python2.5/site-packages/ClientForm.py", line 2016, in add_to_form Control.add_to_form(self, form) TypeError: unbound method add_to_f

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

2009-04-07 Thread Scott David Daniels
Grant Edwards wrote: On 2009-04-07, Scott David Daniels wrote: File "/usr/lib/python2.5/site-packages/ClientForm.py", line 2016, in add_to_form Control.add_to_form(self, form) TypeError: unbound method add_to_form() must be called with FancyControl instance as first argument (

Re: 3D plotting in a GUI

2009-04-07 Thread R Fritz
I've been doing 3D modeling for lighting simulation and I found two reasonably well-supported solutions: VTK and OpenSceneGraph. VTK generally has a research slant and has what I believe are reasonably strong Python bindings. OSG is closer to VR/AR/Flight Simulation applications and the Pytho

Re: named pipe and Linux

2009-04-07 Thread akineko
Hello Cameron Simpson, Thank you for your reply. I now think the way I did (using fstat()) was a very bad idea (as you pointed out). I haven't decided how to fix this yet. I also considered attaching the message length to the head of the message. It will work, too. I need to a bit more experiment.

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

2009-04-07 Thread Grant Edwards
On 2009-04-07, Scott David Daniels wrote: >> File "/usr/lib/python2.5/site-packages/ClientForm.py", line 2016, in >> add_to_form >>Control.add_to_form(self, form) >>TypeError: unbound method add_to_form() must be called with FancyControl >> instance as first argument (got Check

Re: named pipe and Linux

2009-04-07 Thread Lawrence D'Oliveiro
In message <5b5157dd- ca70-4c6d-8adb-8a4d322fb...@x31g2000prc.googlegroups.com>, akineko wrote: > The length of the message is unknown to the read side. I think you want a message-based, not a stream-based, IPC mechanism. Look at the docs on msgctl, msgget, msgop and so on. -- http://mail.pytho

Re: Python syntax

2009-04-07 Thread Lawrence D'Oliveiro
In message <7dd228af- e549-444d-8623-11e951851...@y9g2000yqg.googlegroups.com>, janus99 wrote: > I messed around with my own comp (windos xp) command prompt ... Try a Linux command prompt. You'll learn a bit more that way. -- http://mail.python.org/mailman/listinfo/python-list

Re: named pipe and Linux

2009-04-07 Thread Cameron Simpson
On 07Apr2009 10:08, akineko wrote: | 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 messa

Re: Expression

2009-04-07 Thread Terry Reedy
Lydia wrote: 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. F

Re: 3D plotting in a GUI

2009-04-07 Thread Scott David Daniels
Baris Demir wrote: 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 Look into VPytho

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

2009-04-07 Thread Scott David Daniels
Grant Edwards wrote: 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 ClientFo

Re: pseudo-code

2009-04-07 Thread r-w
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 else: run Sorry, guys. This should ha

Re: with open('com1', 'r') as f:

2009-04-07 Thread Terry Reedy
Lawrence D'Oliveiro wrote: In message , Delaney, Timothy (Tim) wrote: Lawrence D'Oliveiro wrote: In message , Terry Reedy wrote: Lawrence D'Oliveiro wrote: All Python objects are reference-counted. Nope. Only in CPython, and even that could change. Why should it? Because Guido has sa

Re: 3D plotting in a GUI

2009-04-07 Thread Stef Mientki
Baris Demir wrote: 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 packag

Re: extracting plain text from RTF-file ?

2009-04-07 Thread Stef Mientki
Brent Bloxam wrote: 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 Mie

Re: Request For Comment

2009-04-07 Thread Falcolas
On Apr 7, 12:57 pm, a...@pythoncraft.com (Aahz) wrote: > How RFC1 got created: > > http://www.nytimes.com/2009/04/07/opinion/07crocker.html Thanks for bring that forward; I thought it was an interesting read and a nice polite (yet much needed) little jab at status-quo. ~G -- http://mail.python.or

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

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

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

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

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

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

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

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 \

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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.

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-

  1   2   >