Need guidance on how to use Tkiner in visual studio. The tkiner program doesn't run, it shows as a syntax error. Code: from tkinter import* import tkinter.messagebox class Library:     def __init_(self,root):         self.root = root         self.root.title("Library Inventory System")         self.root.geometry("1350x750+0+0")                 BookId = StringVar()         AuthorFullName=StringVar()         PublicationYear=StringVar()         BookTitle=StringVar()         num_copies=StringVar()             #===================Frames==========================#         MainFrame = Frame(self.root)         MainFrame.grid()                 TitleFrame = Frame(MainFrame, bd=2, padx=40, pady=8, bg="Cadet blue", relief=RIDGE)         TitleFrame.pack(side=TOP)                 self.libTitle =Label(TitleFrame, font=('arial',46,'bold'),text="Library Inventory System")         self.libTitle.grid(sticky=W)                 ButtonFrame =Frame(MainFrame,bd=2,width=1350,height=100,padx=20,pady=20,bg="Cadet Blue",relief=RIDGE)         ButtonFrame.pack(side=BOTTOM)                     FrameDetail = Frame(MainFrame,bd=0,width=1350,height=50,padx=20,relief=RIDGE )         FrameDetail.pack(side=BOTTOM)                     DataFrame = Frame(MainFrame,bd=0,width=1350,height=400,padx=20,pady=20,relief=RIDGE )         DataFrame.pack(side=BOTTOM)                     DataFrameLEFT = LabelFrame(DataFrame,bd=1,width=800,height=300,padx=20,relief=RIDGE                                     , font=('arial', 12,'bold'),text="Library Membership Info:",bg="Cadet Blue")         DataFrameLEFT.pack(side=LEFT)                     DataFrameRIGHT = LabelFrame(DataFrame,bd=1,width=450,height=300,padx=20,pady=3,relief=RIDGE                                     , font=('arial', 12,'bold'),bg="Cadet Blue",text="Book Detail:",)         DataFrameRIGHT.pack(side=RIGHT)         #===================Labels and Entries==========================#       if __name__=='__main__':      root =Tk()      application = Library(root)      root.mainloop() Error screenshot in the image.

Systems Architecture
7th Edition
ISBN:9781305080195
Author:Stephen D. Burd
Publisher:Stephen D. Burd
Chapter3: Data Representation
Section: Chapter Questions
Problem 3RP
icon
Related questions
Question

Need guidance on how to use Tkiner in visual studio.

The tkiner program doesn't run, it shows as a syntax error.

Code:

from tkinter import*
import tkinter.messagebox

class Library:
    def __init_(self,root):
        self.root = root
        self.root.title("Library Inventory System")
        self.root.geometry("1350x750+0+0")
       
        BookId = StringVar()
        AuthorFullName=StringVar()
        PublicationYear=StringVar()
        BookTitle=StringVar()
        num_copies=StringVar()
       
    #===================Frames==========================#
        MainFrame = Frame(self.root)
        MainFrame.grid()
       
        TitleFrame = Frame(MainFrame, bd=2, padx=40, pady=8, bg="Cadet blue", relief=RIDGE)
        TitleFrame.pack(side=TOP)
       
        self.libTitle =Label(TitleFrame, font=('arial',46,'bold'),text="Library Inventory System")
        self.libTitle.grid(sticky=W)
       
        ButtonFrame =Frame(MainFrame,bd=2,width=1350,height=100,padx=20,pady=20,bg="Cadet Blue",relief=RIDGE)
        ButtonFrame.pack(side=BOTTOM)
           
        FrameDetail = Frame(MainFrame,bd=0,width=1350,height=50,padx=20,relief=RIDGE )
        FrameDetail.pack(side=BOTTOM)
           
        DataFrame = Frame(MainFrame,bd=0,width=1350,height=400,padx=20,pady=20,relief=RIDGE )
        DataFrame.pack(side=BOTTOM)
           
        DataFrameLEFT = LabelFrame(DataFrame,bd=1,width=800,height=300,padx=20,relief=RIDGE
                                    , font=('arial', 12,'bold'),text="Library Membership Info:",bg="Cadet Blue")
        DataFrameLEFT.pack(side=LEFT)
           
        DataFrameRIGHT = LabelFrame(DataFrame,bd=1,width=450,height=300,padx=20,pady=3,relief=RIDGE
                                    , font=('arial', 12,'bold'),bg="Cadet Blue",text="Book Detail:",)
        DataFrameRIGHT.pack(side=RIGHT)
        #===================Labels and Entries==========================#      
if __name__=='__main__':
     root =Tk()
     application = Library(root)
     root.mainloop()
Error screenshot in the image.
 
Los
40
A
File
Edit Selection View Go
EXPLORER
✓ TKINER PROJECT
✓ Include
> Lib
✓
Scripts
> _pycache_
activate
activate.bat
> Activate.ps1
deactivate.bat
ipython.exe
ipython3.exe
= jupyter-kernel.exe
= jupyter-kernelspec.exe
jupyter-migrate.exe
= jupyter-run.exe
= jupyter-troubleshoot.exe
Ejupyter.exe
Epip.exe
= pip3.10.exe
Epip3.exe
= pygmentize.exe
= python.exe
= pythonw.exe
pywin32_postinstall.py
pywin32_testall.py
> share
✰ pyvenv.cfg
→ Lib_DB.py
Library Database.py
> TIMELINE
Run Terminal Help
→ Library Database.py X
Library Database.py > ...
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
PROBLEMS OUTPUT DEBUG CONSOLE
>>> & "C:/Users
File "<stdin>", line 1
& "c:/Users
SyntaxError: invalid syntax
if
MainFrame.grid()
TERMINAL
TitleFrame = Frame (MainFrame, bd=2, padx=40, pady=8, bg="Cadet blue", relief=RIDGE)
TitleFrame.pack (side=TOP)
self.libTitle =Label(Title Frame, font=('arial', 46, 'bold'),text="Library Inventory System")
self.libTitle.grid (sticky=W)
ButtonFrame =Frame (MainFrame, bd=2,width=1350,height=100, padx=20, pady=20, bg="Cadet Blue", relief=RIDGE)
ButtonFrame.pack(side=BOTTOM)
FrameDetail = Frame (MainFrame, bd=0,width=1350,height=50, padx=20,relief=RIDGE)
FrameDetail.pack(side=BOTTOM)
Library Database.py - Tkiner Project - Visual Studio Code
DataFrame = Frame (Main Frame, bd=0,width=1350,height=400, padx=20, pady=20,relief=RIDGE)
DataFrame.pack(side=BOTTOM)
DataFrameLEFT = LabelFrame (DataFrame, bd=1,width=800,height=300, padx=20,relief=RIDGE
DataFrameLEFT.pack(side=LEFT)
DataFrameRIGHT = LabelFrame (DataFrame, bd=1,width=450,height=300, padx=20, pady=3, relief=RIDGE
font-('arial', 12, 'bold'), bg="Cadet Blue", text="Book Detail:",)
DataFrameRIGHT.pack(side-RIGHT)
#=======
_main__':
name
root =Tk()
application = Library (root)
root.mainloop()
,
ر
font-('arial', 12, 'bold'), text="Library Membership Info:", bg="Cadet Blue")
====Labels and Entries======
=======#
Desktop/Tkiner Project/studysession/Scripts/python.exe" "c:/Users/sosna/Desktop/Tkiner Project/Library_Database.py"
Project/studysession/Scripts/python.exe" "c:/Users/sosna/Desktop/Tkiner Project/Library_Database.py"
Desktop/Tkiner
Python + ✓
D
8
1
8
x
>
|>
>
Transcribed Image Text:Los 40 A File Edit Selection View Go EXPLORER ✓ TKINER PROJECT ✓ Include > Lib ✓ Scripts > _pycache_ activate activate.bat > Activate.ps1 deactivate.bat ipython.exe ipython3.exe = jupyter-kernel.exe = jupyter-kernelspec.exe jupyter-migrate.exe = jupyter-run.exe = jupyter-troubleshoot.exe Ejupyter.exe Epip.exe = pip3.10.exe Epip3.exe = pygmentize.exe = python.exe = pythonw.exe pywin32_postinstall.py pywin32_testall.py > share ✰ pyvenv.cfg → Lib_DB.py Library Database.py > TIMELINE Run Terminal Help → Library Database.py X Library Database.py > ... 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 PROBLEMS OUTPUT DEBUG CONSOLE >>> & "C:/Users File "<stdin>", line 1 & "c:/Users SyntaxError: invalid syntax if MainFrame.grid() TERMINAL TitleFrame = Frame (MainFrame, bd=2, padx=40, pady=8, bg="Cadet blue", relief=RIDGE) TitleFrame.pack (side=TOP) self.libTitle =Label(Title Frame, font=('arial', 46, 'bold'),text="Library Inventory System") self.libTitle.grid (sticky=W) ButtonFrame =Frame (MainFrame, bd=2,width=1350,height=100, padx=20, pady=20, bg="Cadet Blue", relief=RIDGE) ButtonFrame.pack(side=BOTTOM) FrameDetail = Frame (MainFrame, bd=0,width=1350,height=50, padx=20,relief=RIDGE) FrameDetail.pack(side=BOTTOM) Library Database.py - Tkiner Project - Visual Studio Code DataFrame = Frame (Main Frame, bd=0,width=1350,height=400, padx=20, pady=20,relief=RIDGE) DataFrame.pack(side=BOTTOM) DataFrameLEFT = LabelFrame (DataFrame, bd=1,width=800,height=300, padx=20,relief=RIDGE DataFrameLEFT.pack(side=LEFT) DataFrameRIGHT = LabelFrame (DataFrame, bd=1,width=450,height=300, padx=20, pady=3, relief=RIDGE font-('arial', 12, 'bold'), bg="Cadet Blue", text="Book Detail:",) DataFrameRIGHT.pack(side-RIGHT) #======= _main__': name root =Tk() application = Library (root) root.mainloop() , ر font-('arial', 12, 'bold'), text="Library Membership Info:", bg="Cadet Blue") ====Labels and Entries====== =======# Desktop/Tkiner Project/studysession/Scripts/python.exe" "c:/Users/sosna/Desktop/Tkiner Project/Library_Database.py" Project/studysession/Scripts/python.exe" "c:/Users/sosna/Desktop/Tkiner Project/Library_Database.py" Desktop/Tkiner Python + ✓ D 8 1 8 x > |> >
Expert Solution
steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
Study of Characters
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Systems Architecture
Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning