'Overwrite a variable name from an imported module in Python?

I have a file a that is comprised of modules that I have written. I would like to pass a variable name that ovewrites the existing variable in each of these modules.

file a has variable x

files b, c, and d are imported into file. Each of these modules has a predetermined variable x.

I'd like to establish the value of variable x in file a and pass it through files b,c,d.

I attempted to do all of this in one file.

variable = "x"

import file b
fileb.x

However the original value of variable x is being run that was already in file b



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source