IDLE 1.1.2
import factor30
factor(109)
Traceback (most recent call last):
File pyshell#1, line 1, in -toplevel-
factor(109)
NameError: name 'factor' is not defined
factor0(109)
Traceback (most recent call last):
File pyshell#2, line 1, in -toplevel-
The problem here is that you need to reference the factor30 namespace to get to your functions:
Your calls to your functions would then look like:
factor30.factor(109)
factor30.factor0(109)
If you don't want to have to put the factor30 in front of all your function names you can do
From: Jason Massey
Date: 02/20/06 12:20:03
To: Kermit Rose
Cc: tutor@python.org
Subject: Re: [Tutor] import of source code still not working
If you don't want to have to put the factor30 in front of all your function names you can do this:from factor30 import *Which will put all of your
On 20/02/06, Kermit Rose [EMAIL PROTECTED] wrote:
From: Jason Massey
Date: 02/20/06 12:20:03
To: Kermit Rose
Cc: tutor@python.org
Subject: Re: [Tutor] import of source code still not working
If you don't want to have to put the factor30 in front of all your function names you can do
If you don't want to have to put the factor30 in front of all your
function
names you can do this:
from factor30 import *
But this is generally considered bad practice since the same function
name can appear in many modules so the last module imported will
hide all the others. The small