Small UI development Program using Python :
When a new person joined in a project, The person needs basic information regarding the project.
__author__ = "Narendra Boyina"
# Python version 3.5.2
import os
from tkinter import *
#from docx import *
w = Tk()
w.title("Laird project")
w.geometry("600x600+200+100")
n = 'Times New Roman',12,'italic'
def Ofileopen():
os.system("notepad {0}".format(r'D:\waste\Fleet STEL.txt'))
#give the path where the file is located (raw input)
def Ffileopen():
os.system("notepad {0}".format(r'D:\waste\Fleet STEL.txt'))
def Tfileopen():
os.system("notepad {0}".format(r'D:\waste\TR100STEL.txt'))
def Afileopen():
os.system("notepad {0}".format(r'D:\waste\TR100STEL.txt'))
## f = open('D:\\waste\\TR100STEL.txt','r')
## Label(text=f.read(),font=(n)).pack()
def mmm():
a= v.get()
if(a == 1):
a1=Tk()
a1.title("Orion")
Label(a1,text='Wlcome to Orion device').pack()
button = Button(a1,text='Open File',width=30, command =Ofileopen).pack()
elif(a == 2):
a2=Tk()
a2.title("Fleet")
button = Button(a2,text='Open File',width=30, command =Ffileopen).pack()
elif(a == 3):
a3=Tk()
a3.title("TR100")
Label(a3,text='Wlcome to TR100 device').pack()
button = Button(a3,text='Open STEL File',width=30, command =Tfileopen).pack()
button = Button(a3,text='Open API File',width=30, command =Afileopen).pack()
mymenu = Menu()# object created to holds horizontal list
listone = Menu() #This object is for holding list of File commands(New File, Open Save Exit)
listone.add_command(label='Overview of the Project')
##listone.add_command(label='Open File')
##listone.add_command(label='Save File')
##listone.add_command(label='Exit')
listtwo = Menu() # This object is for holding list of project members
listtwo.add_command(label='Ravi Naga kumar')
listtwo.add_command(label='Kumar Akshat')
listtwo.add_command(label='Sivaram Prasad')
listtwo.add_command(label='Vidya Sagar')
listtwo.add_command(label='Narendra')
listthree = Menu() # This object is for holding list of Softwares & software tools
listthree.add_command(label='Renesas_Flash_Programmer')
listthree.add_command(label='FleetBootMonitor')
listthree.add_command(label='--------------')
listthree.add_command(label='DevSuite')
listthree.add_command(label='Bugzilla')
listfour = Menu() # This object is for holding list of Hardware Tools
listfour.add_command(label='Gryphon Simulator')
listfour.add_command(label='RFchamber')
listfour.add_command(label='Lab Sat Simulator')
listfour.add_command(label='RPS')
listfive = Menu() # This object is for holding list of contact info
listfive.add_command(label='Ravi-9945324200')
listfive.add_command(label='Siva-9951421342')
listfive.add_command(label='Akshat-9722525280')
listfive.add_command(label='Sagar-9448547552')
listfive.add_command(label='Narendra-9700422902')
mymenu.add_cascade(label="Home",menu=listone,)
mymenu.add_cascade(label="Project members",menu=listtwo)
mymenu.add_cascade(label="Softwares & S/W Tools",menu=listthree)
mymenu.add_cascade(label="H/W Tools",menu=listfour)
mymenu.add_cascade(label="Contact info",menu=listfive)
mymenu.add_cascade(label="Help")
w.config(menu =mymenu) # myGui object is the window( We are adding/ configuring menu items)
v=IntVar()
v.set(2)
Devices = [("Orion",1),("Fleet",2),("TR100",3)]
Label(w,text='Choose the device for STEL Document',padx=20).pack(anchor=W)
for txt,val in Devices:
Radiobutton(w,text=txt,padx=40,indicatoron=0,variable=v,command=mmm,value=val).pack(anchor=W)
w.mainloop()
No comments:
Post a Comment