Sooraj
Sooraj

Reputation: 10567

How to make a simple GUI in python without using any tools such as Tkinter, Eclipse etc?

I'm making an app using python. I want a very simple user interface just to read a query. It should contain a text box where to type the query and a submit button. Can I make such an interface without using any drag and drop softwares, i.e just by using the code?

Upvotes: 2

Views: 21242

Answers (2)

user2555451
user2555451

Reputation:

Well, there isn't really anything to say other than: no, you can't.

Unlike some other languages, Python cannot do too much without importing modules/libraries.

Meaning, to make a user-interface of any kind, you must first import a GUI development library such as Tkinter, wxPython, etc.

Upvotes: 0

Deelaka
Deelaka

Reputation: 13693

Well simply you can't do that with pure python

BTW start with Tkinter as its more easy to learn than any other gui framework

Your expected code would look like in Tkinter:

import Tkinter as Tk

root = Tk.Tk()

def submit():
    print "entered text were " + entry.get()

entry = Tk.Entry(root)
entry.pack()
button = Tk.Button(root,text='submit',command=submit)
button.pack()

root.mainloop()

By the way Tkinter is open source so feel free to look how the module is made

Upvotes: 5

Related Questions