Make a very simple conventer program(GUI) with python and Tkinter

By @amjaed3/8/2018python

HI friends, we meet again...tonight i wanna show you how to make simple converter from ASSCI To Hexadecimal or vice versa

ok. let's get stated...

first and foremost, import Tkinter

from Tkinter import *

And then we create some variables to this program

master        = Tk()
u_input       = StringVar()
output        = StringVar()

The Main program is here :

def asscitohex():
    ok = u_input.get()
    ok2 = ok.encode('hex')
    output.set(ok2)

def hextoassci():
    ok = u_input.get()
    ok2 = ok.strip().decode('hex')
    output.set(ok2)

it's The GUI program

Label(master, text='CONVERTER').pack()
Entry(master, textvariable=u_input, justify=CENTER).pack()
Label(master, textvariable=output, bg='white', width=20).pack()
Button(master, text="Assci to Hex", command=asscitohex).pack(side=LEFT)
Button(master, text="Hex to Assci", command=hextoassci).pack(side=LEFT)

don't forget to add mainloop function in the end to make it run
And then run it as usual

Here is the complete program

from Tkinter import *


master        = Tk()
u_input       = StringVar()
output        = StringVar()

def asscitohex():
    ok = u_input.get()
    ok2 = ok.encode('hex')
    output.set(ok2)

def hextoassci():
    ok = u_input.get()
    ok2 = ok.strip().decode('hex')
    output.set(ok2)

Label(master, text='CONVERTER').pack()
Entry(master, textvariable=u_input, justify=CENTER).pack()
Label(master, textvariable=output, bg='white', width=20).pack()
Button(master, text="Assci to Hex", command=asscitohex).pack(side=LEFT)
Button(master, text="Hex to Assci", command=hextoassci).pack(side=LEFT)


Make a very simple conventer program(GUI) with python and Tkinter

mainloop()

```
That's all..

#If you have any Question, feel free to Ask ... ^_^

comments