Does adding import statements in a DAT continually import?

If I have

import random

at the beginning of a text (or any other executing DAT) is the module imported every time that script is run?

If so, is there any way to prevent this?

Also, am I correct that once you import a module to the textport, it is imported for as long as your .toe is open? (I.e. you only need to re import if you close Touch?)

Use an if statement?

[code]random = false

if random == true:
import random[/code]

Not sure on the second question.

The import function imports the module every time the script is executed in every script it is called.

The module can be imported though once for any COMP by using extensions.

cheers
Keith

Thanks Keith,
But what extensions are you talking about?

From the wiki:

They^re super easy to use, the wiki has some good examples. I’ve never tried using an external python module as an extension though. I don’t think it is possible at the moment.

Here is the wiki link:

derivative.ca/wiki088/index. … Extensions