enough try to communicate with passed-in arguments and return values instead six months from nowboth you and your coworkers may be happy you did program designminimize cross-file changes here' another scope-related design issuealthough we can change variables in another file directlywe usually shouldn' module files were introduced in and are covered in more depth in the next part of this book to illustrate their relationship to scopesconsider these two module filesfirst py this code doesn' know about second py second py import first print(first xfirst okreferences name in another file but changing it can be too subtle and implicit the first defines variable xwhich the second prints and then changes by assignment notice that we must import the first module into the second file to get to its variable at all--as we've learnedeach module is self-contained namespace (package of variables)and we must import one module to see inside it from another that' the main point about modulesby segregating variables on per-file basisthey avoid name collisions across filesin much the same way that local variables avoid name clashes across functions reallythoughin terms of this topicthe global scope of module file becomes the attribute namespace of the module object once it is imported--importers automatically have access to all of the file' global variablesbecause file' global scope morphs into an object' attribute namespace when it is imported after importing the first modulethe second module prints its variable and then assigns it new value referencing the module' variable to print it is fine--this is how modules are linked together into larger system normally the problem with the assignment to first xhoweveris that it is far too implicitwhoever' charged with maintaining or reusing the first module probably has no clue that some arbitrarily far-removed module on the import chain can change out from under him or her at runtime in factthe multithreading runs function calls in parallel with the rest of the program and is supported by python' standard library modules _threadthreadingand queue (threadthreadingand queue in python xbecause all threaded functions run in the same processglobal scopes often serve as one form of shared memory between them (threads may share both names in global scopesas well as objects in process' memory spacethreading is commonly used for long-running tasks in guisto implement nonblocking operations in general and to maximize cpu capacity it is also beyond this book' scopesee the python library manualas well as the follow-up texts listed in the preface (such as 'reilly' programming python)for more details the global statement