Can module access global from __main__?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Neal Becker

    #1

    Can module access global from __main__?

    Suppose I have a main program, e.g., A.py. In A.py we have:

    X = 2
    import B

    Now B is a module B.py. In B, how can we access the value of X?


Working...