Forgetting an import

kyosohma at gmail.com kyosohma at gmail.com
Tue Jun 12 13:21:05 EDT 2007


On Jun 12, 11:36 am, HMS Surprise <j... at datavoiceint.com> wrote:
> I imported a set of functions from a file I wrote to interpreter
> shell:
>
> from myFile import *
>
> Now if I change functions in this file how can I make python forget it
> so I can force a fresh import?
>
> thanx,
>
> jh

If you did an import FunctionName, then you could use the "reload"
built-in. Otherwise, I think you'll just have to restart the shell.

<code>
import FunctionName
# do something
# reload FunctionName after editing it
reload(FunctionName)
</code>

Mike




More information about the Python-list mailing list