# Linking a tkinter GUI objects to another script

**URL:** <https://discuss.python.org/t/linking-a-tkinter-gui-objects-to-another-script/9782>\
**Category:** Python Help\
**Tags:** help\
**Created:** [July 21, 2021, 3:59am UTC](https://discuss.python.org/t/linking-a-tkinter-gui-objects-to-another-script/9782 "2021-07-21T03:59:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![code\_squad](https://avatars.discourse-cdn.com/v4/letter/c/d78d45/32.png) [@code\_squad](https://discuss.python.org/u/code_squad)\
**Post date:** [July 21, 2021, 3:59am UTC](https://discuss.python.org/t/linking-a-tkinter-gui-objects-to-another-script/9782/1 "2021-07-21T03:59:30Z")

</div>

Hi,

I am new to this forum, thanks for helping in advance!  
I have a basic knowledge of Python. I have made a GUI in tkinter and it has a few buttons. I would like to call (using uigetfile), select (using uigetfile), and run another python file from that GUI. I haven’t done the run part yet (because there is where I am confused about how to proceed). Running just a plain Python script using os.system(‘new\_script.py’) works but I want my new script to change the status of the buttons in my GUI during the execution. I don’t understand how to call the buttons of the old script (which is GUI) in the new\_script. It would be great if someone could help me out here by giving me a small code segment that can help me proceed.

So, in other words, I want my old\_script to call and run a new\_script which would again call out callback functions of old\_script to change the status of buttons during the execution. Not only that, but I also will want to pass on the device handles to the new script so that the devices talking to old\_script can now talk to new\_script and then pass them back to old\_script after the complete execution of the new\_script.

Please let me know.
