Error when using a function outside the Python script [closed]

1

I created a function that uses other functions that are not in the same script, while running the program encounters an error, stating that the function outside the script is not defined. Must all the functions to be used need to be in the same script?

    
asked by anonymous 16.09.2017 / 02:16

1 answer

0

No. You can simply leave the 2 scripts in the same directory, and in the one that you run, write in the first line "importOptonName" (without the quotation marks). For each other script that has functions that you wanted to use, you should do an import. Or you can do "import script1, script2, script3, ..., scriptN" (without quotes). Example:

import ScriptQueContemDistance, ScriptQueContemArea

#seu código aqui
    
17.09.2017 / 00:48