[Tutor] Classes . . .

Bill Mill bill.mill at gmail.com
Wed Nov 3 06:12:38 CET 2004


Orri,

Why do you import random into the file containing the UI? Why don't
you just not import it there?

Peace
Bill Mill
bill.mill at gmail.com


On Wed, 3 Nov 2004 00:06:07 EST, dragonfirebane at aol.com
<dragonfirebane at aol.com> wrote:
>  
> Hello all, 
>   
> I was just wondering if it was possible, within a class, to import a module
> without importing it in every method.  I'm trying to write an OOP for
> tictactoe that uses random to select the computer's move when no obvious
> moves are available, and since I separated the program into two files, one
> for user interface, the other for the actual work, importing random in the
> user interface doesn't do squat, nor does importing it before the __init__
> of the class, or within it . . . any ideas? 
>   
> Thanks in advance, 
> Orri 
>   
>   
> Email: dragonfirebane at aol.com
> AIM: singingxduck
> Programming Python for the fun of it. 
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor
> 
> 
>


More information about the Tutor mailing list