Write a simple python 3.12 program for a table with a simple gui. The gui should have…
- User
Write a simple python 3.12 program for a table with a simple gui. The gui should have two tables one for movies and one for series. The movie one should have the following fields: Movie (text field), Year (integer field), Present (boolean field), Watched (boolean field), Notes (text field). The series table should have the following fields: Series (text field), Seasons (text field), Year (text field), Present (boolean field), Seasons Present (text field), Complete (boolean field), Watched (boolean field), "Seasons (Seen)" (text field), Notes (text field). Think step by step.
- Assistant
- User
The tables should be editable. I want to write thinks in them based on the type specifications i gave. Also the Data should be saved even if the program closes and if it opens again it should reload.
- Assistant
- User
how to install sqlite3
- Assistant
SQLite is included by default with Python's standard library, so you typically don't need to install anything extra to use it in Python applications. You can use the
sqlite3module directly without additional steps if you already have Python installed. You can check this by running a simple Python script or command in an interactive Python shell: - User
currently it open a large white space when i click on a field to type something in i want the typing to happen only with in the field
- Assistant
- User
the typing field should align exactly like the actual field in the gui. Dont open a new field just allow the typing within the field that is shown in the gui
- Assistant
- User
modify the gui so that there is a bar on the left side with a field Movies and below that a field Series. Right to the bar for the rest of the gui there is a white field. If the user clicks on movies the movie tab opens and if he clicks on series the series tabs opens
- Assistant
- User
It should switch between them if the user clciks movies only the movie field opens and nothing else. If the series field is open closes it. And wise versa.
- Assistant
- User
save datat automaticly after typing it in
- Assistant
- User
Traceback (most recent call last): File "D:\Bilder\Python\0. Code\Calculator 5 - Kopie.py", line 134, in load_data() File "D:\Bilder\Python\0. Code\Calculator 5 - Kopie.py", line 45, in load_data for row in run_query('SELECT * FROM movies'): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: 'NoneType' object is not iterable
- Assistant
The error you're encountering (
TypeError: 'NoneType' object is not iterable) suggests that therun_queryfunction is returningNoneinstead of a result set that can be iterated over. This typically occurs because the SQL query execution isn't fetching results properly, possibly due to it being an action query instead of a data retrieval query.In your function, the SQL SELECT statement should return rows from your database. However, it looks like the function isn't configured to return the result of a query that produces a result set. Here’s how you can adjust the function:
- User
print the corrected code in full
- Assistant