[Tutor] OO refactoring trial ??

2005-06-27 Thread Chinook
OO refactoring trial Following is a simple trial structure of a refactoring (top-down to OO) learning exercise I'm doing. Whether you call it a Factory pattern, COR pattern, or some hinze 57, I don't know what class to use till run time and I'm trying to avoid a lengthy "if

Re: [Tutor] super() and inherited attributes?

2005-06-27 Thread Brian van den Broek
Marcus Goldfish said unto the world upon 28/06/2005 00:58: > Hi, > > The following example doesn't work as I would like-- the child > instance doesn't expose the attribute set in the parent. Can someone > point out what I am missing? > > Thanks, > Marcus > > > class Parent(object): >def __

Re: [Tutor] Alternative File I/O for Tuples (fwd)

2005-06-27 Thread Don Parris
On Sun, 26 Jun 2005 16:32:08 -0400 Kent Johnson <[EMAIL PROTECTED]> wrote: > > From: Don Parris <[EMAIL PROTECTED]> > > To: Danny Yoo <[EMAIL PROTECTED]> > > Subject: Re: [Tutor] Alternative File I/O for Tuples > > > > I guess I'm asking two closely-related questions: > > (1) how to format the fi

[Tutor] super() and inherited attributes?

2005-06-27 Thread Marcus Goldfish
Hi, The following example doesn't work as I would like-- the child instance doesn't expose the attribute set in the parent. Can someone point out what I am missing? Thanks, Marcus class Parent(object): def __init__(self, name="I am a parent"): self.name = name class Child(Parent):

Re: [Tutor] Alternative File I/O for Tuples (fwd)

2005-06-27 Thread Don Parris
On Sun, 26 Jun 2005 16:32:08 -0400 Kent Johnson <[EMAIL PROTECTED]> wrote: > > From: Don Parris <[EMAIL PROTECTED]> > > To: Danny Yoo <[EMAIL PROTECTED]> > > Subject: Re: [Tutor] Alternative File I/O for Tuples > > > > I guess I'm asking two closely-related questions: > > (1) how to format the fi

Re: [Tutor] CGI Tutorial

2005-06-27 Thread Danny Yoo
On Mon, 27 Jun 2005, Gooch, John wrote: > Are there any tutorials on the Python CGI module? I think I found enough > fragments to get form data, but I need a way for the Python script to > tell whether it is being run in a web server environment or from the > command line. > What I am thinking

[Tutor] CGI Tutorial

2005-06-27 Thread Gooch, John
Are there any tutorials on the Python CGI module? I think I found enough fragments to get form data, but I need a way for the Python script to tell whether it is being run in a web server environment or from the command line. What I am thinking is testing for an environment variable that only exist

Re: [Tutor] Windows user variable ?

2005-06-27 Thread Dave S
Thanks for your help guys Dave ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] How to send an array of clusters from python to labview??

2005-06-27 Thread Danny Yoo
On Mon, 27 Jun 2005, john taylor wrote: > i am using win32com to call labview from python over COM. i want to set > the value of a control element in a VI per SetControlValue(), and the > control in the VI is an array of cluster, which has the structure > (integer, integer, string). > > >>> aoc

Re: [Tutor] Improving printouts from IDLE

2005-06-27 Thread Danny Yoo
On Mon, 27 Jun 2005, Richard Lyons wrote: > What is the specific code that allows the IDLE window to be printed to > notepad (in Windows XP)? Hi Richard, The relevant code that does the "Print Window" command lives in the IOBinding submodule of IDLE, within the print_window() method: http://c

[Tutor] Help - im a beinner in using python (fwd)

2005-06-27 Thread Danny Yoo
[I am forwarding this to the main Tutor list. Enas, if you're not subscribed already to the Tutor list, visit: http://mail.python.org/mailman/listinfo/tutor Once you're subscribed, you can freely post questions to the Python-tutor mailing list at the email address 'tutor@python.org'.]

Re: [Tutor] Windows user variable ?

2005-06-27 Thread Smith, Jeff
I would personally suggest using getpass.getuser() for maximum portability. Jeff -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: Sunday, June 26, 2005 6:16 PM To: tutor@python.org Subject: Re: [Tutor] Windows user variable ? Qu

[Tutor] How to send an array of clusters from python to labview??

2005-06-27 Thread john taylor
hi all, i am using win32com to call labview from python over COM. i want to set the value of a control element in a VI per SetControlValue(), and the control in the VI is an array of cluster, which has the structure (integer, integer, string). CODE: ... >>> aoc = ((2,3,"hello"), (4,5,"world"))

Re: [Tutor] Improving printouts from IDLE

2005-06-27 Thread Richard Lyons
Given the difficulties that I've found trying to print from Python, I was just commenting this week-end on the efficiency of the printing process used in IDLE. What is the specific code that allows the IDLE window to be printed to notepad (in Windows XP)? __

Re: [Tutor] Improving printouts from IDLE

2005-06-27 Thread Alan Gauld
> The printing facility provided with IDLE is rather rudimentary. Is there > any way of obtaining better quality printouts from IDLE? Specifically what would you like to 'improve'? Do you mean sopmething like the HTML output of vim or the pretty printer of emacs or pythonwin? IDLE just sends the