Re: Tkinter- Possibly a basic question

2008-07-30 Thread Russell Blau
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >I hate to do this, but I've thoroughly exhausted google search. Yes, > it's that pesky root window and I have tried withdraw to no avail. I'm > assuming this is because of the methods I'm using. I guess my question > is two-fold. > 1) Ho

Re: Regular expression help

2008-07-18 Thread Russell Blau
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I am new to Python, with a background in scientific computing. I'm > trying to write a script that will take a file with lines like > > c afrac=.7 mmom=0 sev=-9.56646 erep=0 etot=-11.020107 emad=-3.597647 > 3pv=0 > > extract the values

Re: 'if name is not None:' v. 'if name:'

2008-07-15 Thread Russell Blau
"Victor Noagbodji" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > Well that's exactly why I'm asking. Since None returns False in if > statements. Why do people use if name is not None: instead of simply > writing if not name? > Because '' is a string value that is treated as fal

Re: variable question

2008-07-09 Thread Russell Blau
"Support Desk" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I am trying to assign a variable using an if / else statement like so: > If condition1: > Variable = something > If condition2: > Variable = something else > Do stuff with variable. > > But the v

Re: How to find the first space?

2008-06-09 Thread Russell Blau
"Johny" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > How can I find the first space using regex? > > For example I have text > Text=' This is a sample ' Why do you need to use a regex? text = text.replace(" ", "") Russ -- http://mail.python.org/mailman/listinfo/python-list

Re: re

2008-06-04 Thread Russell Blau
"Diez B. Roggisch" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > David C. Ullrich schrieb: >> Say I want to replace 'disc' with 'disk', but only >> when 'disc' is a complete word (don't want to change >> 'discuss' to 'diskuss'.) The following seems almost >> right: >> >> [^a-zA-Z

Re: How do I make a copy of my class object?

2008-05-22 Thread Russell Blau
"Marlin Rowley" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I have a class object which has the usual data members and functions. > I'm trying to make a copy of this class (which includes wx.Bitmap objects) > but deepcopy() doesn't seem to work. How would I do this? Are you try

Re: simple question about Python list

2008-05-09 Thread Russell Blau
On May 9, 6:25 am, dmitrey <[EMAIL PROTECTED]> wrote: > Ok, I use Python 2.5 but I try my code to remain Python 2.4 and > (preferable) 2.3 compatible. > Are there other solutions? > D. > > On 9 ôÒÁ, 13:17, Paul Hankin <[EMAIL PROTECTED]> wrote: > > > On May 9, 11:04šam, dmitrey <[EMAIL PROTECTED]>

Reusing IDLE file editor

2008-05-09 Thread Russell Blau
I have a need for some simple text-editing capabilities in a Tkinter program, and it occurred to me that IDLE is a Tkinter app that already has what I need in its file editor windows. I thought it would be nice if I could just use one of those windows as a widget in my application, in place of

Python/Tkinter DLL conflicts on Windows

2007-12-26 Thread Russell Blau
I have some Tkinter programs that I run on two different machines. On Machine W, which runs Python 2.5.1 on Windows XP, these programs run fine. On Machine H, which runs Python 2.5.1 on Windows XP, however, the same programs crash regularly. The crashes are not Python exceptions, but rather a

Re: Python; jump to a concrete line

2007-12-20 Thread Russell Blau
"Horacius ReX" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi, sorry but after looking for information, I still did not get how, > when reading a text file in python, can one jump to a concrete line > and then read the different data (separated by spaces). In each line > there is

Tkinter weirdness on Windows

2007-12-15 Thread Russell Blau
I have some Tkinter programs that I run on two different machines. On Machine W, which runs Python 2.5.1 on Windows XP, these programs run just fine. On Machine H, which runs Python 2.5.1 on Windows XP, however, the same programs crash regularly. The crashes are not Python exceptions, but rat

Re: absolute removal of '\n' and the like

2006-02-10 Thread Russell Blau
"S Borg" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > If I have a string, what is the strongest way to assure the > removal of any line break characters? > > Line break characters must always be the last character in a line, so > would > this:str = linestring[:-1] > > work?

Re: Pickle, __init__, and classes

2005-08-02 Thread Russell Blau
"Yin" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I've created a class that reads in and processes a file in the > initializer __init__. The processing is fairly substantial, and thus, > instead of processing the file every time the object is created, I > pickle the object to a f

Re: How would you program this?

2005-03-03 Thread Russell Blau
"Dennis Lee Bieber" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Wed, 2 Mar 2005 13:44:07 -0500, "Russell Blau" <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > > > > > What you have is a set of 10

Re: rearrange text

2005-03-03 Thread Russell Blau
"Daniel Skinner" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > If I have the following text > > var = '1,2,3,4' > > and I want to use the comma as a field delimeter and rearrange the > fields to read > > '1,3,2,4' > > How would I accomplish this in python? Well, it kind of depends

Re: using Tkinter from IDLE

2005-03-03 Thread Russell Blau
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > How do I use Tkinter from IDLE? Tkinter can be used from IDLE attached > to python 2.2, IDLE 0.8. But I couldn't use from IDLE attached to > python 2.3, IDLE 1.0.3. When I execute the code below: > from Tkinter import * > root = Tk()

Re: How would you program this?

2005-03-02 Thread Russell Blau
"engsol" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > There is a number puzzle which appears in the daily paper. > Because I'm between Python projects, I thought it might be > fun to write a program to solve it20 minute job, max. > > On closer inspection, it became apparent tha

Re: Questions about mathematical signs...

2005-02-07 Thread Russell Blau
"Dan Bishop" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Jeff Epler wrote: > > On Sun, Feb 06, 2005 at 12:26:30PM -0800, administrata wrote: > > > Hi! I'm programming maths programs. > > > And I got some questions about mathematical signs. > ... > > > 2. Inputing fractions like (a

Re: pythonic equivalent of Mathematica's FixedPoint function

2005-02-01 Thread Russell Blau
"jelle" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > doh... > > https://sourceforge.net/projects/fixedpoint > > pardon me > I don't think that Tim's FixedPoint class is doing the same thing as Mathematica's FixedPoint function (or even anything remotely similar). Well, except for

Re: More baby squeaking - iterators in a class

2004-12-30 Thread Russell Blau
"Bulba!" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hello Mr Everyone, > > From: > http://docs.python.org/tut/node11.html#SECTION001190 > > "Define a __iter__() method which returns an object with a next() > method. If the class defines next(), then __iter__() can

Re: How do I do this? (eval() on the left hand side)

2004-12-07 Thread Russell Blau
"It's me" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > In REXX, for instance, one can do a: > > interpret y' = 4' > > Since y contains a, then the above statement amongs to: > > a = 4 > > There are many situations where this is useful. For instance, you might be > getti