Re: Tkinter menu question--how to pass arguments

2007-03-30 Thread kyosohma
On Mar 30, 2:32 pm, Kevin Walzer <[EMAIL PROTECTED]> wrote: > I'm having difficulty structuring a Tkinter menu entry. Here is the > command in question: > > self.finkmenu.add_command(label='Update List of Packages', > command=self.authorizeCommand(self.scanPackages)) > > When I start my program, it

Re: Tkinter menu question--how to pass arguments

2007-03-30 Thread kyosohma
On Mar 30, 2:32 pm, Kevin Walzer <[EMAIL PROTECTED]> wrote: > I'm having difficulty structuring a Tkinter menu entry. Here is the > command in question: > > self.finkmenu.add_command(label='Update List of Packages', > command=self.authorizeCommand(self.scanPackages)) > > When I start my program, it

Re: Object Oriented Database with interface for Pyhton

2007-03-30 Thread Joshua J. Kugler
On Friday 30 March 2007 01:04, [EMAIL PROTECTED] wrote: > Hello all > > I am looking for an object oriented database with interffaces for > python. Either open source or commercial. > > I am looking for a Database not a object persistence system. I would > like to be able to execute queries outs

newb: lxml objectify

2007-03-30 Thread johnny
Breakfast at Tiffany's Movie Classic Borat Movie Comedy How do you represent DVD id=1 and it's elements, and DVD id=2 and it's elements as child of root "Library"? Like this:? from lxml import etree from lxml import objectify root = objectify.Element("Library") child[1] = objectify.Elemen

Re: Tkinter menu question--how to pass arguments

2007-03-30 Thread Kevin Walzer
[EMAIL PROTECTED] wrote: > On Mar 30, 2:32 pm, Kevin Walzer <[EMAIL PROTECTED]> wrote: >> I'm having difficulty structuring a Tkinter menu entry. Here is the >> command in question: >> >> self.finkmenu.add_command(label='Update List of Packages', >> command=self.authorizeCommand(self.scanPackages))

Re: Tkinter menu question--how to pass arguments

2007-03-30 Thread Kevin Walzer
Dave Opstad wrote: > In article <[EMAIL PROTECTED]>, > Kevin Walzer <[EMAIL PROTECTED]> wrote: > >> I'm having difficulty structuring a Tkinter menu entry. Here is the >> command in question: >> >> self.finkmenu.add_command(label='Update List of Packages', >> command=self.authorizeCommand(self.

Re: [Pythonmac-SIG] MacPython wiki "moved" to Python wiki - now it's your turn...

2007-03-30 Thread skip
Kevin> I was just looking at the new MacPython pages at the Python Kevin> wiki--it appears nothing has been done with them since Skip moved Kevin> them over. I'm thinking this is a terrific opportunity to bring Kevin> them up to date: would anyone mind if I got started? A lot of

I can't get multi-dimensional array to work...

2007-03-30 Thread erikcw
Hi, I'm trying to create a multidimensional data structure. However, id doesn't seem to work past the 2nd dimension. Here is my method: def endElement(self, name): if name == 'row' : if not self.data.has_key(self.parent): self.data[self.parent] = {}

Re: PyPy 1.0: JIT compilers for free and more

2007-03-30 Thread Jacob Hallen
In article <[EMAIL PROTECTED]>, Jarek Zgoda <[EMAIL PROTECTED]> wrote: >Carl Friedrich Bolz napisa³(a): > >> Welcome to the PyPy 1.0 release - a milestone integrating the results >> of four years of research, engineering, management and sprinting >> efforts, concluding the 28 months phase of EU co

Re: Modal value of an array

2007-03-30 Thread Gabriel Genellina
En Thu, 29 Mar 2007 19:44:56 -0300, Paddy <[EMAIL PROTECTED]> escribió: > On Mar 29, 8:49 am, [EMAIL PROTECTED] (Alex Martelli) wrote: >> >>> foo = ["spam", "eggs", "spam", "spam", "spam", "beans", "eggs"] >> >>> max(foo, key=foo.count) >> >> 'spam' > > This doesn't call foo.count for duplicate

Re: I can't get multi-dimensional array to work...

2007-03-30 Thread FlipFish2007
On Mar 30, 4:56 pm, "erikcw" <[EMAIL PROTECTED]> wrote: > Hi, > > I'm trying to create a multidimensional data structure. However, id > doesn't seem to work past the 2nd dimension. > > Here is my method: > > def endElement(self, name): > if name == 'row' : > if not self.data.ha

Re: New to Python - Easy way to open a text file

2007-03-30 Thread Michael Tobis
I think it's pretty clear that we aren't understanding what you mean by "open a text file and disply its content". I conclude that by "edna" you mean this thing: http://edna.sourceforge.net/ I suspect you are not asking a Python question at all. Did you try opening file:edna-0.6/templates/d

Re: clean up html document created by Word

2007-03-30 Thread Laurent Pointal
jd wrote: > I am looking for python code (working or sample code) that can take an > html document created by Microsoft Word and clean it up (if you've > never had to look at a Word-generated html document, consider yourself > lucky ;-) Alternatively, if you know of a non-python solution, I'd > l

Re: I can't get multi-dimensional array to work...

2007-03-30 Thread erikcw
On Mar 30, 5:23 pm, [EMAIL PROTECTED] wrote: > On Mar 30, 4:56 pm, "erikcw" <[EMAIL PROTECTED]> wrote: > > > > > Hi, > > > I'm trying to create a multidimensional data structure. However, id > > doesn't seem to work past the 2nd dimension. > > > Here is my method: > > > def endElement(self, name):

Re: Game programming for kids: looking for open source 2D game development kit

2007-03-30 Thread Laurent Pointal
John Salerno wrote: > Laurent Pointal wrote: > >> With Python: >> * pygame + build your drag'n drop features >> * if you like 3D, vpython. >> >> >> http://www.pygame.org/ >> http://www.vpython.org/ > > Wow, vpython looks pretty need. I'm messing around with it right now > and reading the docs

Re: Inserting '-' character in front of all numbers in a string

2007-03-30 Thread Paul McGuire
On Mar 30, 2:09 pm, Michael Bentley <[EMAIL PROTECTED]> wrote: > On Mar 30, 2007, at 10:38 AM, kevinliu23 wrote: > > > > > > > I want to be able to insert a '-' character in front of all numeric > > values in a string. I want to insert the '-' character to use in > > conjunction with the getopt.get

Re: Cheeseshop needs mirrors

2007-03-30 Thread Richard Jones
Paul Boddie wrote: > On 30 Mar, 09:05, "Jon" <[EMAIL PROTECTED]> wrote: >> >> If something as widely used as eggs is going to have a single point of >> failure like the Cheeseshop, we can't have it going down. >> >> I'm sure there are other solutions, but my suggestion is simply to >> have mirrors.

Mouse click in python

2007-03-30 Thread Synt4x
I'm creating a webcam user interface (to control google earth through my webcam) and I still can't find a good example to how to control the mouse to "click and drag" (not just click and release). I want to move an object in front of the webcam and move maps on google earth. I hope someone underst

Re: Inserting '-' character in front of all numbers in a string

2007-03-30 Thread John Nagle
Paul McGuire wrote: > On Mar 30, 2:09 pm, Michael Bentley <[EMAIL PROTECTED]> wrote: > >>On Mar 30, 2007, at 10:38 AM, kevinliu23 wrote: >> >> >> >> >> >> >>>I want to be able to insert a '-' character in front of all numeric >>>values in a string. I want to insert the '-' character to use in >>>c

Newbie Question (real-time communication between apps: audio, 3d, PD, Blender)

2007-03-30 Thread gregorywieber
Hi All, I'm just beginning my exploration of Python and I have a rather general question. If two particular programs have Python scripting capabilities, does that mean those two programs can communicate in real time through Python? I'm running some audio experiments (for artistic purposes) in the

Re: Cheeseshop needs mirrors

2007-03-30 Thread John Nagle
Richard Jones wrote: > And of course I'll reiterate the same line I always do: the Cheese Shop was > set up by a volunteer, enhanced by some other volunteers and exactly > nothing more will get done unless more volunteers offer their time. Yup. That's why CPAN is so much better. Ook!

Re: Inserting '-' character in front of all numbers in a string

2007-03-30 Thread Michael Bentley
On Mar 30, 2007, at 4:41 PM, Paul McGuire wrote: > On Mar 30, 2:09 pm, Michael Bentley <[EMAIL PROTECTED]> wrote: >> On Mar 30, 2007, at 10:38 AM, kevinliu23 wrote: >> >> >> >> >> >>> I want to be able to insert a '-' character in front of all numeric >>> values in a string. I want to insert the

Re: [Pythonmac-SIG] MacPython wiki "moved" to Python wiki - now it's your turn...

2007-03-30 Thread Kevin Walzer
[EMAIL PROTECTED] wrote: > After much wailing and gnashing of teeth the past couple of days, I managed > to move (most of?) the content from the MacPython wiki to the main Python > wiki (*). All pages were created as subpages of > > http://wiki.python.or/moin/MacPython > > The motivation for

Re: Cheeseshop needs mirrors

2007-03-30 Thread Paul Boddie
Richard Jones wrote: > > And of course I'll reiterate the same line I always do: the Cheese Shop was > set up by a volunteer, enhanced by some other volunteers and exactly > nothing more will get done unless more volunteers offer their time. Sure. I wasn't criticising the Cheese Shop, though: it's

Re: Newbie Question (real-time communication between apps: audio, 3d, PD, Blender)

2007-03-30 Thread Grant Edwards
On 2007-03-30, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > I'm just beginning my exploration of Python and I have a rather > general question. If two particular programs have Python scripting > capabilities, does that mean those two programs can communicate in > real time through Python? No.

Re: Inserting '-' character in front of all numbers in a string

2007-03-30 Thread Michael Bentley
On Mar 30, 2007, at 5:42 PM, Michael Bentley wrote: > for i in yourstring.split(): > if i[0].isdigit(): > yourstring = yourstring.replace(i, '-%s' % (i,), 1) *OR* yourstring ' '.join(x[0].isdigit() and '-%s' % x or x for x in yourstring.split()) ;-) -- http://mail.pytho

Re: New to Python - Easy way to open a text file

2007-03-30 Thread Max Steel
Nope. that's not what i mean... Here's a quick run down: edna, is a python mp3 server. (.py) What it does is searches directories for: 1) mp3s 2) jpgs 3) mp3us 4) txt files 5) other folders What I'd like it to do, is upon finding a folder, with a .txt file in it (in my case is probably an albu

Py_DECREF/Py_INCREF as Functions?

2007-03-30 Thread Kevin D.Smith
I'm trying to use Python from another application that allows me to load functions from a DLL. While I have most of the API working, I have one big problem: Py_DECREF and PyINCREF are macros which I can't load from the Python DLL. Since I can't decref any objects, I'm leaking memory all over

Re: Indentation for code readability

2007-03-30 Thread Robert Kern
Steven D'Aprano wrote: > On Fri, 30 Mar 2007 02:04:45 -0700, DE wrote: > >> Hello, >> >> Here is what I do in C++ and can not right now in python : >> >> pushMatrix() >> { >> drawStuff(); >> >> pushMatrix(); >> { >> drawSomeOtherStuff() >> } >> popMatrix(); >>

Re: clean up html document created by Word

2007-03-30 Thread Claudio Grondi
jd wrote: > I am looking for python code (working or sample code) that can take an > html document created by Microsoft Word and clean it up (if you've > never had to look at a Word-generated html document, consider yourself > lucky ;-) Alternatively, if you know of a non-python solution, I'd > li

Re: Question about using cookielib in python 2.4

2007-03-30 Thread John J. Lee
[EMAIL PROTECTED] writes: > Hi, > I am following the example of Python cookbook (14.7) about using > cookielib in python2.4 > > cj = cookielib.LWPCookieJar() > // code to send out the request > print "Coookie-" > if cj is not None: > fo

Python-URL! - weekly Python news and links (Mar 30)

2007-03-30 Thread Cameron Laird
QOTW: "I have a fake supervisor reference generator for job interviews, a fake house inspection generator for real estate transactions, and a fake parole testimony generator - maybe you could adapt one of them (unfortunately, they are written in dissembler)." - Paul McGuire "... I think that [PyP

Web-based personal development co. looking for programmers

2007-03-30 Thread jconxus
Mylinia.com Live purposefully! Who: Mylinia.com is a personal development company located in the heart of the Silicon Valley, started in 2006 by 3 Stanford business school students who are dedicated to helping people all over the world reach their full potential. We envision a better world where

Re: very strange syntax errors

2007-03-30 Thread John J. Lee
hg <[EMAIL PROTECTED]> writes: > Hi, > > I'v been facing some very strange errors lately: > > one example: > > def __init__(self): > > import my_info > some_text = my_info.T_SOME_TEXT > ^ syntax error > > > I manage to get rid of that

Re: Remote XML Parsing

2007-03-30 Thread [EMAIL PROTECTED]
On Mar 30, 5:56 pm, Laurent Pointal <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] a écrit : > > > How can I parse a remote XML file with Python? > > And what will I be able to do with this XML file in Python? > > > Sorry if this is a noob-ish question. > > You can process XML data with Python as l

Re: clean up html document created by Word

2007-03-30 Thread jd
Wow, thanks for all the great responses! Here's my summary: - demoronizer (from John Walker) is designed to solve some very particular problems that could be considered bugs. However, it doesn't remove the unnecessary html generated by Word. http://www.fourmilab.ch/webtools/demoroniser/ - The

Re: Indentation for code readability

2007-03-30 Thread Steven D'Aprano
On Fri, 30 Mar 2007 18:32:02 -0500, Robert Kern wrote: >> Some people >> have a strange >> idea of >> "increase >> readability". > > Please contain the snark. You didn't understand why someone might want this, > and > that's fine. But please wait until you get a response befo

Re: I can't get multi-dimensional array to work...

2007-03-30 Thread Carsten Haese
On Fri, 2007-03-30 at 14:34 -0700, erikcw wrote: > On Mar 30, 5:23 pm, [EMAIL PROTECTED] wrote: > > I haven't tested it, but superficially I'd suggest giving this a try: > > > > def endElement(self, name): > > if name == 'row' : > > if not self.data.has_key(self.parent): > >

Re: Cheeseshop needs mirrors

2007-03-30 Thread Richard Jones
Paul Boddie wrote: > Richard Jones wrote: >> And of course I'll reiterate the same line I always do: the Cheese Shop >> was set up by a volunteer, enhanced by some other volunteers and exactly >> nothing more will get done unless more volunteers offer their time. > > Sure. I wasn't criticising the

loading a url using urllib2

2007-03-30 Thread [EMAIL PROTECTED]
I have the following code to load a url (address). When I have a url like this, http://www.testcom.co.uk/dev_12345/www.cnn.com i get an error "Failed to open http://www.testcom.co.uk/dev_12345/www.cnn.com";. Is there something wrong with my URL? or something wrong with my code? Thank you for an

how to remove specified cookie in cookie jar?

2007-03-30 Thread ken
How to remove specified cookie (via a given name) in cookie jar? I have the following code, but how can I remove a specified cookie in the cookie jar? cj = cookielib.LWPCookieJar() if cj is not None: if os.path.isfile(COOKIEFILE): print 'Loading Cookie--'

Re: Long way around UnicodeDecodeError, or 'ascii' codec can't decode byte

2007-03-30 Thread Oleg Parashchenko
Hello, On Mar 29, 4:53 pm, "Paul Boddie" <[EMAIL PROTECTED]> wrote: > On 29 Mar, 06:26, "Oleg Parashchenko" <[EMAIL PROTECTED]> wrote: > > > Hello, > > > I'm working on an unicode-aware application. I like to use "print" to > > debug programs, but in this case it was nightmare. The most popular >

Re: Newbie Question (real-time communication between apps: audio, 3d, PD, Blender)

2007-03-30 Thread Terry Reedy
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | Hi All, | | I'm just beginning my exploration of Python and I have a rather | general question. If two particular programs have Python scripting | capabilities, does that mean those two programs can communicate in | real time through P

Re: loading a url using urllib2

2007-03-30 Thread Kushal Kumaran
On Mar 31, 7:21 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > I have the following code to load a url (address). > > When I have a url like this, > > http://www.testcom.co.uk/dev_12345/www.cnn.com > > i get an error "Failed to openhttp://www.testcom.co.uk/dev_12345/www.cnn.com";. > Is there

Re: Hpw make lists that are easy to sort.

2007-03-30 Thread Paul Rubin
Anton Vredegoor <[EMAIL PROTECTED]> writes: > I want the product, but sorted in less time. If Fourier transforms can > help, I want them :-) Oh, I see what you mean. I don't see an obvious faster way to do it and I don't have the feeling that one necessarily exists. As someone mentioned, you cou

Re: Py_DECREF/Py_INCREF as Functions?

2007-03-30 Thread Gabriel Genellina
En Fri, 30 Mar 2007 20:21:53 -0300, Kevin D.Smith <[EMAIL PROTECTED]> escribió: > I'm trying to use Python from another application that allows me to > load functions from a DLL. While I have most of the API working, I > have one big problem: Py_DECREF and PyINCREF are macros which I can't > lo

Re: What are OOP's Jargons and Complexities

2007-03-30 Thread Arved Sandstrom
"Timofei Shatrov" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Fri, 30 Mar 2007 06:48:05 GMT, "Mike Schilling" > <[EMAIL PROTECTED]> > tried to confuse everyone with this message: > >>Xah Lee wrote: >> >>> So, a simple code like this in normal languages: > >>> becomes in Java:

Re: Modal value of an array

2007-03-30 Thread Paddy
On Mar 30, 10:17 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Thu, 29 Mar 2007 19:44:56 -0300, Paddy <[EMAIL PROTECTED]> > escribió: > > > On Mar 29, 8:49 am, [EMAIL PROTECTED] (Alex Martelli) wrote: > >> >>> foo = ["spam", "eggs", "spam", "spam", "spam", "beans", "eggs"] > >> >>> max(fo

Re: What are OOP's Jargons and Complexities

2007-03-30 Thread Arved Sandstrom
"Mike Schilling" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > bugbear wrote: >> Er. How about >> >> public class test { >> public static void main(String[] args) { >> String a = "a string"; >> String b = "another one"; >> StringBuffer c = a + b; > > String c (etc.),

Re: Newbie Question (real-time communication between apps: audio, 3d, PD, Blender)

2007-03-30 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Grant Edwards <[EMAIL PROTECTED]> wrote: >On 2007-03-30, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > >> I'm just beginning my exploration of Python and I have a rather >> general question. If two particular programs have Python scripting >> capabilities, does tha

Re: Game programming for kids: looking for open source 2D game development kit

2007-03-30 Thread Paul Rudin
John Salerno <[EMAIL PROTECTED]> writes: > Laurent Pointal wrote: > >> With Python: >> * pygame + build your drag'n drop features >> * if you like 3D, vpython. >> >> >> http://www.pygame.org/ >> http://www.vpython.org/ > > Wow, vpython looks pretty need. I'm messing around with it right now > and

<    1   2