i have used
subprocess.Popen('afairesh.py', shell=True)
to open the module upon button click. Still,searching for the previous issue though
No, use an import. I can't see the code you currently have, so I can't help you with the NameError on root. Check what line the error is for. Check that root has either been defined by assignment in that part of the code, or passed as a parameter to the function or method that line of code is in.