OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Error: _tkinter.TclError: can't invoke "wm" command: application has been destroyed

  • Thread starter Thread starter WEshruth
  • Start date Start date
W

WEshruth

Guest
I have three classes on three different files, to get User inputs through GUI

Code:
#file1
class GetInfo1():
    def getInfo1():
        #my code
        return info1
#file2
 class GetInfo2():
    def getInfo2():
        #my code
        return info2
 #file3
 class GetInfo3():
    def getInfo3():
        #my code
        return info3

calling these methods from different file Getinformation.py that file would be

Code:
from GetInfo1 import *
from GetInfo2 import *
from GetInfo3 import *

object1 = GetInfo1()
getInfor1 = object1.getInfo1()
print getInfor1

object2 = GetInfo2()
getInfor2 = object2.getInfo2()
print getInfor2

object3 = GetInfo3()
getInfor3 = object3.getInfo3()
print getInfor3

Classes are as follows:

Code:
from Tkinter import *

root = Tk()
app = Frame(root)

entry = Entry(app)
entry.grid()


class GetInfo1():

def OnClick(self):
    global input1
    input1 = entry.get()
    #print ("You have entered %s"%input1)
    root.destroy()
    return input1

def getInfo1(self):

    '''Window'''
    global input1
    root.title("Input Permutation Range ")
    root.geometry("300x200")
    app.grid()
    label = Label (app, text="Please Enter the propogation range ( 2 - 4)")
    label.grid()

    '''Button'''
    Object2 = AskPermutationRange()
    button = Button (app, text="Submit", command=Object2.OnClick)
    button.grid()
    root.focus_set()
    root.mainloop()
    return input1

Getting getInfor1, getInfor2 as specified but while running third object getting error _tkinter.TclError: can't invoke "wm" command: application has been destroyed How can i re invoke app again. thanks in advance
<p>I have three classes on three different files, to get User inputs through GUI</p>

<pre><code>#file1
class GetInfo1():
def getInfo1():
#my code
return info1
#file2
class GetInfo2():
def getInfo2():
#my code
return info2
#file3
class GetInfo3():
def getInfo3():
#my code
return info3
</code></pre>

<p>calling these methods from different file <code>Getinformation.py</code>
that file would be</p>

<pre><code>from GetInfo1 import *
from GetInfo2 import *
from GetInfo3 import *

object1 = GetInfo1()
getInfor1 = object1.getInfo1()
print getInfor1

object2 = GetInfo2()
getInfor2 = object2.getInfo2()
print getInfor2

object3 = GetInfo3()
getInfor3 = object3.getInfo3()
print getInfor3
</code></pre>

<p>Classes are as follows:</p>

<pre><code>from Tkinter import *

root = Tk()
app = Frame(root)

entry = Entry(app)
entry.grid()


class GetInfo1():

def OnClick(self):
global input1
input1 = entry.get()
#print ("You have entered %s"%input1)
root.destroy()
return input1

def getInfo1(self):

'''Window'''
global input1
root.title("Input Permutation Range ")
root.geometry("300x200")
app.grid()
label = Label (app, text="Please Enter the propogation range ( 2 - 4)")
label.grid()

'''Button'''
Object2 = AskPermutationRange()
button = Button (app, text="Submit", command=Object2.OnClick)
button.grid()
root.focus_set()
root.mainloop()
return input1
</code></pre>

<p>Getting <code>getInfor1</code>, <code>getInfor2</code> as specified but
while running third object getting error
<code>_tkinter.TclError: can't invoke "wm" command: application has been destroyed</code>
How can i re invoke app again. thanks in advance</p>
 

Latest posts

D
Replies
0
Views
1
Dhanushka Amarakoon
D
S
Replies
0
Views
1
Shikhar Ambashta
S
Top