Комментарии:
Thanks Man
ОтветитьLove you man
ОтветитьActually I tried out with the same syntax but when I checked it out in the rdbms it is still showing the record which was apparently deleted!
ОтветитьIs it possible to change the ID of a record? so if i wanted to add a specific record to appear at a specific part of the list rather than just showing on the bottom? ( I figure changing the ID is the easiest way to do this, if not, is there another way of making that happen?)
Ответитьte amo < 3
ОтветитьNice
Ответитьanyone else here for the comp sci IA for the IB?
Ответитьbro , i wanna application to see my database pls
ОтветитьThanks very much for these videos, definitely buying your course. Quick question though: I'm trying to do a similar sort of database app, but I want it such that whenever a new person is added, a tab for their name appears on the root window (Successfully done). When this tab (button) is clicked, all the other details about them (last name, address etc) should be displayed in a window. Also, when you initially start the app, tabs/buttons for all people created the last time the app was used are automatically created on the root window (successfully done). The problem I'm having is that when these buttons are clicked, they open the window with all the details for the last added person instead of for the person who's name is shown on the button. To create the buttons on the root window, I used a for loop which goes through all names within the database. For each name, it creates a button and adds it to row = n on the root window, before doing n=n+1, so that the next button is added to the row below. (All the buttons do come out in the correct places with the correct names). For the creation of each button, I am using: nameButton = tk.Button(root, text=current_name, command=lambda: accessUserData(current_name)) Where current_name is the string of the name of the person, and accessUserData is a separate function which displays all the other data about the person, given that you've provided the persons name as the argument. So for each cycle in the for loop which is creating the buttons, current_name is incrementally taking the value of each persons name within the database. I'm guessing my issue is that I've severely misunderstood how I should be mapping those assignments for each button in the for loop, but I can't figure out what I should be doing. I'm also suspecting this design I'm using would be frowned upon by those who practice good code, but really hoping you can help nonetheless!
ОтветитьIs it works if the query inside execute are in small case..?
ОтветитьAmazing series on Tkinter 🔥 🔥
everything is working fine but there is some issue in my query label.
Can you provide the code of this video?
Is there any way that I can select and delete a record from a Tree View and it will include deleting also the record from the sqlite3 database?
ОтветитьReally, thank you
ОтветитьI always get this "_tkinter.TclError: bad screen distance "10 0"" :(
ОтветитьWhy I still error, appear "indentation error :unexpected indent , "{"
Ответитьit give me sqlite3.OperationalError: no such table: addresses, i downloaded your code from Github! any Suggestions
Ответитьshare create video for Desktop application Master Detail form in Python - Like (Sales Order From , Purchase Order Form)
Ответитьpyodbc.ProgrammingError: ('The SQL contains 0 parameter markers, but 1 parameters were supplied', 'HY000')
A mistake appears to me when adding
Please help
Dear Sir
Thank you for the wonderful effort
What's the different between padx pady and ipadx ipady
ОтветитьHow to get a delete button next to each entry?
ОтветитьHi John I'm making my own database app. I need a bit of help and the code is very similar to the code in this video,
Error message: line 82, in delete
cursor.execute("DELETE from links WHERE oid = " + delete_box.get())
sqlite3.OperationalError: incomplete input
I've been trying to figure it out for at least 2 days now and still can't figure it out so I turned to you
Thank you in advance. Keep up the amazing work🏆🏆🏆👍👍👍.
Code:
from tkinter import *
import sqlite3 as sql
import time as t
import random as r
from PIL import ImageTk as ITk, Image as I
import webbrowser as wb
wn = Tk()
wn.title("Link Saver")
wn.configure(bg="slategray1")
wn.geometry("300x430")
wn.iconbitmap('LS.ico')
connection = sql.connect('links.db')
cursor = connection.cursor()
cursor.execute("""CREATE TABLE IF NOT EXISTS links (
link_1
)""")
def submit():
connection = sql.connect("links.db")
cursor = connection.cursor()
cursor.execute("INSERT INTO links VALUES (:link_1)",
{
"link_1": Link_Entry.get()
})
connection.commit()
connection.close()
Link_Entry.delete(0, END)
def query():
connection = sql.connect("links.db")
cursor = connection.cursor()
cursor.execute("SELECT *, oid FROM links")
records = cursor.fetchall()
def callback(url):
wb.open_new(url)
print_records = ""
window = Toplevel()
window.title("RECORDS")
window.geometry("355x700")
window.iconbitmap('LS.ico')
window.configure(bg="slategray1")
delete_box = Entry(window, width=30, relief=SOLID, fg="black")
delete_box.grid(row=20, column=1, ipadx=10)
delete_box = globals
delete_box_label = Label(window, text="Select ID", relief=SOLID)
delete_box_label.grid(row=20, column=0)
delete_button = Button(window, text="DELETE RECORD", command=delete, bg="red3", activebackground="red", fg="black", height=2, relief=SOLID)
delete_button.grid(row=21, column=0, columnspan=2, pady=10, padx=10, ipadx=120)
for record in records:
print_records += str(record[0]) + " " + str(record[1]) + "\n"
query_label = Label(window, text=print_records, bg="slategray1")
query_label.grid(row=1, column=0, columnspan=3)
connection.commit()
connection.close()
def delete():
connection = sql.connect("links.db")
cursor = connection.cursor()
delete_box = Entry(wn, width=30, relief=SOLID, fg="black")
delete_box.grid(row=20, column=1, ipadx=10)
cursor.execute("DELETE from links WHERE oid = " + delete_box.get())
delete_box.delete(0, END)
connection.commit()
connection.close()
def open_window():
window2 = Toplevel()
window2.title("INFO")
window2.iconbitmap('LS.ico')
window2.configure(bg="slategray1")
label1 = Label(window2, text="LinkSaver is used for storing and remembering links.", bg="slategray1")
label1.grid(column=0, row=0)
label2 = Label(window2, text="How To Use:", bg="slategray1")
label2.grid(column=0, row=1)
label3 = Label(window2, text=" 1. Copy your link into the entry box.", bg="slategray1")
label3.grid(column=0, row=2)
label4 = Label(window2, text=" 2. Press on the SAVE button.", bg="slategray1")
label4.grid(column=0, row=3)
label5 = Label(window2, text=" 3. Go to the folder where LinkSaver is in and look for a file called links.db.", bg="slategray1")
label5.grid(column=0, row=4)
label6 = Label(window2, text=" 4. Open links.db and your links will be inside or click on SHOW RECORDS.", bg="slategray1")
label6.grid(column=0, row=5)
LinkSaver = ITk.PhotoImage(I.open("LinkSaver.gif"))
LinkSaver_Label = Label(image=LinkSaver, relief=SOLID)
LinkSaver_Label.grid(column=0, row=0)
blank = Label(wn, bg="slategray1")
blank.grid(column=0, row=2)
Info_Button = Button(wn, bg="white", text="INFO", width=34, height=1, activebackground="black", activeforeground="white", relief=SOLID, command=open_window)
Info_Button.grid(column=0, row=3)
blank = Label(wn, bg="slategray1")
blank.grid(column=0, row=4)
Link_Entry = Entry(wn, width=41, relief=SOLID)
Link_Entry.grid(column=0, row=5, padx=28)
blank = Label(wn, bg="slategray1")
blank.grid(column=0, row=6)
Save = Button(wn, bg="white", text="SAVE", width=34, height=1, activebackground="black", activeforeground="white", relief=SOLID, command=submit)
Save.grid(column=0, row=7)
blank = Label(wn, bg="slategray1")
blank.grid(column=0, row=8)
query_button = Button(wn, text="SHOW RECORDS", command=query, bg="white", activebackground="black", activeforeground="white", height=1, relief=SOLID)
query_button.grid(row=9, column=0, columnspan=2, ipadx=74)
blank = Label(wn, bg="slategray1")
blank.grid(column=0, row=10)
while True:
zero = 0
t.sleep(zero)
wn.mainloop()
Thank you John !
ОтветитьHi, thank you very much for your video.
ОтветитьWhat could I do to update oids' when I delete a record? I mean, when there are 3 records and I'll delete the 2nd one, there will be 2 records with oid 1 and 3. I need to automatically update oids' to 1 and 2. Is there any easy way to implement it?
Ответитьor can you just give the whole code so i can try to fix it myself and thank you again you really are an amazing person
Ответитьhello sir i am facing a problem all did is that i removed zipcode and and changed the text boxes and labels like the address to email and other stuff
and i didnt make it only print the f_name and l_name I made it print all the information and then when i closed the app and returned after 2 hours they gave me this error:
IndexError: tuple index out of range
why what did i do wrong??
it doesnt work why? the terminal shows no errors still the record is not deleted
Ответитьi like ur intro
ОтветитьYou are just amazing 🔥🔥🔥
ОтветитьHow do you use the .get() function to select a item to delete without it being a label but just as an item in the database?
Ответитьcan you delete by name? for example, you make a variable called name,the user enters the name, and you can do c.execute("DELETE from adresses WHERE prodname="+name)
ОтветитьIs it possible to make the same program by writing to a file, and then printing what's added?
Ответитьseems like getting crazy is adding tab :):)
Ответить"What happened in Vegas stays in Vegas "
ОтветитьHi. Is it possible to delete a specific word(every time it will be another word ) instead of primaryKey, that is given from input in the box "delete"?
ОтветитьLast videos: Sorry for my typings, its friday in Vegas.... This video: its monday morning, u gotta bear with me... Haha, Im waiting for the next days ;) Good videos btw!! keep it up!
Ответитьwhen I try to it, but not with oid with f_name it says no column
c.execute("DELETE FROM addresses WHERE f_name="+delete_box.get())
the output shows "no such column as john"
what to do master?
which software are you using for recording your screen and face(without background)
Ответитьhow can i clear my output on label?
ОтветитьClear and nice
ОтветитьFor some reason my program keeps freezing whenever I press the delete button to try and delete a record. Any idea why?
Ответить