Re: [Tutor] class methods as argument

2007-02-10 Thread thomas coopman
On Sat, 10 Feb 2007 22:10:52 +1000 Jonathan McManus [EMAIL PROTECTED] wrote: It's pretty easy to make this work, actually. The issue is in the doSomething method. class Foo(object): def method(self, arg): print arg def doSomething(object, func): object.func(test)

Re: [Tutor] class methods as argument

2007-02-10 Thread thomas coopman
On Sat, 10 Feb 2007 07:55:54 -0500 Kent Johnson [EMAIL PROTECTED] wrote: thomas coopman wrote: Hi, I want to do something like this, don't know how to properly explain it, so I just give you some example code class Foo(object): def method(self, arg): print arg

Re: [Tutor] class methods as argument

2007-02-10 Thread thomas coopman
On Sat, 10 Feb 2007 09:04:15 -0500 Kent Johnson [EMAIL PROTECTED] wrote: thomas coopman wrote: also, Is it better to use super in FooList? and how should I use it then? Actually I would say that FooList is not pulling its weight. SortedList already allows specialization by the compare

[Tutor] comparing almost equal strings

2007-02-08 Thread thomas coopman
Hi, I need a function that groups almost equal strings. It seems most easy to me, to do this with a hash function. So I would write a hash function like this: string = string.replace( , ).lower()[0:6] and then hash the string chars, but it should detect minor typo's, so words with one

Re: [Tutor] comparing almost equal strings

2007-02-08 Thread thomas coopman
Hi, On Thu, 08 Feb 2007 13:07:41 +0100 Christopher Arndt [EMAIL PROTECTED] wrote: thomas coopman schrieb: I need a function that groups almost equal strings. It seems most easy to me, to do this with a hash function. What do you mean be almost equal? By which criterium? Spelling

Re: [Tutor] Best IDE for Python

2007-01-26 Thread Mark Thomas
On 1/26/07, OkaMthembo [EMAIL PROTECTED] wrote: how useable is vim on Windows? Very! I've used Vim on Windows since the 5.3 version, it only gets better. Like Alan said there is a learning curve, but once you've got it there is no going back. i wish i could learn Unix. which distro do you

Re: [Tutor] import and unittest

2007-01-17 Thread thomas coopman
On Tue, 16 Jan 2007 10:06:37 - Alan Gauld [EMAIL PROTECTED] wrote: Thomas Coopman [EMAIL PROTECTED] wrote . I wondered if it was possible to do something like this: src/ -a_module/ -sub_module/ test/ -a_module/ -sub_module/ I don;t see any reason

Re: [Tutor] import and unittest

2007-01-17 Thread Thomas Coopman
On 1/17/07, Kent Johnson [EMAIL PROTECTED] wrote: thomas coopman wrote: On Tue, 16 Jan 2007 10:06:37 - Alan Gauld [EMAIL PROTECTED] wrote: Thomas Coopman [EMAIL PROTECTED] wrote . I wondered if it was possible to do something like this: src/ -a_module/ -sub_module/ test

Re: [Tutor] import and unittest

2007-01-17 Thread Thomas Coopman
On 1/17/07, Kent Johnson [EMAIL PROTECTED] wrote: Thomas Coopman wrote: Well I don't really need the circular imports but I would like to know how to do the imports correct. Suppose that in the example that I showed only One needs Two. So then we have this: M/ __init__.py A/ __init__

Re: [Tutor] import and unittest

2007-01-17 Thread Thomas Coopman
On 1/17/07, Kent Johnson [EMAIL PROTECTED] wrote: Thomas Coopman wrote: When I run One.py from in the directory A, doesn't look python in it's parent directory when it can't find the module? And if that's not the case where and what should I add to the sys.path variable? No, Python won't

[Tutor] import and unittest

2007-01-16 Thread Thomas Coopman
the code and the test dir is a complete copy of the src dir but with unittest instead of code. I have something like this but I don't know how to organize the imports in the tests and I don't know if this is a good idea. What do you think? Thanks -- Thomas Coopman [EMAIL PROTECTED

Re: [Tutor] import and unittest

2007-01-16 Thread thomas coopman
On Tue, 16 Jan 2007 10:06:37 - Alan Gauld [EMAIL PROTECTED] wrote: Thomas Coopman [EMAIL PROTECTED] wrote . I wondered if it was possible to do something like this: src/ -a_module/ -sub_module/ test/ -a_module/ -sub_module/ I don;t see any reason

Re: [Tutor] Problems with a Class

2007-01-13 Thread thomas coopman
. I hope this is what you mean. Thomas ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] Organizing 15500 records, how?

2006-12-12 Thread Thomas
of userid to field value. That way I'm dealing with 10 to 50 files instead of 15500. Also, I am inexperienced with using classes but eager to learn and wonder if they would be any help in this case. Any advise much appreciated and thanks in advance, Thomas

[Tutor] difflib.SequenceMatcher with get_matching_blocks is incorrect

2006-12-04 Thread Thomas
when the input strings get too long? Thanks in advance, Thomas ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] Read the builtin module source, also itchy ellipses.

2006-11-17 Thread Thomas
Hi, I sometimes find it useful to read the source code of a module and for example I can type string.__file__ to find the location of the string module. However the .__file__ method is not available for the module builtin. Is it possible to read the source code for built in functions and if so

[Tutor] A Million Sevens

2006-11-17 Thread Thomas
Earlier today I typed the following into my pythonwin interactive interpreter in windows xp: int('7' * 10 ** 6) I expected either an error message or it to get stuck and require me to stop the process manually. I read that unlike long integers in C, longs in python are only limited by the

[Tutor] property built-in

2006-10-19 Thread thomas
Hi, I was wondering some things about property. suppose I have a class like this: class A(object): def __init__(self, x, y): self.__x = x def x(): def get(self): return self.__x def set(self, x): self.__x = x #and some other code

[Tutor] extracting matches by paragraph

2006-10-11 Thread Thomas A. Schmitz
from my parapgraphs. What am I doing wrong? Or is the entire approach flawed? What alternative method would you suggest? Thanks for any help on this Thomas ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] extracting matches by paragraph

2006-10-11 Thread Thomas A. Schmitz
On Oct 11, 2006, at 2:48 PM, Kent Johnson wrote: Thomas A. Schmitz wrote: On Oct 11, 2006, at 12:06 PM, Kent Johnson wrote: I would take out the join in this, at least, and return a list of lines. You don't really have a paragraph, you have structured data. There is not need to throw away

Re: [Tutor] New Tutorial topic available

2006-02-26 Thread Mark Thomas
. -- _ ( ) Mark Thomas ASCII ribbon campaign X www.theswamp.org - against HTML email / \ ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] pyGtk using combobox

2006-02-10 Thread thomas
Hi, I would like to make a combobox with a list of strings, but I have many problems with it. I know how to make the combobox and how to add strings, but is it possible to get a list of strings from the combobox and also is it possible to update the combobox with a list of strings? (something

Re: [Tutor] (no subject)

2005-07-06 Thread Mark Thomas
On 7/6/05, Michael Huster [EMAIL PROTECTED] wrote: In python under windows, how can I create and access a file on the Desktop? The following do NOT work: How about... userp = os.getenv('USERPROFILE') + '\\Desktop\\MyFile.txt' fo = file(userp, 'w') -- _ ( ) Mark Thomas ASCII ribbon

Re: [Tutor] Simple string processing problem

2005-05-14 Thread Mark Thomas
SbayACCACGTCCAATCTACCGATATTGCTGCTATGCATTATAA -- _ ( ) Mark Thomas ASCII ribbon campaign X www.theswamp.org - against HTML email / \ ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Cryptography Toolkit

2005-04-01 Thread Mark Thomas
obj_xor = XOR.new(string) print obj_xor.decrypt(xored) Kent Excellent !! Many thanks Kent. -- _ ( ) Mark Thomas ASCII ribbon campaign X www.theswamp.org - against HTML email / \ ___ Tutor maillist - Tutor@python.org http://mail.python.org

Re: [Tutor] Cryptography Toolkit

2005-03-31 Thread Mark Thomas
but no cigar!! *grin* -- _ ( ) Mark Thomas ASCII ribbon campaign X www.theswamp.org - against HTML email / \ ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] updating Oracle tables via python

2005-03-29 Thread Williams, Thomas
Greetings, I am attempting to update an Oracle table using python. When I execute the code, the python script appears to hang, in that nothing else happens. As always, any assistance you can provide will be appreciated. Code: connection = cx_Oracle.connect(db/[EMAIL PROTECTED])

[Tutor] executing SAS and passing parameters

2005-02-09 Thread Williams, Thomas
Here is the code I am using to invoke SAS: import os import sys shell = os.environ.get('COMSPEC') if shell is None: shell = os.environ.get('SHELL') if shell is None: shell = 'an unknown command processor' print 'Running under', shell

[Tutor] executing SAS and passing parameters

2005-02-08 Thread Williams, Thomas
Greetings, I am trying to use python to run a SAS program by passing the needed parameters. I am able to start SAS, but unable to start the correct SAS program with its parameters. Any assistance you could provide will be appreciated. Tom Williams DSHS - Research and Data Analysis

RE: [Tutor] executing SAS and passing parameters

2005-02-08 Thread Williams, Thomas
, Tom -Original Message- From: Alan Gauld [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 08, 2005 1:57 PM To: Williams, Thomas; tutor@python.org Subject: Re: [Tutor] executing SAS and passing parameters I am trying to use python to run a SAS program by passing the needed parameters

[Tutor] XP and python 2.4, some progress

2005-01-08 Thread Jeffrey Thomas Peery
I wasnt able to get the IDLE started in windows XP. I had it working then I upgraded to 2.4, then it didnt work so I switched back to 2.3, still didnt work so Im back to 2.4. I did some looking around and I was able to get the IDLE started by setting the shortcut on my desktop to:

<    1   2