Oct-17-2018, 04:57 AM
(Oct-17-2018, 02:24 AM)Skaperen Wrote: there are three files.So you need to change the title of this thread, because there is no global namespace in your sense. There is a global namespace at file scope, but three files define three global namespaces. You can exchange data between the functions by sharing a common object in these namespaces, for example
# haad.py common = type('Common', (), {})() common.a = 1 common.b = 2and
# ien.py from __main__ import common def ien(): common.c = 3 common.d = 4