[Tutor] Classes . . .

Kent Johnson kent_johnson at skillsoft.com
Wed Nov 3 20:21:37 CET 2004


Put the import at the top of each file that uses functions from the module.

Kent

At 12:06 AM 11/3/2004 -0500, 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