-
Notifications
You must be signed in to change notification settings - Fork 315
Learning curve to use LLMs (Large Langage Models, like ChatGPT), your new Programming 102 #1220
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
detail of the Chat with "free" included Edge assistant Me : can you write a python GUI program with tcl/tk that displays two lists of strings in two separate table, and we can drag & drop a string from one table to the other ? Edge : Yes, I can help you with that. Here’s a sample Python GUI program that uses the Tkinter library to display two lists of strings in two separate tables and allows you to drag and drop a string from one table to the other:
import tkinter as tk
from tkinter import ttk
class DragDropTable(tk.Frame):
def main(): if name == 'main': Edge : This program uses the ttk.Treeview widget to create two tables and adds some sample data to them. It also allows you to drag and drop items between the tables by binding the and events. You can modify this program to display your own data and customize it as per your requirements. Let me know if you have any questions. Me : if I try it, there is an error ttributeError: 'Treeview' object has no attribute 'coords' Edge: I’m sorry to hear that. The error message you’re seeing (AttributeError: 'Treeview' object has no attribute 'coords') indicates that the coords() method is not available for the Treeview widget. This is because the coords() method is only available for canvas items, not for treeview items.
import tkinter as tk
from tkinter import ttk
class DragDropTable(tk.Frame):
def main(): if name == 'main': Edge : This should fix the error and allow you to drag and drop items between the tables. Let me know if you have any other questions. Me: whe I tryt to move Item9 from Table1 to table2, I get an error: self.tk.call(self._w, "move", item, parent, index) _tkinter.TclError: Item 43 not found Edge: I’m sorry to hear that you’re still having issues. The error message you’re seeing (_tkinter.TclError: Item 43 not found) indicates that the item you’re trying to move (Item 9) is not found in the table.
import tkinter as tk
from tkinter import ttk
This should fix the error and allow you to drag and drop items between the tables. Let me know if you have any other questions.
class DragDropTable(tk.Frame):
def main(): if name == 'main': Me: now the error is, for the same action: new_parent = widget2.insert("", "end", text=widget.item(item)["text"]) ^^^^^^^ NameError: name 'widget2' is not defined Edge : I’m sorry to hear that you’re still having issues. The error message you’re seeing (NameError: name 'widget2' is not defined) indicates that the widget2 variable is not defined in the code.
import tkinter as tk
from tkinter import ttk
class DragDropTable(tk.Frame):
def main(): if name == 'main': This should fix the error and allow you to drag and drop items between the tables. Let me know if you have any other questions. Me : when I click on any element on the table1 list, I have this error : File "xxxxxxxxxxxxxxxxxxx/edge-tcl_v04.py", line 45, in on_motion item = widget.selection()[0] ~~~~~~~~~~~~~~~~~~^^^ IndexError: tuple index out of range Edge : I’m sorry to hear that you’re still having issues. The error message you’re seeing (IndexError: tuple index out of range) indicates that the selection() method is returning an empty tuple.
import tkinter as tk
from tkinter import ttk
class DragDropTable(tk.Frame):
def main(): if name == 'main': This should fix the error and allow you to drag and drop items between the tables. Let me know if you have any other questions. Me: now, it works when I want to move elements from table1 to table2, but notihng happens if I want to move items from table2 to table1. can we have also this functionality ? Edge: import tkinter as tk class DragDropTable(tk.Frame):
def main(): if name == 'main': Edge: This should allow you to drag and drop items between both tables. Let me know if you have any other questions. Me : it works, I'm impressed. |
Next step trying to make it work on a weak PC: if it can run on a iphone at 1 word every 7 seconds, it may work on a PC. |
There is no doubts that the "art of programming" is going to evolve into "the art of making the machine programming", as:
Let see on one problem:
First, attend the free lesson from AndrewNg + Isa Fulford:
https://deeplearning.ai/short-courses/chatgpt-prompt-engineering-for-developers/
Second, let try it on our initial failed attempt to get help
"WinPython (lightweight) control panel GUI requests unavailable PyQt
result was a success, with detail Q&A (per a beginner) below.
To summarize :
The text was updated successfully, but these errors were encountered: