Which inputs does the ajouter function read as text?
ISBN, title, and author.
How does the ajouter function convert the page count and price?
It converts the page count to an integer and the price to a float.
Where does the ajouter function place the new book dictionary?
At t[n].
What does the ajouter function do after placing the dictionary at t[n]?
It increments n and calls afficher.
What does the afficher function do with the first n records?
It displays their ISBN, title, author, page count, and price in form.aff.
What does the enregistrer function do with helicopter.txt?
It opens the file in write mode.
What does the enregistrer function write to helicopter.txt?
The plain text from form.txt.
What formula calculates the distance between an entered point and a helicopter point?
How does the search read helicopter.txt?
It opens the file in read mode and reads lines until an empty string.
How does the search parse helicopter coordinates from each line?
It splits each line around semicolons.
When does the search update the minimum distance?
When it finds a shorter distance.
What argument list initializes `QApplication` in the PyQt application pattern?
An empty argument list.
What starts the PyQt application event loop?
Calling `exec_()`.
Which function handles button clicks in the PyQt application pattern?
Connected functions handle button clicks.
What initial value does the book-record program assign to n?
0.
What does the book-record program create for t?
An array of 30 empty dictionaries.
Which keys does each book dictionary use?
ISBN, titre, auteur, nbpage, and prix.
How are the displayed book fields ordered?
ISBN, title, author, page count, then price.
What does the chercher function do with the entered point?
It splits the point at a semicolon and converts both coordinates to floats.
What value initializes the minimum distance, and what sets the final displayed value?
It starts at 10000000, and the displayed value is set from min.
Which files can the programs load their interface from using `loadUi`?
`interface-livre.ui` or `interface.ui`.
Which book-form button connects to `ajouter`?
`bt`.
Which helicopter-form button connects to `enregistrer`?
`bt1`.
Which helicopter-form button connects to `chercher`?
`bt2`.
Answer 9 questions on Python GUI and File Handling.
1. A user enters ISBN, title, and author as text, followed by a page count and price. What does `ajouter` do with these values when it successfully adds the book?
2. Which set of dictionary keys should a newly created book record use?
Go over the full study guide for Python GUI and File Handling.
Read the study guide →Upload your class notes and Revizly writes your flashcards in about a minute.
Flashcard maker