Questions tagged [sqlite3-python]

83 questions
0
votes
2 answers

Can't write to file in Google Cloud

Currently, I have an SQL Database that I wish to edit locally. This is for a flask app made in python 3, using sqlite3. con = sqlite3.connect('Database/accounts.db') cur = con.cursor() cur.execute(f"INSERT INTO Requests (Type, Argument, Priority,…
Yen
  • 19
  • 4
0
votes
0 answers

delete problem python and tkinter with sqlite3

here is my code def delete(): con = sqlite3.connect("Cadets2.db") cr = con.cursor() selectedItem = self.cadet_table.selection()[0] self.cadet_table.delete(selectedItem) …
Aperion9
  • 1
  • 1
0
votes
0 answers

Error :'int' object is not subscriptable, while displying output from SQLite to Python code

I am using SQLite in Python to store and retrieve data. This is my Python code: # Read API key API_KEY = os.environ["API_KEY"] # Create bot object bot = telebot.TeleBot(API_KEY) # Connect to database conn = sqlite3.connect('message_tracker.db',…
VikaS GuttE
  • 1,636
  • 2
  • 14
  • 38
0
votes
1 answer

Raw SQLite3 command in Django

I am trying to join 2 tables to display the orders that are matched to the username for the currently logged in user using SQLITE3, I have the SQL raw command written but I recieve the error: there is no such table Account. I have checked using the…
0
votes
1 answer

ValueError: Cannot assign "value" "Order.dish_name" must be a "Dish" instance

I am writing a restaurant app in Django and I have a specific view that catches an Ajax request. From this request I get the name of a dish, which I try to save in a new object Order. I keep getting this error " ValueError: Cannot assign "'pasta'":…
bhe
  • 15
  • 3
0
votes
0 answers

discord.py, sqlite3 eco bot sqlite3.OperationalError: table users has 4 columns but 5 values were supplied

cmd get this error File "C:\Users\bliaf\AppData\Local\Programs\Python\Python311\Lib\site-packages\discord\client.py", line 441, in _run_event await coro(*args, **kwargs) File "C:\Users\bliaf\OneDrive\Рабочий стол\BotCord\bot.py", line 26, in…
Venzo
  • 1
0
votes
1 answer

Tkinter/Python: text from earlier searches doesn't disappear

I created a window in Tkinter. With a combobox you select a name (from a SQLite3 database). It shows other data from this row in the database (email etc). However: when I choose another name in the combobox, earlier data is still visible (see…
Djonie
  • 3
  • 3
0
votes
0 answers

sqlite3 in python. Problem with alert in SQL query

I have a problem with alert in python. The goal is to have a notification that will tell me when I enter radno_mesto = 'programer'. However, I am not getting any notification. What's the problem with the code? import sqlite3 konekcija =…
0
votes
0 answers

How do I maintain the original increment after deleting records from my database?

I have a database created with its id on autoincrement. However after deleting records and adding a new record, the id of the new record started from the id of the last deleted record instead of the id of the last available record My data…
Echo
  • 1
  • 1
0
votes
1 answer

The tkinter combobox does not work well with sqlite3 database

This is the simple code I want to execute. I want the elements of tkinter combobox come from sqlite3 database it does the job but It appends the first row and first column values many times(no of rows in database) . I want it to append the first…
0
votes
1 answer

Dynamic SQL queries with SQLite3

I would like to allow users to query a sql database. The database is here So the user will be able to enter the queries they want: csr_city= input("Enter a city >>").lower().strip().replace(' ','') csr_type = input("Enter a type…
ruthpozuelo
  • 175
  • 1
  • 10
0
votes
1 answer

Python, fernet decrypt turn my file read only

I'm with a personal proyect using python and sqlite3, the case is that i use fernet to encrypt the db file, but at decrypt the db it turn in a read only db and give me error at try do an INSERT. sqlite3.OperationalError: attempt to write a readonly…
Inoku
  • 39
  • 1
  • 5
0
votes
0 answers

Inserting pulled Pandas DF cells into SQLITE3 - Python

I have been banging my head trying to get my Sqlite table to update given the code below.. looping through Pandas dataframe cells in specific columns to update specific columns in the sqlite table given a date match. Everything works up until…
ShibbyBoss
  • 55
  • 1
  • 7
0
votes
0 answers

Getting a column full of selected column name instead of data in column (Python & SQLite3)

I have a sqlite file that I am trying to extract some data from, I established the connection and selected the columns that I wanted to save in a csv but when it saves it returns column with the column name repeated. The number of rows is the same…
Tiggy
  • 11
  • 2
0
votes
0 answers

SQLite3 - How can I assign Variables from the data returned from a SQL Query?

I'm a total Noob and don't know how I can assign variables to the data returned from a SQL Query so that I can then manipulate it. The example below captures random data and not the results from the SQL Query. I'm using the Replit website with…