Problem with import

An code is given, which when run, the user must select certain options. When the user closes the window, it returns a list of the selected options, which I can write out. This works so far.
My problem is that I want to transfer this list by invitation in another code.

The structure of the code is as follows (it’s quite long, so I won’t write it all, but of course I’ll add it if necessary):

import modules
crete frame and canvas
create x[ ] list
def command when radiobutton selected
     add value selected radiobutton to x[ ] list
     deactivates the radiobutton
radiobutton creation with the defined command added


The end result is IDLE sell after closing the window:
[1, 10,18,5,9]