Answers for "online python compiler for GUI"

11

python ide online

#1
https://www.onlinegdb.com/online_python_compiler
#2
https://repl.it/languages/python3
Posted by: Guest on November-01-2020
0

online python compiler for GUI

from tkinter import *

app = Tk()
app.title("Unit Converter")
scales = ["Meters","Inches","Foot"]

_from = StringVar()
from_menu = OptionMenu(app, _from, *scales)
from_menu.grid(row=0,colomn=0,pady=5)

lbl = Label(app,text = 'Convert to')
lbl.grid(row=0,colomn=1,pady=5)

to_ =StringVar()
to_menu = OptionMenu(app,to_,*scales)
to_menu.grid(row=0,colomn=2,pady=5)

enterLabel = Label(app,text='Enter your length')
enterLabel.grid(row=1,colomn=0,colomnspan=2,pady=5)

num1 = Entry(app)
num1.grid(row=1,colomn=2,colomnspan=2,pady=5)

## 1 Meter = 39.37 Inches
## 1 Meter = 3.28 Inches
## 1 Foot = 12 Inches

def converter():
    user_input_type = _from.get()
    convert_type = to_.get()
    user_input_number = num1.get()

    if user_input_type == 'Meters' and convert_type == 'Inches':
        converted_value = user_input_number * 39.37
    elif user_input_type == 'Meters' and convert_type == 'Foot':
        converted_value = user_input_number * 3.28
    elif user_input_type == 'Inches' and convert_type == 'Meters':
        converted_value = user_input_number / 39.37
    elif user_input_type == 'Foot' and convert_type == 'Inches':
        converted_value = user_input_number * 12
    elif user_input_type == 'Inches' and convert_type == 'Foot':
        converted_value = user_input_number / 12
    elif user_input_type == 'Foot' and convert_type == 'Meters':
        converted_value = user_input_number / 3.28
    else:
        converted_value = user_input_number

    output_number_label = Label(app,text = round(converted_value,2),width=10)
    output_number_label.grid(row=1,colomn=4,pady=5)


conversion_button = Button(app,text='convert',command='onverter')
conversion_button.grid(row='2',colomn='0',pady='5')

app.mainloop()
Posted by: Guest on October-10-2021
0

online python compiler for GUI

from tkinter import *
def calculate():
    temp = int(entry.get()) 
    temp = 9/5*temp+32
    output_label.configure(text = 'Converted: {:.1f}'.format(temp))
    entry.delete(0,END)

root = Tk()
message_label = Label(text='Enter a temperature', font=('Verdana', 16))
output_label = Label(font=('Verdana', 16))
entry = Entry(font=('Verdana', 16), width=4)
calc_button = Button(text='Ok', font=('Verdana', 16), command=calculate)
message_label.grid(row=0, column=0) 
entry.grid(row=0, column=1)
calc_button.grid(row=0, column=2) 
output_label.grid(row=1, column=0, columnspan=3)
mainloop()
Posted by: Guest on August-18-2021
0

online python compiler for GUI

from tkinter import *

app = Tk()
app.title("Unit Converter")
scales = ["Meters","Inches","Foot"]

_from = StringVar()
from_menu = OptionMenu(app, _from, *scales)
from_menu.grid(row=0,colomn=0,pady=5)

lbl = Label(app,text = 'Convert to')
lbl.grid(row=0,colomn=1,pady=5)

to_ =StringVar()
to_menu = OptionMenu(app,to_,*scales)
to_menu.grid(row=0,colomn=2,pady=5)

enterLabel = Label(app,text='Enter your length')
enterLabel.grid(row=1,colomn=0,colomnspan=2,pady=5)

num1 = Entry(app)
num1.grid(row=1,colomn=2,colomnspan=2,pady=5)

def converter():
    user_input_type = _from.get()
    convert_type = to_.get()
    user_input_number = num1.get()

    if user_input_type == 'Meters' and convert_type == 'Inches':
        converted_value = user_input_number * 39.37
    elif user_input_type == 'Meters' and convert_type == 'Foot':
        converted_value = user_input_number * 3.28
    elif user_input_type == 'Inches' and convert_type == 'Meters':
        converted_value = user_input_number / 39.37
    elif user_input_type == 'Foot' and convert_type == 'Inches':
        converted_value = user_input_number * 12
    elif user_input_type == 'Inches' and convert_type == 'Foot':
        converted_value = user_input_number / 12
    elif user_input_type == 'Foot' and convert_type == 'Meters':
        converted_value = user_input_number / 3.28
    else:
        converted_value = user_input_number

    output_number_label = Label(app,text = round(converted_value,2),width=10)
    output_number_label.grid(row=1,colomn=4,pady=5)


conversion_button = Button(app,text='convert',command='onverter')
conversion_button.grid(row='2',colomn='0',pady='5')

app.mainloop()
Posted by: Guest on October-10-2021
0

online python compiler for GUI

print(0)
Posted by: Guest on September-02-2021
0

online python compiler for GUI

from tkinter import *

app = Tk()
app.title("Unit Converter")
scales = ["Meters","Inches","Foot"]

_from = StringVar()
from_menu = OptionMenu(app, _from, *scales)
from_menu.grid(row=0,colomn=0,pady=5)

lbl = Label(app,text = 'Convert to')
lbl.grid(row=0,colomn=1,pady=5)

to_ =StringVar()
to_menu = OptionMenu(app,to_,*scales)
to_menu.grid(row=0,colomn=2,pady=5)

enterLabel = Label(app,text='Enter your length')
enterLabel.grid(row=1,colomn=0,colomnspan=2,pady=5)

num1 = Entry(app)
num1.grid(row=1,colomn=2,colomnspan=2,pady=5)

## 1 Meter = 39.37 Inches
## 1 Meter = 3.28 Inches
## 1 Foot = 12 Inches

def converter():
    user_input_type = _from.get()
    convert_type = to_.get()
    user_input_number = num1.get()

    if user_input_type == 'Meters' and convert_type == 'Inches':
        converted_value = user_input_number * 39.37
    elif user_input_type == 'Meters' and convert_type == 'Foot':
        converted_value = user_input_number * 3.28
    elif user_input_type == 'Inches' and convert_type == 'Meters':
        converted_value = user_input_number / 39.37
    elif user_input_type == 'Foot' and convert_type == 'Inches':
        converted_value = user_input_number * 12
    elif user_input_type == 'Inches' and convert_type == 'Foot':
        converted_value = user_input_number / 12
    elif user_input_type == 'Foot' and convert_type == 'Meters':
        converted_value = user_input_number / 3.28
    else:
        converted_value = user_input_number

    output_number_label = Label(app,text = round(converted_value,2),width=10)
    output_number_label.grid(row=1,colomn=4,pady=5)


conversion_button = Button(app,text='convert',command='onverter')
conversion_button.grid(row='2',colomn='0',pady='5')

app.mainloop()
Posted by: Guest on October-10-2021

Python Answers by Framework

Browse Popular Code Answers by Language