Simple sales tool creation with Python GUI: Quote creation

Simple sales tool creation with Python GUI: Quote creation

Created as a simple rough estimate submission. The sloppy code is too long and will be fixed in the future. We are planning to try PDF conversion in the future.

import tkinter as tk
 
def callBackFunc():
    global a
    global a1
    a=str('Product 1')
    a1=10000000
def callBackFunc1():
    global a,a1
    a=str('Product 2')
    a1=20000000
def callBackFunc2():
    global a,a1
    a=str('Product 3')
    a1=8000000
def callBackFunc3():
    global b,b1
    b=str('2 wavelengths')
    b1=5000000
def callBackFunc4():
    global b,b1
    b=str('3 wavelengths')
    b1=6500000
def callBackFunc5():
    global b,b1
    b=str('4 wavelengths')
    b1=7500000
app = tk.Tk() 
app.geometry('300x200')
#-------------CSU screen------------
#Create 2 checkboxes
chkValue = tk.BooleanVar() 
chkValue.set(False)
chkValue1 = tk.BooleanVar() 
chkValue1.set(False)
chkValue2 = tk.BooleanVar() 
chkValue2.set(False)
#3 checkboxes text
chkExample = tk.Checkbutton(app, text='CSUW1', 
                            var=chkValue, command=callBackFunc) 
chkExample1 = tk.Checkbutton(app, text='CSUW1SoRa', 
                            var=chkValue1, command=callBackFunc1)
chkExample2 = tk.Checkbutton(app, text='CSUX1', 
                            var=chkValue2, command=callBackFunc2)
#2 check boxes
chkExample.place(x=30, y=30)
chkExample1.place(x=30, y=50)
chkExample2.place(x=30, y=70)

frame1=tk.Frame()
frame1.place(x=30,y=100)
#Button to return from frame 1 to main frame
back_button = tk.Button(frame1, text="laser", command=changePage)
back_button.pack()
#----------Laser screen----------------------
def changePage():
    frame2=tk.Frame()
    frame2.place(x=30,y=100)
    back_button = tk.Button(frame2, text="Estimates", command=changePage1)
    back_button.pack()
#Create 2 checkboxes
    chkValue3 = tk.BooleanVar() 
    chkValue3.set(False)
    chkValue4 = tk.BooleanVar() 
    chkValue4.set(False)
    chkValue5 = tk.BooleanVar() 
    chkValue5.set(False)
#3 checkboxes text
    chkExample3 = tk.Checkbutton(app, text='2 wavelengths', 
                            var=chkValue3, command=callBackFunc3) 
    chkExample4 = tk.Checkbutton(app, text='3 wavelengths', 
                            var=chkValue4, command=callBackFunc4)
    chkExample5 = tk.Checkbutton(app, text='4 wavelengths', 
                            var=chkValue5, command=callBackFunc5)
#2 check boxes
    chkExample3.place(x=30, y=30)
    chkExample4.place(x=30, y=50)
    chkExample5.place(x=30, y=70)
#-----------Quote screen---------------------
def changePage1():
        app1 = tk.Tk() 
        app1.geometry('500x300')
        app1.title('Approximate estimate')
        lbl=tk.Label(app1,text='Approximate estimate')
        lbl.place(x=30,y=50)
        txt=tk.Entry(app1,width=20)
        txt.place(x=30,y=80)
        lbl1=tk.Label(app1,text='Mr')
        lbl1.place(x=180,y=80)
        lbl2=tk.Label(app1,text='product name')
        lbl2.place(x=30,y=120)
        lbl5=tk.Label(app1,text=str(a))
        lbl5.place(x=30,y=180)
        lbl8=tk.Label(app1,text=str(b))
        lbl8.place(x=30,y=210)
        lbl3=tk.Label(app1,text='List price')
        lbl3.place(x=250,y=120)
        lbl6=tk.Label(app1,text=str(a1))
        lbl6.place(x=250,y=180)
        lbl9=tk.Label(app1,text=str(b1))
        lbl9.place(x=250,y=210)
        lbl4=tk.Label(app1,text='Partition')
        lbl4.place(x=400,y=120)
        lbl7=tk.Label(app1,text=str(int(a1)*0.8))
        lbl7.place(x=400,y=180)
        lbl10=tk.Label(app1,text=str(int(b1)*0.8))
        lbl10.place(x=400,y=210)
        lbl11=tk.Label(app1,text='total')
        lbl11.place(x=200,y=240)
        lbl12=tk.Label(app1,text=str(int(a1)+int(b1)))
        lbl12.place(x=250,y=240)
        lbl13=tk.Label(app1,text=str(int(a1)*0.8+int(b1)*0.8))
        lbl13.place(x=400,y=240)
        back_button = tk.Button(app1, text="PDF")
        back_button.pack()
app.mainloop()

Recommended Posts

Simple sales tool creation with Python GUI: Quote creation
Simple sales tool creation with Python GUI: Employee number search
Simple sales tool creation with Python GUI: Cost rate calculation
Simple sales tool creation with Python GUI: Desktop application released
Simple sales tool creation using Python GUI: Employee number search (radio button)
GUI image cropping tool made with Python + Tkinter
[GUI with Python] PyQt5-Layout management-
[GUI with Python] PyQt5 -Preparation-
[GUI with Python] PyQt5 -Paint-
[GUI with Python] PyQt5 -Widget II-
Let's make a GUI with python.
[GUI with Python] PyQt5-The first step-
[GUI with Python] PyQt5-Drag and drop-
GUI creation with Pyside2 <Kindergarten level>
Automate simple tasks with Python Part0
[GUI with Python] PyQt5 -Custom Widget-
GUI creation in python using tkinter 2
Creating a simple PowerPoint file with Python
GUI creation in python using tkinter part 1
Simple Slack API client made with Python
Automate simple tasks with Python Part1 Scraping
Machine learning with python (2) Simple regression analysis
Use Amazon Simple Notification Service with Python
WebApi creation with Python (CRUD creation) For beginners
Excel table creation with Python [Progress management table]
Happy GUI construction with electron and python
I made a simple blackjack with Python
[Python] Python and security-② Port scanning tool made with Python
I made a GUI application with Python + PyQt5
GUI automation with Python x Windows App Driver
Start a simple Python web server with Docker
You can easily create a GUI with Python
Automating simple tasks with Python Table of contents
Recent ranking creation using Qiita API with Python
A simple to-do list created with Python + Django
GUI creation with Pyside Part 2 <Use of class>
Python Socket communication sample / simple data throwing tool
Open a file dialog with a python GUI (tkinter.filedialog)
FizzBuzz with Python3
Scraping with Python
Statistics with python
Scraping with Python
Twilio with Python
Integrate with Python
Play with 2016-Python
AES256 with python
python starts with ()
Bingo with python
Zundokokiyoshi with python
Excel with Python
Microcomputer with Python
Cast with python
Try to make a command standby tool with python
Automatic JIRA ticket creation with slack bot ~ slack bot development with python ① ~
Make a simple Slackbot with interactive button in python
Summary of tools for operating Windows GUI with Python
Let's make a simple game with Python 3 and iPhone
Calculate the regression coefficient of simple regression analysis with python
Problems when creating a csv-json conversion tool with python
Crawling with Python and Twitter API 1-Simple search function
Make a CSV formatting tool with Python Pandas PyInstaller