Gui Dissappearing

Post here if you need help with creating a Graphical User Interface in Python.

Gui Dissappearing

Postby stan » Tue Aug 23, 2016 7:58 pm

Hi, would anyone be able to help with this issue? When I run this file, the Gui shows up but instantly closes and calls the function that should only be called via the "Go" button. Sorry if this is a stupid question, I'm very new to python!

Code: Select all
#!/usr/bin/python
import Tkinter
import webbrowser
from Tkinter import *

top = Tkinter.Tk()

def eCOMSearch(eCOMSNum):
    URL = 'sample url' + eCOMSNum
    webbrowser.open(URL)

# Widgets
eCOMSLab = Label(top, text="e-COMS/Ticket Search:")
eCOMSLab.place(x=5, y=5)
eCOMSNum = Entry(top, bd=1)
eCOMSNum.place(x=7, y=30)
eCOMSBut = Button(top, text="Go", command = eCOMSearch(str(eCOMSNum)))
eCOMSBut.place(x=150, y=30)

top.mainloop()
Last edited by micseydel on Tue Aug 23, 2016 7:58 pm, edited 1 time in total.
Reason: Initial post lock.
stan
 
Posts: 2
Joined: Tue Aug 23, 2016 7:54 pm

Re: Gui Dissappearing

Postby stan » Tue Aug 23, 2016 9:14 pm

Ignore this post, I figured out the issue. Sorry, I should've done more research before submitting a new thread. (Lambda)
stan
 
Posts: 2
Joined: Tue Aug 23, 2016 7:54 pm


Return to GUI

Who is online

Users browsing this forum: No registered users and 2 guests