Importing Definitions

Ethan Furman ethan at stoneleaf.us
Thu Sep 5 08:56:41 EDT 2013


On 09/05/2013 05:39 AM, Azureaus wrote:
>
> This will throw an error saying "global name 'A' is not defined."

In Python, "global" really means "module-level".


> Now I know if there was a method I wanted to reference I could do something like this in module2.
> from module1 import method1
>
> which would mean from that point on I could just reference it as method1 rather than module1.method1, is there such a way I could do this with definitions??

from module1 import data1

--
~Ethan~



More information about the Python-list mailing list