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

2009-04-08 Thread MooMaster
On Apr 7, 12:40 am, Peter Otten <__pete...@web.de> wrote: > 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

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

2009-04-08 Thread MooMaster
On Apr 6, 10:43 pm, 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'

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

2009-04-06 Thread MooMaster
A similar discussion has already occurred, over 4 years ago: http://groups.google.com/group/comp.lang.python/browse_thread/thread/b806ada0732643d/5dff55826a199928?lnk=gst&q=list+in+place#5dff55826a199928 Nevertheless, I have a use-case where such a discussion comes up. For my data mining class I'm

We have string.isdigit(), why not string.isNumber()?

2008-04-30 Thread MooMaster
N00b question alert! I did a search for isdigit() in the group discussion, and it didn't look like the question had been asked in the first 2 pages, so sorry if it was... The manual documentation says: "isdigit( ) Return true if all characters in the string are digits and there is at least one ch

Re: Inheritance issue...

2008-03-03 Thread MooMaster
On Mar 3, 11:49 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > MooMaster schrieb: > > > I'm trying to use inheritance to create a simple binary tree, but it's > > not going so well... here's what I pull from the documentation for > > s

Inheritance issue...

2008-03-03 Thread MooMaster
I'm trying to use inheritance to create a simple binary tree, but it's not going so well... here's what I pull from the documentation for super() "super( type[, object-or-type]) Return the superclass of type. If the second argument is omitted the super object returned is unbound. If the second arg

Color Segmentation w/ PIL?

2007-03-22 Thread MooMaster
I'm trying to write a Digital Image Processing program using the PIL library, and upon consultation of the Handbook I see that it seems to have built in functions to run Edge Detection (in the ImageFilter module), but I don't see anything about Segmentation. Are there any built-in tools to do this

Re: decimal and context objects!

2007-03-02 Thread MooMaster
On Mar 2, 3:08 am, "MooMaster" <[EMAIL PROTECTED]> wrote: > Hey guys, I'm trying to do some black magic voodoo and it's a little > late, so forgive me if this question seems obvious or has been asked > before. I tried doing a search on context objects and did

decimal and context objects!

2007-03-02 Thread MooMaster
Hey guys, I'm trying to do some black magic voodoo and it's a little late, so forgive me if this question seems obvious or has been asked before. I tried doing a search on context objects and didn't find anything that popped out, and I'm too tired to keep digging. I'm making a little program that

Regex help...pretty please?

2006-08-23 Thread MooMaster
I'm trying to develop a little script that does some string manipulation. I have some few hundred strings that currently look like this: cond(a,b,c) and I want them to look like this: cond(c,a,b) but it gets a little more complicated because the conds themselves may have conds within, like the

Re: Having problems with reading file in Python CGI

2006-06-26 Thread MooMaster
I haven't tried to use the CGI class for any CGI scripting, so I'm no expert...but I am familiar with file objects. You want to return the next line in the file object? Your loop will run until it hits the EOF, at which point it'll break...once you hit that, there is *no* next line. But it looks t

Re: cx_Oracle string problems...

2006-02-13 Thread MooMaster
Lol, that was a copy paste error into the post on my part...but the problem has been fixed. Turns out that there was a string.replace call somewhere else in the code that replaced all single quotes with empty strings, which thus caused the singe quotes to disappear! Whoops! Thanks for the look, th

cx_Oracle string problems...

2006-02-13 Thread MooMaster
After some google searching on the forum I couldn't find any topics that seemed to relate exactly to my problem, so hopefully someone can help me out... I'm running python 2.4.1 on a local Win2K system and doing some work-related development on an AIX box, and I'm running into a problem using cx_O

Re: parse data

2005-11-09 Thread MooMaster
If you know the indices of where the data should be in your string, you can use substrings... ie: >>> stringy = " Happy Happy Cow, 50, 1234 Your Mom's House AllTheTime,USA " >>> stringy[0:16] ' Happy Happy Cow' If the data isn't set all the time (for example, and address doesn't have a mandatory

Re: parse data

2005-11-09 Thread MooMaster
If you know the indices of where the data should be in your string, you can use substrings... ie: >>> stringy = " Happy Happy Cow, 50, 1234 Your Mom's House AllTheTime,USA " >>> stringy[0:16] ' Happy Happy Cow' If the data isn't set all the time (for example, and address doesn't have a mandatory

Re: Need to interrupt to check for mouse movement

2005-07-20 Thread MooMaster
Have you tried binding EVT_MOTION(func) to your window? -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie - chapter 19 in "How to think like a CS in python"

2005-07-20 Thread MooMaster
Well, being a lowly CS student myself this sounded like fun, so I went ahead and took the challenge. The first thing you have to consider is how to add the new element to the list. Obviously you have to iterate through the list, find the first element that the new one is greater than, and insert th

linking GUI apps using different Toolkits...possible?

2005-07-14 Thread MooMaster
This is more of a wxPython centric question, but not seeing reference to this on the wx group I thought I'd try here since many here also use wxPython toolkit. I started learning GUI development with Tkinter, and developed a few screens as part of an application I'm building with it. I've recently

Re: multiple checkboxes highlighted when one clicked = not good

2005-07-05 Thread MooMaster
UhmI'm a dunce. Obviously having it only use t[0] is going to make it cleverly look like I'm using different variables, when in fact I'm not. Thanks James! -- http://mail.python.org/mailman/listinfo/python-list

Re: multiple checkboxes highlighted when one clicked = not good

2005-07-05 Thread MooMaster
UhmI'm a dunce. Thanks James! -- http://mail.python.org/mailman/listinfo/python-list

Re: multiple checkboxes highlighted when one clicked = not good

2005-07-05 Thread MooMaster
right, I'm basically drawing a table with 3 columns, and I want checkboxes when we are at column 0. In columns 1-3 I will want Entries and Labels, but I always want checkboxes @ column 0. -- http://mail.python.org/mailman/listinfo/python-list

multiple checkboxes highlighted when one clicked = not good

2005-07-05 Thread MooMaster
I've been reading Deitel's Introducing Python, and Fredrik Lundh's Introduction to Tkinter, trying to familiarize myself with Python and GUI design in Tk, and I've run into a puzzling problem. I'm trying to draw a column of 10 checkboxes, each with a separate variables and commands. The easy way to

Lost in a sea of documentation...can you point me in the right direction?

2005-06-30 Thread MooMaster
I'm a complete beginner in Python, but I've been fooling around with Java for a couple years, so I have decent programming experience... Anyway, I was sitting around playing with Python, when I thought to myself: "I know! I'd like to write a program that I can pass a path to (say: My Pictures) and