Note: 1- in Visual Studio 2017, 2019 or 2022. I ended
up with a folder where new projects were created by default in
C:\users\%username%\source\repos
2- C:\users\%username%\source\repos =
C:\users\...\source\repos
the
Microsoft Visual Studio (... or 2019 or 2022) is
a powerful IDE for Python language
Open/Run
Microsoft Visual Studio 2022
To view
Python templates, search for python.
Select the
Python
Application template, and select
Next.
Create a new Python project In
Visual Studio 2022
On the Configure your new project screen
- (specify a name and file location
for the project, and then select Create)
Project name:
CMPython
Location:
C:\Users\...\source\repos
(default location for Visual
Studio 2022)
The new project opens in Visual Studio
2022 - (Visual Studio 2022
Compiler - IDE, to compile Python project /
file )
The
Visual Studio Solution Explorer window shows the
project structure
SQL Database for Python / Connecting to
your SQL Server database in Visual Studio 2022
for Python
4.1- Download SQL Server Data Tools (SSDT)
for Visual Studio
SQL Server Data Tools (SSDT) is a modern development tool
for building SQL Server relational databases, databases in Azure SQL,
Analysis Services (AS) data models, Integration Services (IS) packages,
and Reporting Services (RS) reports. With SSDT, you can design and
deploy any SQL Server content type with the same ease as you would
develop an application in Visual Studio.
Continue
Install SSDT
with Visual Studio 2022
Install SSDT with Visual Studio 2022
If
Visual Studio 2022 is already installed, you can edit the list of
workloads to include SSDT. If you don't have Visual Studio 2022 installed,
then you can download and install Visual Studio 2022.
To
modify the installed Visual Studio workloads to include SSDT, use the
Visual Studio Installer.
Launch the Visual Studio Installer. In the Windows Start menu,
you can search for "installer".
In the installer, select for the edition of Visual Studio that
you want to add SSDT to, and then choose Modify.
Select SQL Server Data Tools under Data storage and processing
in the list of workloads.
Note: Server Explorer and Server Name
1- Server Explorer, on the Toolbox or by going
to View > Server Explorer.
2- Server Name at Server Explorer
4.2- Python SQL Driver - pyodbc
command prompt
pip install pyodbc
Create an SQL database using SQL
Server
connecting to SQL using pyodbc:
SERVER
=
'<server-address>'
DATABASE =
'<database-name>'
USERNAME =
'<username>'
PASSWORD =
'<password>'
4.3- Connecting to your SQL Server database in Visual Studio
Continue
Connecting
to your SQL Server database in Visual Studio
2022 for Python
Connecting to your SQL Server database in Visual Studio
on the Toolbox or by going to View > Server Explorer.
Right click on ‘Data Connections’ then click ‘Add
Connection’
2 Steps to Add Connection:
1st step - On the next screen (Choose Data Source)
change the data source ensure ‘Microsoft SQL Server’ is selected then
click the ‘Ok’ button.
2nd step - Add information to
‘Add Connection’
In the ‘Server name’ field
enter - DESKTOP-UEGAR4H
Enter in the ‘Select or
enter a database name’ - BKJVDat
The empty "BBTable1"
table will now look like this:
How Add Data to
BBTable1 Created
From Access DataBase KJV2002.mdb - 'CMPython\CMPython\database\KJV2002.mdb'
and
From
Table BibleTable Copy the Data
and then Paste it in BBTable1
def draw_admin():
for widget in dashboard.winfo_children():
widget.destroy()
welcome_text["text"] = "Welcome, Admin"
image1 = Image.open("media/nsec.jpg")
test = ImageTk.PhotoImage(image1)
label1 = Label(dashboard,image=test)
label1.photo = test
label1.place(x=0, y=0, height = 400, width =
1080)
#Header
header=Frame(root, bg="brown", bd=0)
header.place(x=0,y=0,width=1080,height=115)
#logo
image1 = Image.open("media/logo.jpg")
test = ImageTk.PhotoImage(image1)
label1 = tkinter.Label(header,image=test)
label1.image = test
label1.place(x=0, y=0, height = 120)
#heading label
nsec=Label(header, text="In the beginning was
the Word, and the Word was with God, and the
Word was God.",font=("Times New Roman",16,"bold"
), bg = "brown",fg="#eae2b7")
nsec.place(x=105, y=35, width=950)
#Profile frame
frame=Frame(root, bg="#fbb1bd")
frame.place(x=0,y=115,width=1080,height=50)
welcome_text = Label(frame, text = "Welcome to
the BIBLE", font=("Minion Pro Regular", 16), bg="#fbb1bd")
welcome_text.place(x=20, y=10)
is_on = True
#show Sql data of Database
conn = pyodbc.connect('Driver={SQL Server};'
'Server=desktop-uegar4h;'
'Database=BKJVDat;'
'Trusted_Connection=yes;')
#connection desktop-uegar4h.BKJVDat.dbo
#name=BKJVDat
#Owner=DESKTOP-UEGAR4H\User
#connection string=Data Source=localhost;Initial
Catalog=BKJVDat;Integrated Security=True
#provider=.NET Framework Data Provider for SQL
Server+
cursor = conn.cursor()
# TreeView
##Queryys = ("SELECT Verse, TextData FROM
BBTable1 WHERE Book<>'00a' and Book<>'00b' and
Book = '02' AND Chapter = '001' Order By Book
ASC")
Queryys = ("SELECT Book, BookTitle, Chapter,
Verse, TextData FROM BBTable1 WHERE Book<>'00a'
and Book<>'00b' and (TextData like '%Peter%' or
TextData like 'Peter%' or TextData like
'%Peter') Order By Book ASC")
#show list of Data rows
r_setBCh=cursor.execute(Queryys)
#Alternate colors for the rows of Treeview
my_tag='normal' # default value
for dt in r_setBCh:
my_tag='gray' if my_tag=='normal' else 'normal'
root = Tk()
root.title("Search by Word Operation, to Show
The Bible by Verse Corresponding")
#root.geometry('570x600')
root.eval('tk::PlaceWindow . center')
window_height = 590
window_width = 600
lbselected1=Label(root,text="1- Search
Operation: ",font=("Times New Roman", 12),
foreground="#000080")
lbselected1.place(x=17, y=3)
lbselected1a=Label(root,text=" 1)- in Entry Box
of Search by Word: Input any Word, 2)- then
Click Search Button:",font=("Times New Roman",
10), foreground="#000080")
lbselected1a.place(x=17, y=23)
lbselected2=Label(root,text=" 3)- in the
TreeView to Show the Corresponding Search of THE
BIBLE by Verse ",font=("Times New Roman", 10),
foreground="#000080")
lbselected2.place(x=17, y=43)
lbWsearch=Label(root,text="Search by Word:",font=("Times
New Roman", 12))
lbWsearch.place(x=17, y=75)
entry_text0 = tk.StringVar()
Wsearch = tk.Entry(root, textvariable=entry_text0,font=("Times
New Roman",12))
Wsearch.place(x=140, y =75, width = 180)
#Label Message
note_text=Label(root, text = "2- TreeView is
Empty",font=("Times New Roman", 10),
foreground="#000080")
note_text.place(x=10, y=140)
lbselected3=Label(root,text="3- no Data Display,
when ...",font=("Times New Roman", 10),
foreground="#000080")
lbselected3.place(x=10, y=390)
lbselected31=Label(root,text=" ",font=("Times
New Roman", 10), foreground="#000080")
lbselected31.place(x=10, y=410)
#2- Image
image1 = Image.open("media/jesus1.jpg")
test = ImageTk.PhotoImage(image1)
label11= tk.Label(root,image=test)
label11.image = test
label11.place(x=490, y=15, height = 140)
#Alternate colors for the rows of Treeview
data_table.tag_configure('gray', background='lightgray')
data_table.tag_configure('normal',
background='white')
#Labels and Entries
BookLable=Label(root,text="Book:",font=("Times
New Roman",12))
BookLable.place(x=17, y =440)
entry_textb = tk.StringVar()
BookEntry = tk.Entry(root, textvariable=entry_textb,font=("Times
New Roman",12))
BookEntry.place(x=81, y =440, width = 100)
BookTitleLable=Label(root,text="BookTitle:",font=("Times
New Roman",12))
BookTitleLable.place(x=220, y =440)
entry_text2 = tk.StringVar()
BookTitleEntry = tk.Entry(root, textvariable=entry_text2,font=("Times
New Roman",12))
BookTitleEntry.place(x=304, y =440, width = 100)
ChapterLable=Label(root,text="Chapter:",font=("Times
New Roman",12))
ChapterLable.place(x=17, y =470)
entry_textc = tk.StringVar()
ChapterEntry = tk.Entry(root, textvariable=entry_textc,font=("Times
New Roman",12))
ChapterEntry.place(x=81, y =470, width = 100)
VerseLable=Label(root,text="Verse:",font=("Times
New Roman",12))
VerseLable.place(x=220, y =470)
entry_textv = tk.StringVar()
VerseEntry = tk.Entry(root, textvariable=entry_textv,font=("Times
New Roman",12))
VerseEntry.place(x=304, y =470, width = 100)
TextDataLable=Label(root,text="TextData:",font=("Times
New Roman", 12))
TextDataLable.place(x=17, y=500)
cursorCh = connCh.cursor()
cursorCh.execute("SELECT distinct Chapter FROM
BBTable1 WHERE Book = '" + str(Bookval) + "'
Order By Chapter ASC")
cboTaskCh = []
for row2 in cursorCh.fetchall():
cboTaskCh.append(row2[0])
return cboTaskCh
cursorV = connCh.cursor()
cursorV.execute("SELECT distinct Verse FROM
BBTable1 WHERE Book = '" + str(Bookval) + "' AND
Chapter = '" + str(Chapterval) + "' Order By
Verse ASC")
cboTaskV = []
for row2 in cursorV.fetchall():
cboTaskV.append(row2[0])
return cboTaskV
#show Sql data of Database
connop = pyodbc.connect('Driver={SQL Server};'
'Server=desktop-uegar4h;'
'Database=BKJVDat;'
'Trusted_Connection=yes;')
#connection desktop-uegar4h.BKJVDat.dbo
#name=BKJVDat
#Owner=DESKTOP-UEGAR4H\User
#connection string=Data Source=localhost;Initial
Catalog=BKJVDat;Integrated Security=True
#provider=.NET Framework Data Provider for SQL
Server+
cursorop = connop.cursor()
#show value of current item divBookTitle =
current item divBook
#divBookTitle.current(divBook.current())
if option == "Book":
cursorop.execute("SELECT distinct Book FROM
BBTable1 WHERE Book<>'00a' and Book<>'00b' Order
By Book ASC")
cboTaskop = []
r = 1
for row2 in cursorop.fetchall():
cboTaskop.append(row2[0])
divBook['values'] = cboTaskop
r = r + 1
#current item or 1st item
divBook.current(0)
Bookvala = (divBook.get()).rstrip()
#Chapter Combobox
# add data to Chapter Combobox
Queryy2 = ("SELECT distinct Chapter FROM
BBTable1 WHERE Book = '" + str(Bookvala) + "'
Order By Chapter ASC")
cursorop.execute(Queryy2)
cboTaskCh = []
r = 1
for row2 in cursorop.fetchall():
cboTaskCh.append(row2[0])
divChapter['values'] = cboTaskCh
r = r + 1
#current item or 1st item
divChapter.current(0)
Chaptervala = (divChapter.get()).rstrip()
#Verse Combobox
# add data to Verse Combobox
Queryy2 = ("SELECT distinct Verse FROM BBTable1
WHERE Book = '" + str(Bookvala) + "' AND Chapter
= '" + str(Chaptervala) + "' Order By verse ASC")
cursorop.execute(Queryy2)
cboTaskV = []
r = 1
for row2 in cursorop.fetchall():
cboTaskV.append(row2[0])
divVerse['values'] = cboTaskV
r = r + 1
#current item or 1st item
divVerse.current(0)
elif option == "BookTitle":
cursorop.execute("SELECT distinct BookTitle,
Book FROM BBTable1 WHERE Book<>'00a' and
Book<>'00b' Order By Book ASC")
cboTaskop = []
r = 1
for row2 in cursorop.fetchall():
cboTaskop.append(row2[0])
divBook['values'] = cboTaskop
r = r + 1
#current item or 1st item
divBook.current(0)
Bookvala = (divBook.get()).rstrip()
#Chapter Combobox
# add data to Chapter Combobox
Queryy2 = ("SELECT distinct Chapter FROM
BBTable1 WHERE BookTitle = '" + str(Bookvala) +
"' Order By Chapter ASC")
cursorop.execute(Queryy2)
cboTaskCh = []
r = 1
for row2 in cursorop.fetchall():
cboTaskCh.append(row2[0])
divChapter['values'] = cboTaskCh
r = r + 1
#current item or 1st item
divChapter.current(0)
Chaptervala = (divChapter.get()).rstrip()
#Verse Combobox
# add data to Verse Combobox
Queryy2 = ("SELECT distinct Verse FROM BBTable1
WHERE BookTitle = '" + str(Bookvala) + "' AND
Chapter = '" + str(Chaptervala) + "' Order By
Verse ASC")
cursorop.execute(Queryy2)
cboTaskV = []
r = 1
for row2 in cursorop.fetchall():
cboTaskV.append(row2[0])
divVerse['values'] = cboTaskV
r = r + 1
#current item or 1st item
divVerse.current(0)
#Chapter Combobox
# add data to Chapter Combobox
Queryy2 = ("SELECT distinct Chapter FROM
BBTable1 WHERE Book = '" + str(Bookvala) + "'
Order By Chapter ASC")
cursorop.execute(Queryy2)
cboTaskCh = []
r = 1
for row2 in cursorop.fetchall():
cboTaskCh.append(row2[0])
divChapter['values'] = cboTaskCh
r = r + 1
#current item or 1st item
divChapter.current(0)
Chaptervala = (divChapter.get()).rstrip()
#Verse Combobox
# add data to Verse Combobox
Queryy2a = ("SELECT distinct Verse FROM BBTable1
WHERE Book = '" + str(Bookvala) + "' AND Chapter
= '" + str(Chaptervala) + "' Order By Verse ASC")
cursorop.execute(Queryy2a)
cboTaskV = []
r = 1
for row2 in cursorop.fetchall():
cboTaskV.append(row2[0])
divVerse['values'] = cboTaskV
r = r + 1
#current item or 1st item
divVerse.current(0)
elif option == "BookTitle":
#Chapter Combobox
# add data to Chapter Combobox
Queryy21 = ("SELECT distinct Chapter FROM
BBTable1 WHERE BookTitle = '" + str(Bookvala) +
"' Order By Chapter ASC")
cursorop.execute(Queryy21)
cboTaskCh = []
r = 1
for row2 in cursorop.fetchall():
cboTaskCh.append(row2[0])
divChapter['values'] = cboTaskCh
r = r + 1
#current item or 1st item
divChapter.current(0)
Chaptervala = (divChapter.get()).rstrip()
#Verse Combobox
# add data to Verse Combobox
Queryy21a = ("SELECT distinct Verse FROM
BBTable1 WHERE BookTitle = '" + str(Bookvala) +
"' AND Chapter = '" + str(Chaptervala) + "'
Order By Verse ASC")
cursorop.execute(Queryy21a)
cboTaskV = []
r = 1
for row2 in cursorop.fetchall():
cboTaskV.append(row2[0])
divVerse['values'] = cboTaskV
r = r + 1
#current item or 1st item
divVerse.current(0)
#show Sql data of Database
connop = pyodbc.connect('Driver={SQL Server};'
'Server=desktop-uegar4h;'
'Database=BKJVDat;'
'Trusted_Connection=yes;')
#connection desktop-uegar4h.BKJVDat.dbo
#name=BKJVDat
#Owner=DESKTOP-UEGAR4H\User
#connection string=Data Source=localhost;Initial
Catalog=BKJVDat;Integrated Security=True
#provider=.NET Framework Data Provider for SQL
Server+
cursorop = connop.cursor()
if option == "Book":
Chaptervala = (divChapter.get()).rstrip()
#Verse Combobox
# add data to Verse Combobox
Queryy22 = ("SELECT distinct Verse FROM BBTable1
WHERE Book = '" + str(Bookvala) + "' AND Chapter
= '" + str(Chaptervala) + "' Order By Verse ASC")
cursorop.execute(Queryy22)
cboTaskV = []
r = 1
for row2 in cursorop.fetchall():
cboTaskV.append(row2[0])
divVerse['values'] = cboTaskV
r = r + 1
#current item or 1st item
divVerse.current(0)
elif option == "BookTitle":
Chaptervala = (divChapter.get()).rstrip()
#Verse Combobox
# add data to Verse Combobox
Queryy22a = ("SELECT distinct Verse FROM
BBTable1 WHERE BookTitle = '" + str(Bookvala) +
"' AND Chapter = '" + str(Chaptervala) + "'
Order By Verse ASC")
cursorop.execute(Queryy22a)
cboTaskV = []
r = 1
for row2 in cursorop.fetchall():
cboTaskV.append(row2[0])
divVerse['values'] = cboTaskV
r = r + 1
#current item or 1st item
divVerse.current(0)
else:
return
connop.commit()
connop.close()
#3-divVerse
def getdataV(event):
#delete treeView data
data_table.delete(*data_table.get_children())
note_text['text'] = "2- TreeView is Empty"
#show Sql data of Database
conn = pyodbc.connect('Driver={SQL Server};'
'Server=desktop-uegar4h;'
'Database=BKJVDat;'
'Trusted_Connection=yes;')
#connection desktop-uegar4h.BKJVDat.dbo
#name=BKJVDat
#Owner=DESKTOP-UEGAR4H\User
#connection string=Data Source=localhost;Initial
Catalog=BKJVDat;Integrated Security=True
#provider=.NET Framework Data Provider for SQL
Server+
cursor = conn.cursor()
if option == "Book":
# TreeView
Queryy = ("SELECT Verse, TextData FROM
dbo.BBTable1 WHERE Book = '" + str(search_input)
+ "' AND Chapter = '" + str(search_inputCh) + "'
AND Verse = '" + str(search_inputV) + "' Order
By dbo.BBTable1.Verse ASC")
#show list of Data rows
r_setBCh=cursor.execute(Queryy)
elif option == "BookTitle":
# TreeView
Queryy = ("SELECT Verse, TextData FROM
dbo.BBTable1 WHERE BookTitle = '" +
str(search_input) + "' AND Chapter = '" +
str(search_inputCh) + "' AND Verse = '" +
str(search_inputV) + "' Order By
dbo.BBTable1.Verse ASC")
#show list of Data rows
r_setBCh=cursor.execute(Queryy)
else:
return
#Alternate colors for the rows of Treeview
my_tag='normal' # default value
for dt in r_setBCh:
my_tag='gray' if my_tag=='normal' else 'normal'
data_table.insert("", 'end',iid=dt[0],
text=dt[0],
values =(dt[0],dt[1]),tags=(my_tag))
#Calcul Number of rows
cursor.execute(Queryy)
rows = cursor.fetchall()
if rows == None:
note_text['text'] = "2- TreeView is Empty -
Data: 0 Rows "
return
if option == "Book":
note_text['text'] = "2- THE BIBLE by Verse in
the TreeView and ... - Book: "+str(search_input)+
", Chapter: "+str(search_inputCh)+", Verse: "+str(search_inputV)+"
-- "+str(len(rows))+" Row"
BookLable.place(x=50, y =460)
BookEntry.place(x=123, y =460, width = 100)
#insert contents
BookEntry.insert(0, str(search_input))
ChapterEntry.insert(0, str(search_inputCh))
VerseEntry.insert(0, str(search_inputV))
textDataEntry22.insert(tk.END, dt[1])
elif option == "BookTitle":
note_text['text'] = "2- THE BIBLE by Verse in
the TreeView - BookTitle: "+str(search_input)+
", Chapter: "+str(search_inputCh)+", Verse: "+str(search_inputV)+"
-- "+str(len(rows))+" Row"
BookTitleLable.place(x=50, y =460)
BookTitleEntry.place(x=123, y =460, width = 100)
#heading label
nsec=Label(header, text="The book of the
generation of Jesus Christ, the son of David,
the son of Abraham.",font=("Times New Roman",
16,"bold"), bg = "brown",fg="#eae2b7")
nsec.place(x=0, y=10, width=850)
#Profile frame
frame2=Frame(root, bg="#fbb1bd")
frame2.place(x=0,y=75,width=850,height=50)
welcome_text = Label(frame2, text = "Search (by
Book OR Name)", font=("Times New Roman", 12), bg="#fbb1bd")
welcome_text.place(x=30, y=10, height = 25,
width = 200)
close = Button(frame2, text = "Done", bd = 0,
command = on_closing, font=("Times New Roman",
12), bg="#fff", fg = "#000")
close.place(x=725, y=10, width = 80)
#panel_elements
#Labels
lbselected1=Label(panel,text="1- Search
Operation, Select any value of Comboboxes, then
Click Button - Search,",font=("Times New Roman",
12,"bold"), bg="#bbb", foreground="#ffffff")
lbselected1.place(x=17, y=3)
lbselected2=Label(panel,text=" to Show the
corresponding THE BIBLE by Verse in the TreeView
and the Box Entries",font=("Times New Roman",
12,"bold"), bg="#bbb", foreground="#ffffff")
lbselected2.place(x=17, y=24)
lbBook=Label(panel,text="Search by Book or
Booktitle:",font=("Times New Roman", 10))
lbBook.place(x=50, y=70)
dropdown=ttk.Combobox(panel, width=15,
font=("Times New Roman",10), state='readonly')
dropdown['values']=("Book", "BookTitle")
dropdown.current(0)
dropdown.place(x=250, y=70)
dropdown.bind("<<ComboboxSelected>>",
getdataBKBkT)
#Alternate colors for the rows of Treeview
data_table.tag_configure('gray', background='lightgray')
data_table.tag_configure('normal',
background='white')
#Labels and Entries
BookLable=Label(root,text="Book:",font=("Times
New Roman",12))
BookLable.place(x=50, y =460)
entry_text1 = tk.StringVar()
BookEntry = tk.Entry(root, textvariable=entry_text1,font=("Times
New Roman",12))
BookEntry.place(x=123, y =460, width = 100)
BookTitleLable=Label(root,text="BookTitle:",font=("Times
New Roman",12))
#BookTitleLable.place(x=253, y =460)
entry_text2 = tk.StringVar()
BookTitleEntry = tk.Entry(root, textvariable=entry_text2,font=("Times
New Roman",12))
#BookTitleEntry.place(x=337, y =460, width =
100)
ChapterLable=Label(root,text="Chapter:",font=("Times
New Roman",12))
ChapterLable.place(x=50, y =490)
entry_text3 = tk.StringVar()
ChapterEntry = tk.Entry(root, textvariable=entry_text3,font=("Times
New Roman",12))
ChapterEntry.place(x=123, y =490, width = 100)
VerseLable=Label(root,text="Verse:",font=("Times
New Roman",12))
VerseLable.place(x=253, y =490)
entry_text = tk.StringVar()
VerseEntry = tk.Entry(root, textvariable=entry_text,font=("Times
New Roman",12))
VerseEntry.place(x=337, y =490, width = 100)
TextDataLable=Label(root,text="TextData:",font=("Times
New Roman", 12))
TextDataLable.place(x=50, y=535)
cursorCh = connCh.cursor()
cursorCh.execute("SELECT distinct Chapter FROM
BBTable1 WHERE Book = '" + str(Bookval) + "'
Order By Chapter ASC")
cboTaskCh = []
for row2 in cursorCh.fetchall():
cboTaskCh.append(row2[0])
return cboTaskCh
cursorVr = connVr.cursor()
cursorVr.execute("SELECT distinct Verse FROM
BBTable1 WHERE Book = '" + str(Bookval) + "' AND
Chapter = '" + str(Chapterval) + "' Order By
BBTable1.Verse ASC")
cboTaskVr = []
for row2 in cursorVr.fetchall():
cboTaskVr.append(row2[0])
return cboTaskVr
#value of current item divBook
Bookval1a = divBook.get()
Bookvala = Bookval1a.rstrip()
#show Sql data of Database
connBVal = pyodbc.connect('Driver={SQL Server};'
'Server=desktop-uegar4h;'
'Database=BKJVDat;'
'Trusted_Connection=yes;')
#connection desktop-uegar4h.BKJVDat.dbo
#name=BKJVDat
#Owner=DESKTOP-UEGAR4H\User
#connection string=Data Source=localhost;Initial
Catalog=BKJVDat;Integrated Security=True
#provider=.NET Framework Data Provider for SQL
Server+
cursorBTD = connBVal.cursor()
#show value of current item divBookTitle =
current item divBook
divBookTitle.current(divBook.current())
#Chapter Combobox
# add data to Chapter Combobox
Queryy2 = ("SELECT distinct Chapter FROM
BBTable1 WHERE Book = '" + str(Bookvala) + "'
Order By Chapter ASC")
cursorBTD.execute(Queryy2)
cboTaskCh = []
r = 1
for row2 in cursorBTD.fetchall():
cboTaskCh.append(row2[0])
divChapter['values'] = cboTaskCh
r = r + 1
#current item or 1st item
divChapter.current(0)
#value of current item divChapter
Chapterval1a = divChapter.get()
Chaptervala = Chapterval1a.rstrip()
#value of current item divVerse
Verseval1a = divVerse.get()
Versevala = Verseval1a.rstrip()
# TreeView
QueryyBCh = ("SELECT Verse, TextData FROM
dbo.BBTable1 WHERE Book = '" + str(Bookvala) +
"' AND Chapter = '" + str(Chaptervala) + "' AND
Verse = '" + str(Versevala) + "' Order By
dbo.BBTable1.Verse ASC")
#show list of Data rows
r_setBCh=cursorBTD.execute(QueryyBCh)
#Alternate colors for the rows of Treeview
my_tag='normal' # default value
for dt in r_setBCh:
my_tag='gray' if my_tag=='normal' else 'normal'
data_table.insert("", 'end',iid=dt[0],
text=dt[0],
values =(dt[0],dt[1]),tags=(my_tag))
#Calcul Number of rows
cursorBTD.execute(QueryyBCh)
rows = cursorBTD.fetchall()
if rows == None:
note_text['text'] = "2- TreeView is Empty -
Data: 0 Rows "
return
note_text['text'] = "2- THE BIBLE by Verse in
the TreeView - Book: "+str(divBook.get().rstrip())+
", BookTitle: "+str(divBookTitle.get().rstrip())+
", Chapter: "+str(divChapter.get().rstrip())+",
Verse: "+str(divVerse.get().rstrip())+" -- "+str(len(rows))+"
Row"
lbselected3['text'] ="3- To Display Data, when
to Select the Row of THE BIBLE by Verse in the
TreeView"
#value of current item divBook
BookTitleval1a = divBookTitle.get()
BookTitlevala = BookTitleval1a.rstrip()
#show Sql data of Database
connBTVal = pyodbc.connect('Driver={SQL
Server};'
'Server=desktop-uegar4h;'
'Database=BKJVDat;'
'Trusted_Connection=yes;')
#connection desktop-uegar4h.BKJVDat.dbo
#name=BKJVDat
#Owner=DESKTOP-UEGAR4H\User
#connection string=Data Source=localhost;Initial
Catalog=BKJVDat;Integrated Security=True
#provider=.NET Framework Data Provider for SQL
Server+
cursorBTD = connBTVal.cursor()
#show value of current item divBook = current
item divBookTitle
divBook.current(divBookTitle.current())
#Chapter Combobox
# add data to Chapter Combobox
Queryy2 = ("SELECT distinct Chapter FROM
BBTable1 WHERE BookTitle = '" +
str(BookTitlevala) + "' Order By Chapter ASC")
cursorBTD.execute(Queryy2)
cboTaskCh = []
r = 1
for row2 in cursorBTD.fetchall():
cboTaskCh.append(row2[0])
divChapter['values'] = cboTaskCh
r = r + 1
#current item or 1st item
divChapter.current(0)
#value of current item divChapter
Chapterval1a = divChapter.get()
Chaptervala = Chapterval1a.rstrip()
#value of current item divVerse
Verseval1a = divVerse.get()
Versevala = Verseval1a.rstrip()
# TreeView
QueryyBCh = ("SELECT Verse, TextData FROM
dbo.BBTable1 WHERE BookTitle = '" +
str(BookTitlevala) + "' AND Chapter = '" +
str(Chaptervala) + "' AND Verse = '" +
str(Versevala) + "' Order By dbo.BBTable1.Verse
ASC")
#show list of Data rows
r_setBCh=cursorBTD.execute(QueryyBCh)
#Alternate colors for the rows of Treeview
my_tag='normal' # default value
for dt in r_setBCh:
my_tag='gray' if my_tag=='normal' else 'normal'
data_table.insert("", 'end',iid=dt[0],
text=dt[0],
values =(dt[0],dt[1]),tags=(my_tag))
#Calcul Number of rows
cursorBTD.execute(QueryyBCh)
rows = cursorBTD.fetchall()
if rows == None:
note_text['text'] = "2- TreeView is Empty -
Data: 0 Rows "
return
note_text['text'] = "2- THE BIBLE by Verse in
the TreeView - Book: "+str(divBook.get().rstrip())+
", BookTitle: "+str(divBookTitle.get().rstrip())+
", Chapter: "+str(divChapter.get().rstrip())+",
Verse: "+str(divVerse.get().rstrip())+" -- "+str(len(rows))+"
Row"
lbselected3['text'] ="3- To Display Data, when
to Select the Row of THE BIBLE by Verse in the
TreeView"
connBTVal.commit()
connBTVal.close()
#value of current item divVerse
Verseval1a = divVerse.get()
Versevala = Verseval1a.rstrip()
#show Sql data of Database
connBCh = pyodbc.connect('Driver={SQL Server};'
'Server=desktop-uegar4h;'
'Database=BKJVDat;'
'Trusted_Connection=yes;')
#connection desktop-uegar4h.BKJVDat.dbo
#name=BKJVDat
#Owner=DESKTOP-UEGAR4H\User
#connection string=Data Source=localhost;Initial
Catalog=BKJVDat;Integrated Security=True
#provider=.NET Framework Data Provider for SQL
Server+
cursorBCh = connBCh.cursor()
# TreeView
QueryyBCh = ("SELECT Verse, TextData FROM
dbo.BBTable1 WHERE Book = '" + str(Bookvala) +
"' AND Chapter = '" + str(Chaptervala) + "' AND
Verse = '" + str(Versevala) + "' Order By
dbo.BBTable1.Verse ASC")
#show list of Data rows
r_setBCh=cursorBCh.execute(QueryyBCh)
#Alternate colors for the rows of Treeview
my_tag='normal' # default value
for dt in r_setBCh:
my_tag='gray' if my_tag=='normal' else 'normal'
data_table.insert("", 'end',iid=dt[0],
text=dt[0],
values =(dt[0],dt[1]),tags=(my_tag))
#Calcul Number of rows
cursorBCh.execute(QueryyBCh)
rows = cursorBCh.fetchall()
if rows == None:
note_text['text'] = "2- TreeView is Empty -
Data: 0 Rows "
return
note_text['text'] = "2- THE BIBLE by Verse in
the TreeView - Book: "+str(divBook.get().rstrip())+
", BookTitle: "+str(divBookTitle.get().rstrip())+
", Chapter: "+str(divChapter.get().rstrip())+",
Verse: "+str(divVerse.get().rstrip())+" -- "+str(len(rows))+"
Row"
lbselected3['text'] ="3- To Display Data, when
to Select the Row of THE BIBLE by Verse in the
TreeView"
connBCh.commit()
connBCh.close()
#show Sql data of Database
connBVr = pyodbc.connect('Driver={SQL Server};'
'Server=desktop-uegar4h;'
'Database=BKJVDat;'
'Trusted_Connection=yes;')
#connection desktop-uegar4h.BKJVDat.dbo
#name=BKJVDat
#Owner=DESKTOP-UEGAR4H\User
#connection string=Data Source=localhost;Initial
Catalog=BKJVDat;Integrated Security=True
#provider=.NET Framework Data Provider for SQL
Server+
cursorBVr = connBVr.cursor()
# TreeView
QueryyBVr = ("SELECT Verse, TextData FROM
dbo.BBTable1 WHERE Book = '" + str(Bookvala) +
"' AND Chapter = '" + str(Chaptervala) + "' AND
Verse = '" + str(Versevala) + "' Order By
dbo.BBTable1.Verse ASC")
#show list of Data rows
r_setBVr=cursorBVr.execute(QueryyBVr)
#Alternate colors for the rows of Treeview
my_tag='normal' # default value
for dt in r_setBVr:
my_tag='gray' if my_tag=='normal' else 'normal'
data_table.insert("", 'end',iid=dt[0],
text=dt[0],
values =(dt[0],dt[1]),tags=(my_tag))
#Calcul Number of rows
cursorBVr.execute(QueryyBVr)
rows = cursorBVr.fetchall()
if rows == None:
note_text['text'] = "2- TreeView is Empty -
Data: 0 Rows "
return
note_text['text'] = "2- THE BIBLE by Verse in
the TreeView - Book: "+str(divBook.get().rstrip())+
", BookTitle: "+str(divBookTitle.get().rstrip())+
", Chapter: "+str(divChapter.get().rstrip())+",
Verse: "+str(divVerse.get().rstrip())+" -- "+str(len(rows))+"
Row"
lbselected3['text'] ="3- To Display Data, when
to Select the Row of THE BIBLE by Verse in the
TreeView"
connBVr.commit()
connBVr.close()
lbselected1=Label(root,text="1- Search
Operation, Select any value of Comboboxes,",font=("Times
New Roman", 12), foreground="#000080")
lbselected1.place(x=17, y=3)
lbselected2=Label(root,text=" to Show the
corresponding THE BIBLE by Verse in the
TreeView",font=("Times New Roman", 10),
foreground="#000080")
lbselected2.place(x=17, y=24)
lbBook=Label(root,text="Book:",font=("Times New
Roman", 12))
lbBook.place(x=17, y=55)
lbBookTitle=Label(root,text="Book Title:",font=("Times
New Roman", 12))
lbBookTitle.place(x=17, y=80)
lbChapter=Label(root,text="Chapter:",font=("Times
New Roman", 12))
lbChapter.place(x=17, y=105)
lbVerse=Label(root,text="Verse:",font=("Times
New Roman", 12))
lbVerse.place(x=17, y=130)
#lbVerse1=Label(root,text=str(divChapter.current(0)),font=("Times
New Roman", 12))
#lbVerse1.place(x=17, y=170)
#Chapterval = currentChapter.get().rstrip()
lbline1=Label(root,text="----------------------------------------------------------------",font=("Times
New Roman", 12))
lbline1.place(x=45, y=150)
#Label Message
note_text=Label(root, text = "2- TreeView is
Empty",font=("Times New Roman", 10),
foreground="#000080")
note_text.place(x=10, y=180)
lbselected3=Label(root,text="3- no Data Display,
when ...",font=("Times New Roman", 10),
foreground="#000080")
lbselected3.place(x=17, y=320)
#Alternate colors for the rows of Treeview
data_table.tag_configure('gray', background='lightgray')
data_table.tag_configure('normal',
background='white')
#Labels and Entries
BookLable=Label(root,text="Book:",font=("Times
New Roman",12))
BookLable.place(x=17, y =350)
entry_text1 = tk.StringVar()
BookEntry = tk.Entry(root, textvariable=entry_text1,font=("Times
New Roman",12))
BookEntry.place(x=81, y =350, width = 100)
BookTitleLable=Label(root,text="BookTitle:",font=("Times
New Roman",12))
BookTitleLable.place(x=220, y =350)
entry_text2 = tk.StringVar()
BookTitleEntry = tk.Entry(root, textvariable=entry_text2,font=("Times
New Roman",12))
BookTitleEntry.place(x=304, y =350, width = 100)
ChapterLable=Label(root,text="Chapter:",font=("Times
New Roman",12))
ChapterLable.place(x=17, y =380)
entry_text3 = tk.StringVar()
ChapterEntry = tk.Entry(root, textvariable=entry_text3,font=("Times
New Roman",12))
ChapterEntry.place(x=81, y =380, width = 100)
VerseLable=Label(root,text="Verse:",font=("Times
New Roman",12))
VerseLable.place(x=220, y =380)
entry_text = tk.StringVar()
VerseEntry = tk.Entry(root, textvariable=entry_text,font=("Times
New Roman",12))
VerseEntry.place(x=304, y =380, width = 100)
TextDataLable=Label(root,text="TextData:",font=("Times
New Roman", 12))
TextDataLable.place(x=17, y=410)
cursorCh = connCh.cursor()
cursorCh.execute("SELECT distinct Chapter FROM
BBTable1 WHERE Book = '" + str(Bookval) + "'
Order By Chapter ASC")
cboTaskCh = []
for row2 in cursorCh.fetchall():
cboTaskCh.append(row2[0])
return cboTaskCh
#delete treeView data
data_table.delete(*data_table.get_children())
#delete Entry data
VerseEntry.delete(0, END)
textDataEntry22.delete("1.0",tk.END)
#value of current item divBook
Bookval1a = divBook.get()
Bookvala = Bookval1a.rstrip()
#show Sql data of Database
connBVal = pyodbc.connect('Driver={SQL Server};'
'Server=desktop-uegar4h;'
'Database=BKJVDat;'
'Trusted_Connection=yes;')
#connection desktop-uegar4h.BKJVDat.dbo
#name=BKJVDat
#Owner=DESKTOP-UEGAR4H\User
#connection string=Data Source=localhost;Initial
Catalog=BKJVDat;Integrated Security=True
#provider=.NET Framework Data Provider for SQL
Server+
cursorBTD = connBVal.cursor()
#show value of current item divBookTitle =
current item divBook
divBookTitle.current(divBook.current())
#Chapter Combobox
# add data to Chapter Combobox
Queryy2 = ("SELECT distinct Chapter FROM
BBTable1 WHERE Book = '" + str(Bookvala) + "'
Order By Chapter ASC")
cursorBTD.execute(Queryy2)
cboTaskCh = []
r = 1
for row2 in cursorBTD.fetchall():
cboTaskCh.append(row2[0])
divChapter['values'] = cboTaskCh
r = r + 1
#current item or 1st item
divChapter.current(0)
#value of current item divChapter
Chapterval1a = divChapter.get()
Chaptervala = Chapterval1a.rstrip()
# TreeView
QueryyBCh = ("SELECT Verse, TextData FROM
dbo.BBTable1 WHERE Book = '" + str(Bookvala) +
"' AND Chapter = '" + str(Chaptervala) + "'
Order By dbo.BBTable1.Verse ASC")
#show list of Data rows
r_setBCh=cursorBTD.execute(QueryyBCh)
#Alternate colors for the rows of Treeview
my_tag='normal' # default value
for dt in r_setBCh:
my_tag='gray' if my_tag=='normal' else 'normal'
data_table.insert("", 'end',iid=dt[0],
text=dt[0],
values =(dt[0],dt[1]),tags=(my_tag))
#Calcul Number of rows
cursorBTD.execute(QueryyBCh)
rows = cursorBTD.fetchall()
if rows == None:
note_text['text'] = "2- TreeView is Empty -
Data: 0 Rows "
return
#note_text['text'] = "Data: "+str(len(rows))+"
Rows"
note_text['text'] = "2- THE BIBLE by Chapiter in
the TreeView - Book: "+str(divBook.get().rstrip())+
", BookTitle: "+str(divBookTitle.get().rstrip())+
", Chapter: "+str(divChapter.get().rstrip())+"
-- Data: "+str(len(rows))+" Rows"
lbselected3['text'] ="3- To Display Data, when
to Select any Row of THE BIBLE by Chapter in the
TreeView"
#delete treeView data
data_table.delete(*data_table.get_children())
#delete Entry data
VerseEntry.delete(0, END)
textDataEntry22.delete("1.0",tk.END)
#value of current item divBook
BookTitleval1a = divBookTitle.get()
BookTitlevala = BookTitleval1a.rstrip()
#show Sql data of Database
connBTVal = pyodbc.connect('Driver={SQL
Server};'
'Server=desktop-uegar4h;'
'Database=BKJVDat;'
'Trusted_Connection=yes;')
#connection desktop-uegar4h.BKJVDat.dbo
#name=BKJVDat
#Owner=DESKTOP-UEGAR4H\User
#connection string=Data Source=localhost;Initial
Catalog=BKJVDat;Integrated Security=True
#provider=.NET Framework Data Provider for SQL
Server+
cursorBTD = connBTVal.cursor()
#show value of current item divBook = current
item divBookTitle
divBook.current(divBookTitle.current())
#Chapter Combobox
# add data to Chapter Combobox
Queryy2 = ("SELECT distinct Chapter FROM
BBTable1 WHERE BookTitle = '" +
str(BookTitlevala) + "' Order By Chapter ASC")
cursorBTD.execute(Queryy2)
cboTaskCh = []
r = 1
for row2 in cursorBTD.fetchall():
cboTaskCh.append(row2[0])
divChapter['values'] = cboTaskCh
r = r + 1
#current item or 1st item
divChapter.current(0)
#value of current item divChapter
Chapterval1a = divChapter.get()
Chaptervala = Chapterval1a.rstrip()
# TreeView
QueryyBCh = ("SELECT Verse, TextData FROM
dbo.BBTable1 WHERE BookTitle = '" +
str(BookTitlevala) + "' AND Chapter = '" +
str(Chaptervala) + "' Order By
dbo.BBTable1.Verse ASC")
#show list of Data rows
r_setBCh=cursorBTD.execute(QueryyBCh)
#Alternate colors for the rows of Treeview
my_tag='normal' # default value
for dt in r_setBCh:
my_tag='gray' if my_tag=='normal' else 'normal'
data_table.insert("", 'end',iid=dt[0],
text=dt[0],
values =(dt[0],dt[1]),tags=(my_tag))
#Calcul Number of rows
cursorBTD.execute(QueryyBCh)
rows = cursorBTD.fetchall()
if rows == None:
note_text['text'] = "2- TreeView is Empty -
Data: 0 Rows "
return
#note_text['text'] = "Data: "+str(len(rows))+"
Rows"
note_text['text'] = "2- THE BIBLE by Chapiter in
the TreeView - Book: "+str(divBook.get().rstrip())+
", BookTitle: "+str(divBookTitle.get().rstrip())+
", Chapter: "+str(divChapter.get().rstrip())+"
-- Data: "+str(len(rows))+" Rows"
lbselected3['text'] ="3- To Display Data, when
to Select any Row of THE BIBLE by Chapiter in
the TreeView"
connBTVal.commit()
connBTVal.close()
#show Sql data of Database
connBCh = pyodbc.connect('Driver={SQL Server};'
'Server=desktop-uegar4h;'
'Database=BKJVDat;'
'Trusted_Connection=yes;')
#connection desktop-uegar4h.BKJVDat.dbo
#name=BKJVDat
#Owner=DESKTOP-UEGAR4H\User
#connection string=Data Source=localhost;Initial
Catalog=BKJVDat;Integrated Security=True
#provider=.NET Framework Data Provider for SQL
Server+
cursorBCh = connBCh.cursor()
# TreeView
QueryyBCh = ("SELECT Verse, TextData FROM
dbo.BBTable1 WHERE Book = '" + str(Bookvala) +
"' AND Chapter = '" + str(Chaptervala) + "'
Order By dbo.BBTable1.Verse ASC")
#show list of Data rows
r_setBCh=cursorBCh.execute(QueryyBCh)
#Alternate colors for the rows of Treeview
my_tag='normal' # default value
for dt in r_setBCh:
my_tag='gray' if my_tag=='normal' else 'normal'
data_table.insert("", 'end',iid=dt[0],
text=dt[0],
values =(dt[0],dt[1]),tags=(my_tag))
#Calcul Number of rows
cursorBCh.execute(QueryyBCh)
rows = cursorBCh.fetchall()
if rows == None:
note_text['text'] = "2- TreeView is Empty -
Data: 0 Rows "
return
#note_text['text'] = "Data: "+str(len(rows))+"
Rows"
note_text['text'] = "2- THE BIBLE by Chapiter in
the TreeView - Book: "+str(divBook.get().rstrip())+
", BookTitle: "+str(divBookTitle.get().rstrip())+
", Chapter: "+str(divChapter.get().rstrip())+"
-- Data: "+str(len(rows))+" Rows"
lbselected3['text'] ="3- To Display Data, when
to Select any Row of THE BIBLE by Chapiter in
the TreeView"
connBCh.commit()
connBCh.close()
lbselected1=Label(root,text="1- Search
Operation, Select any value of Comboboxes,",font=("Times
New Roman", 12), foreground="#000080")
lbselected1.place(x=17, y=3)
lbselected2=Label(root,text=" to Show the
corresponding THE BIBLE by Chapiter in the
TreeView",font=("Times New Roman", 10),
foreground="#000080")
lbselected2.place(x=17, y=24)
lbBook=Label(root,text="Book:",font=("Times New
Roman", 12))
lbBook.place(x=17, y=55)
lbBookTitle=Label(root,text="Book Title:",font=("Times
New Roman", 12))
lbBookTitle.place(x=17, y=80)
lbChapter=Label(root,text="Chapter:",font=("Times
New Roman", 12))
lbChapter.place(x=17, y=105)
lbline1=Label(root,text="----------------------------------------------------------------",font=("Times
New Roman", 12))
lbline1.place(x=45, y=145)
#Label Message
note_text=Label(root, text = "2- TreeView is
Empty",font=("Times New Roman", 10),
foreground="#000080")
note_text.place(x=10, y=180)
lbselected3=Label(root,text="3- no Data Display,
when ...",font=("Times New Roman", 10),
foreground="#000080")
lbselected3.place(x=17, y=435)
#Alternate colors for the rows of Treeview
data_table.tag_configure('gray', background='lightgray')
data_table.tag_configure('normal',
background='white')
#Label and Entry
VerseLable=Label(root,text="Verse:",font=("Times
New Roman",12))
VerseLable.place(x=17, y =465)
entry_text = tk.StringVar()
VerseEntry = tk.Entry(root, textvariable=entry_text,font=("Times
New Roman",12))
VerseEntry.place(x=81, y =465, width = 200)
TextDataLable=Label(root,text="TextData:",font=("Times
New Roman", 12))
TextDataLable.place(x=17, y=490)
Python Program,
to Print Microsoft
database Access, name = pic\Database1.accdb
Python program, to
Print Microsoft database Access, name = pic\Database1.accdb
Create a new Python project In Visual Studio
2022
the
Microsoft Visual Studio (... or 2019 or 2022) is
a powerful IDE for Python language
Open/Run
Microsoft Visual Studio 2022
To view
Python templates, search for python.
Select the
Python
Application template, and select
Next.
Create a new Python project In
Visual Studio 2022
On the Configure your new project screen
- (specify a name and file location
for the project, and then select Create)
Project name:
PyAccesscon
Location:
C:\Users\...\source\repos
(default location for Visual
Studio 2022)
The new project opens in Visual Studio
2022 - (Visual Studio 2022
Compiler - IDE, to compile Python project /
file )
The
Visual Studio Solution Explorer window shows the
project structure
Python program,
to Display a Supermarket management
Python program, to
Display a Supermarket management
- Using
file to save the invoices
Create a new Python project In Visual Studio
2022
the
Microsoft Visual Studio (... or 2019 or 2022) is
a powerful IDE for Python language
Open/Run
Microsoft Visual Studio 2022
To view
Python templates, search for python.
Select the
Python
Application template, and select
Next.
Create a new Python project In
Visual Studio 2022
On the Configure your new project screen
- (specify a name and file location
for the project, and then select Create)
Project name:
PythonSuperMarket
Location:
C:\Users\...\source\repos
(default location for Visual
Studio 2022)
The new project opens in Visual Studio
2022 - (Visual Studio 2022
Compiler - IDE, to compile Python project /
file )
The
Visual Studio Solution Explorer window shows the
project structure
def savex():
op=messagebox.askyesno("حفظ","هل تريد حفظ
الفاتورة")
if op>0:
bb=textarea.get("1.0",END)
fl=open("C:\\buy\\'+str(fatora.get())+'.txt","w",encoding="utf-8")
fl.write(bb)
fl.close()
else:
return
def billing():
if nemo.get()=="" or phono.get()=="":
messagebox.showerror("حدث خطا","لا يجوز ترك حقل
الاسم ورقم الهاتف الفارغا")
elif bacoliat.get()=="0.0 $" and adoat.get()=="0.0
$" and kahraba.get()=="0.0 $":
messagebox.showerror(" حدث خطا"," هناك منتوجات
محددة ولم يتم اختيار احدهها يجب اختيار عدد
المنتجات")
else:
welcome()
total()
if q1.get()!=0:
textarea.insert(END,f'\n{rez.get()}\t\t{q1.get()}\t\tالرز')
if q2.get()!=0:
textarea.insert(END,f'\n{borgel.get()}\t\t{q2.get()}\t\tبرغل')
if q3.get()!=0:
textarea.insert(END,f'\n{fasoli.get()}\t\t{q3.get()}\t\tفاصوليا')
if q4.get()!=0:
textarea.insert(END,f'\n{(ades.get())}\t\t{q4.get()}\t\tعدس')
if q5.get()!=0:
textarea.insert(END,f'\n{makrona.get()}\t\t{q5.get()}\t\tمعكرونة')
if q6.get()!=0:
textarea.insert(END,f'\n{frika.get()}\t\t{q6.get()}\t\tفريكة')
if q7.get()!=0:
textarea.insert(END,f'\n{homes.get()}\t\t{q7.get()}\t\tحمص')
if q8.get()!=0:
textarea.insert(END,f'\n{fol.get()}\t\t{q8.get()}\t\tفول')
if q9.get()!=0:
textarea.insert(END,f'\n{mlah.get()}\t\t{q9.get()}\t\tالملح')
if q10.get()!=0:
textarea.insert(END,f'\n{skar.get()}\t\t{q10.get()}\t\tسكر')
if q11.get()!=0:
textarea.insert(END,f'\n{flflahmar.get()}\t\t{q11.get()}\t\tفلفل
احمر')
if q12.get()!=0:
textarea.insert(END,f'\n{flflasoad.get()}\t\t{q12.get()}\t\tفلفل
اسود')
if q13.get()!=0:
textarea.insert(END,f'\n{lobia.get()}\t\t{q13.get()}\t\tاللوبيا')
if q14.get()!=0:
textarea.insert(END,f'\n{admami.get()}\t\t{q14.get()}\t\tالادمامي')
if q15.get()!=0:
textarea.insert(END,f'\n{qmah.get()}\t\t{q15.get()}\t\tالقمح')
if q16.get()!=0:
textarea.insert(END,f'\n{shair.get()}\t\t{q16.get()}\t\tالشعير')
if q17.get()!=0:
textarea.insert(END,f'\n{shofan.get()}\t\t{q17.get()}\t\tالشوفان')
if q18.get()!=0:
textarea.insert(END,f'\n{zara.get()}\t\t{q18.get()}\t\tالذرة')
if qq1.get()!=0:
textarea.insert(END,f'\n{rez1.get()}\t\t{qq1.get()}\t\tمصفاة')
if qq2.get()!=0:
textarea.insert(END,f'\n{borgel1.get()}\t\t{qq2.get()}\t\tصحن')
if qq3.get()!=0:
textarea.insert(END,f'\n{fasoli1.get()}\t\t{qq3.get()}\t\tكاس')
if qq4.get()!=0:
textarea.insert(END,f'\n{ades1.get()}\t\t{qq4.get()}\t\tابريق')
if qq5.get()!=0:
textarea.insert(END,f'\n{makrona1.get()}\t\t{qq5.get()}\t\tسكين')
if qq6.get()!=0:
textarea.insert(END,f'\n{frika1.get()}\t\t{qq6.get()}\t\tشوك')
if qq7.get()!=0:
textarea.insert(END,f'\n{homes1.get()}\t\t{qq7.get()}\t\tطنجرة')
if qq8.get()!=0:
textarea.insert(END,f'\n{fol1.get()}\t\t{qq8.get()}\t\tسلة')
if qq9.get()!=0:
textarea.insert(END,f'\n{mlah1.get()}\t\t{qq9.get()}\t\tملاعقا')
if qq10.get()!=0:
textarea.insert(END,f'\n{skar1.get()}\t\t{qq10.get()}\t\tصينية')
if qq11.get()!=0:
textarea.insert(END,f'\n{flflahmar1.get()}\t\t{qq11.get()}\t\tوعاء
الخلط')
if qq12.get()!=0:
textarea.insert(END,f'\n{flflasoad1.get()}\t\t{qq12.get()}\t\tفتاحة
العلب')
if qq13.get()!=0:
textarea.insert(END,f'\n{lobia1.get()}\t\t{qq13.get()}\t\tمقشرة')
if qq14.get()!=0:
textarea.insert(END,f'\n{admami1.get()}\t\t{qq14.get()}\t\tلوح
التقطيع')
if qq15.get()!=0:
textarea.insert(END,f'\n{qmah1.get()}\t\t{qq15.get()}\t\tحفارة')
if qq16.get()!=0:
textarea.insert(END,f'\n{shair1.get()}\t\t{qq16.get()}\t\tسلة
قمامة')
if qq17.get()!=0:
textarea.insert(END,f'\n{shofan1.get()}\t\t{qq17.get()}\t\tمنفضة')
if qq18.get()!=0:
textarea.insert(END,f'\n{zara1.get()}\t\t{qq18.get()}\t\tاكياس')
if qqq1.get()!=0:
textarea.insert(END,f'\n{rez2.get()}\t\t{qqq1.get()}\t\tمكنسة')
if qqq2.get()!=0:
textarea.insert(END,f'\n{borgel2.get()}\t\t{qqq2.get()}\t\tتلفزيون')
if qqq3.get()!=0:
textarea.insert(END,f'\n{fasoli2.get()}\t\t{qqq3.get()}\t\tغسالة')
if qqq4.get()!=0:
textarea.insert(END,f'\n{ades2.get()}\t\t{qqq4.get()}\t\tمكرويف')
if qqq5.get()!=0:
textarea.insert(END,f'\n{makrona2.get()}\t\t{qqq5.get()}\t\tخلاط')
if qqq6.get()!=0:
textarea.insert(END,f'\n{frika2.get()}\t\t{qqq6.get()}\t\tفرن
غاز')
if qqq7.get()!=0:
textarea.insert(END,f'\n{homes2.get()}\t\t{qqq7.get()}\t\tمقلاة
كهرباء')
if qqq8.get()!=0:
textarea.insert(END,f'\n{fol2.get()}\t\t{qqq8.get()}\t\tمروحة
سقف')
if qqq9.get()!=0:
textarea.insert(END,f'\n{mlah2.get()}\t\t{qqq9.get()}\t\tمروحة
ارضية')
if qqq10.get()!=0:
textarea.insert(END,f'\n{skar2.get()}\t\t{qqq10.get()}\t\tتلفزيون
32')
if qqq11.get()!=0:
textarea.insert(END,f'\n{flflahmar2.get()}\t\t{qqq11.get()}\t\tتلفزيون
43')
if qqq12.get()!=0:
textarea.insert(END,f'\n{flflasoad2.get()}\t\t{qqq12.get()}\t\tفلتر
ماء')
if qqq13.get()!=0:
textarea.insert(END,f'\n{lobia2.get()}\t\t{qqq13.get()}\t\tغسالة
اوتوماتيك')
if qqq14.get()!=0:
textarea.insert(END,f'\n{admami2.get()}\t\t{qqq14.get()}\t\tمكواة')
if qqq15.get()!=0:
textarea.insert(END,f'\n{qmah2.get()}\t\t{qqq15.get()}\t\tميروة')