Newbie - instanciating classes from other files

Peter Hansen peter at engcorp.com
Thu Sep 15 12:06:56 CEST 2005


comanighttrain at gmail.com wrote:
> Hey guys, i just started learning python (i usually use java/C).
> 
> this has got me stumped as its not mentioned in the documentation
> (unless im skimming it every time).
> 
> How does one instanciate a class from another file
> 
> i thought it would be
> -----------------------------------code---------------------------
> import file.py
> 
> thisFile = ClassName()
> -------------------------------not code---------------------------

It's clear you haven't worked through the tutorial.  It's short, easy, 
and educational, so why not save yourself from embarrassment and whip 
through it rather than trying to learn Python by guess-and-error?

-Peter



More information about the Python-list mailing list