Newbie: need help with control loop

Terry Reedy tjreedy at udel.edu
Wed Dec 15 00:45:06 EST 1999


In article <3854d1ca.327680172 at news-server>, 
nospam.python at scoobysnacks.com says...
>
>On 13 Dec 1999 05:49:18 GMT, tjreedy at udel.edu (Terry Reedy) wrote:
>
>>In article <38543b80.289200819 at news-server>, 
>>nospam.python at scoobysnacks.com says...
>>>

>>You should probable create instance next:
>>  host_inst = class_name(machine)
>
>This was my whole question.  Where or what is host_inst.  In each case
>it will be different I can create the object, I just can't name it.

If, as per my suggestion, machine is bound to the name of the host, then 
the class __init__(self, machine) function should save the name.  This 
is another reason to iterate over the names instead of the indexes.  You 
might need to reread tutorial and ref on class and instances.

PS. Sorry for assuming that nospam... was fake.  Clever, given that 
spambots will usually remove it.




More information about the Python-list mailing list