This is my first ever using python (dabbled in C++ and javascript in the past, but always got confused), this is amazing, thank you, so easy to follow and I have learnt a lot. I also added SHOWINFO (same way as showwarning, if anyone needs it) for the save, so a messagebox comes up letting me know it has saved
Bruh Seriously Ur Soooo good I hv seen some other tutorials about a to do list and they are like So just write this billion lines then this under a second lol keep going all the best
I added a button for clearing all items on the todo list, thank you for posting this tutorial! It was very helpful.... *Update I also added a button to include date time :)
nice i made skeleton of GUI meaning frontend part but i had difficulty to figure out backend part like functions with tkinter. thank you i get load and save functions , scrollbar and warnings.
Excellent tutorial, really helped me understand how to make an app with tkinter. Even managed to do the last try/except block before you showed how to do it :)
As soon as you said "test it" (so that I wouldn't pay the price later) I ran my code and realized I entered a period after height=3 instead of a comma. If I had left it and tried testing much later it could have been very time consuming to debug. Lesson learned! LOL
Thank you on this. So helpful. Please help. I want to add show warning message box when the user wants to save tasks but the list box is currently empty. Is that possible?
hey there just wanted to ask can we convert all this into a proper app that doesn't require the code to run. Maybe you could do a tutorial on that. If not possible no problem👍 You are the best teacher by the way
just a suggestion: when you add a task, you made like this: def add_task(): if task != "": But if you add some whitespaces it will still add the task. that's why it should look like this: def add_task(): if task.strip() != "": So now even if you input multiple whitespaces, it won't add the task
You explained well in simple way. Thanks for making this video . These types of video brings more curiosity about coding. how can I know more about all modules such as tkinter , pickles, etc? Where I can get all basics of tkinter etc ?
Do you have a scheduler task related one that you have certain times for doing tasks and maybe operate a web site at the appointed time? or something like that?
just a question about the scrollbar, why do we really need it? i noticed that even without it, i can scroll on my touchpad using 2 fingers, and it works
how would you write at pytest for this program? I am trying to figure out scenarios to test possible problems, but I can't seem to figure out how to do, especially for the first fuction. any advise??
Hey man! really appreciate your help by teaching us and helping the society. I have one question from this video - the variable "task" you defined in add_task function is a local variable right? then how are accessing "task" variable in load_task function? Are they different variable but same name ? sorry if i sound stupid. one more question - can you help me understand for using the line "for task in tasks" inside load_task function? :)
Hiya - that's not a stupid question at all - it's a great question! I haven't looked at the code in a long time, but if you have for task in tasks, then that task is a local variable (part of the for loop in this case).
@@TokyoEdTech hey man ! Thanks for communicating with your audience ❤️ I did some research and tried to educate myself now when i rewrote the code alone (not to brag lol) i understood the process. Really enjoy your videos. Waiting for your next video ☺️
If you can help me with this problem I am on a Mac and I can’t get the scroll wheel to move on scroll at so when I click and move my cursor down it doesn’t seem to go down
Do you have a Raspberry pi? Also do you have any tips for someone trying to make videos in the same area? Ive have been trying for sometime and am getting almost no views
Hi. Sorry, I do not. But it is something I'd like to get into someday. It's really hard to get traction on UA-cam - takes lots and lots of time. It took me almost 2 years to get to 1000 subscribers, but I didn't release much during that time. I'm much more active now. I took a look at your channel. You need to update your landing page. Your channel name is awesome_pi_guy, but all I see is some Minecraft videos. Click the customize button and arrange your Pi videos at the top. Put the Minecraft videos in a separate section and add titles to them as well like you did to the PI videos. Finally, I'd make the head shot smaller so it takes up less of the screen and work on your lighting. Beyond that, keep making content...it's a loooong marathon, not a sprint.
Can you help me understand this? I have been creating widgets like this. label1 = Label(root) What is this actually? label1= tkinter.Label(root) Will both yield the same type of label? If not what is the meaning of writing the label code as tkinter.label rather than only 'Label'? Also the same in root= tkinter.Tk() and root =Tk() What is the difference?
I dont speak english good but his the traduction: The difference is that with the first form as used in the video you are importing so: import tkinter only in the second way that it is without tkinter you need to import like this: from tkinter import * ( or the module you want for example messagebox) I hope you understood me Español: La diferencia es que con el primera forma como usa en el video estas importando así: import tkinter solo que de la segunda forma que esta sin tkinter necesitas importar así: from tkinter import * ( o el modulo que quieras por ejemplo messagebox) espero que me hayas entendido
@@TokyoEdTech I have a question 'wb' basically rewwrites the old tasks with new ones and and all old tasks gets deleted. Is there way to append the new tasks to the old ones?
I'm using python idle to create this, eventually, when I load my tasks, it always shows the Tkinter popup that I created. Should I create a file called tasks.dat on my desktop?
I would like to add slide feature to this app, like press hold slide and put the task above another also I would like to delete the tasks putting a delete button over the task. How would you do that? Can you guide me?
@@TokyoEdTech Thanks, I am not familiar with Python how can I achieve what I want? And do you think this would make a good enough portfolio project for a new grad?
I'm not sure on either point. You could try a different GUI library such as QT. A portfolio should be your own work, not something copied from the Internet.
thank you for your useful Tutorial , but your program has a bug and please tell me how can i fix this bug . when we saved the tasks and restart the program, our data is repeated many times. sorry for my poor english
@@soroushbolbolabadi9305 Next time you think "your program has a bug", please check thoroughly. It'll help you become a better coder and save us both some time. Keep on codin'!
I was wondering if I could potentially use this as a side project for my resume, or if it would be considered plagiarism. If not that is completely fine, am just wondering
I personally, don't care. But if something is on your resume, it should reflect what you can do, not what I can do. I would take the concepts learned and make your own program. Or at least add features to the base program to show what you can do.
when you first open the todolist python program, the listbox will be empty by default. If you accidentally click the save button during this time, then you will save a blank listbox and override your previously stored errands. Is there a way around this or do you just need to be careful when pressing the save button at the beginning of the program (when the listbox is empty before you add or load errands)?
When I tried to ran it it show me this error , but the virable 'tasks' didn't reference before line 24 File "C:\.......\Python\To-Do_list.py", line 24, in load_tasks tasks = pickle.load(open(tasks.det, 'rb')) UnboundLocalError: local variable 'tasks' referenced before assignment pls help
@@TokyoEdTech I saw the same comment you replied to it but I am getting some error with it when I open the .txt file it's like question marks in rhombus shape then the text.
@@TokyoEdTech hello so it says that load task is not defined even though I already used Def And for the save button I wanna ask is it supposed to create the tasks.dat folder or am I supposed to create it because when I click save it doesn't appear anywhere I tried by downloading your code from the description but still when I hit save it doesn't appear anywhere
Hey man! My delete, save and load button does not work. One of the errors is " task.dat" cannot be found. THis is my code. I did it a liitle bit differently, but still the same structure as yours: import tkinter import tkinter.messagebox import pickle window = tkinter.Tk() window.title("ToDo list") # DEFINE FUNCTIONS def task_adding(): todo_list = task_add.get() if todo_list !="": # not equal to something todolist_box.insert(tkinter.END,todo_list) else: tkinter.messagebox.showwarning(title="Attention!", message="To add a task, please enter some task") def task_removing(): try: index_todo_list = list_frame.curselection()[0] list_frame.delete(index_todo_list) except: tkinter.messagebox.showwarning(title="Attention!", message="To delete a task, you must select a task") def task_loading(): try: todo_list = pickle.load(open("task.dat","rb")) list_frame.delete(0,tkinter.END) for todo_list in task_add: list_frame.inset(tkinter.END,todo_list) except: tkinter.messagebox.showwarning(title="Attention!", message="Cannot find task.dat") def task_saving(): todo_list = list_frame.get(0,list_frame.size()) pickle.dump(todo_list, open("task.dat","wb")) # CREATE GUI list_frame = tkinter.Frame(window) list_frame.pack() todolist_box = tkinter.Listbox(list_frame, height=20,width =20) todolist_box.pack(side=tkinter.TOP) scroller = tkinter.Scrollbar(list_frame) scroller.pack(side=tkinter.RIGHT, fill=tkinter.Y) # Location of scrollbar Y = Vertical todolist_box.config(yscrollcommand=scroller.set) # execute the scroller command task_add = tkinter.Entry(window, width = 70) # the window where I enter the tasks task_add.pack() task_add_button = tkinter.Button(window, text="Click to Add task", font=("Times New Roman",12,"bold"),background="red",width=40, command=task_adding) task_add_button.pack() task_remove_button = tkinter.Button(window, text=" Click to Delete task", font=("Times New Roman", 12, "bold"), background ="yellow", width=40, command=task_removing) task_remove_button.pack() task_load_button = tkinter.Button(window, text=" Click to Load task", font=("Times New Roman", 12, "bold"), background ="brown", width=40, command=task_loading) task_load_button.pack() task_save_button = tkinter.Button(window, text="Click to Save task", font=("Times New Roman", 12, "bold"), background = "blue", width = 40, command=task_saving) task_save_button.pack() window.mainloop()
Hello sir Love from india 🎉❤❤ i used and modified it for my school project, i just improved the ui a bit, (please do check it out sir, please 🥺) import tkinter as c import tkinter.messagebox import pickle win=c.Tk() win.geometry("300x400") win.config(bg="blue4") #heading c.Label(win,text="..Task List..",font="bruney 19 bold",bg="black",fg="gold").pack() #frame to show task============================================================ frame1= c.Frame(win,bd=2,bg="maroon") frame1.place(x=0,y=340,width=300,height=60) #frame2 frame2= c.Frame(win,bd=2,bg="lightblue1") frame2.place(x=0,y=305,width=300,height=35) ##======================================================================== #labelframe lf1=c.Label(win,text="write task:-",font="ariel 8 bold",bd=0) lf1.place(x=3,y=318,width=60,height=10) #================================ #entry field entry_task=c.Entry(win,bd=2) entry_task.place(x=64,y=312,width=232) ##======== #func for buttons def add_task(): task=entry_task.get() if task != "": listbox_tasks.insert(c.END,task) entry_task.delete(0,c.END) else: c.messagebox.showwarning(title="warning", message="you must enter a task") ## def del_task(): try: task_index=listbox_tasks.curselection()[0] listbox_tasks.delete(task_index) except: c.messagebox.showwarning(title="warning", message="you must select a task") ## def save_task(): tasks=listbox_tasks.get(0,listbox_tasks.size()) if len(tasks)!=0: pickle.dump(tasks,open("tasks.dat","wb")) else: c.messagebox.showwarning(title="warning", message="you must add a task") ## def load_data(): try: tasks=pickle.load(open("tasks.dat","rb")) listbox_tasks.delete(0,c.END) for task in tasks: listbox_tasks.insert(c.END,task) except: c.messagebox.showwarning(title="warning", message="you must have tasks") ## #def delall_task(): #tasks=pickle.load(open("tasks.dat","rb")) #if len(tasks) = 0: # c.messagebox.showwarning(title="warning", message="no past data") #lse:
I really enjoyed this tutorial and would really like to see more GUI ideas using tkinter. Thanks
Thanks. I'm definitely open to suggestions!
This is my first ever using python (dabbled in C++ and javascript in the past, but always got confused), this is amazing, thank you, so easy to follow and I have learnt a lot. I also added SHOWINFO (same way as showwarning, if anyone needs it) for the save, so a messagebox comes up letting me know it has saved
Thanks! Glad it was helpful. Good job adding the save confirmation. Keep on codin'!
Bruh Seriously Ur Soooo good I hv seen some other tutorials about a to do list and they are like So just write this billion lines then this under a second lol keep going all the best
Glad I could help!
Great video. Easy to understand glad i found this tutorial
Keep it up
Thanks - glad you found it helpful. Keep on codin'!
Hey great tutorial!!!
You're a very good teacher! I love the way you explain everything by translating code into sentences.
Thanks - glad you liked it! Keep on codin'!
I added a button for clearing all items on the todo list, thank you for posting this tutorial! It was very helpful.... *Update I also added a button to include date time :)
Awesome - I always encourage my students to add their own ideas...it's fun and a great way to learn. Keep on codin'!
This is my first project. I learned a lot. Thank you so much ❤
You're welcome - glad to hear it. Keep on codin'!
nice i made skeleton of GUI meaning frontend part but i had difficulty to figure out backend part like functions with tkinter.
thank you i get load and save functions , scrollbar and warnings.
You're welcome.
Excellent tutorial, really helped me understand how to make an app with tkinter. Even managed to do the last try/except block before you showed how to do it :)
Thanks - glad it was helpful. Keep on codin'!
As soon as you said "test it" (so that I wouldn't pay the price later) I ran my code and realized I entered a period after height=3 instead of a comma. If I had left it and tried testing much later it could have been very time consuming to debug.
Lesson learned! LOL
I'm very happy to hear someone is taking that lesson to heart!
Hey I like your videos! Im a beginner python learner!
Thanks - welcome to my channel!
Such easily and concisely explained!!
Thanks!
IK right
Does this project have DB connectivity too
Thanks! This really helped me! You have earned a new subscriber!
Welcome to the team..keep on codin'!
Really nice and simple project, thanks for the explanation
You're quite welcome - keep on codin'!
Thank you for this! I found it really helpful.
Glad it was helpful!
Scrollbar with grid
vsbar = Scrollbar(container, orient=VERTICAL, command=lista_tareas.yview)
vsbar.grid(row=0, column=1, sticky=NS)
lista_tareas.configure(yscrollcommand=vsbar.set)
Thanks!
thats the best thing anyone can do to help me in this time thank you sir
You are quite welcome - keep on codin'!
Nice tutorial it looks the second version of your to do list app👍
Thanks. Yep, version 2. The old one was written in Python 2, this one is in Python 3.
Your welcome
thank you sir, i needs a beginer project with a walk through
Glad you found it helpful!
Excellent tutorial, simple and straight to the point :), thank you.
Thanks - glad you liked it. Keep on codin'!
Good video, I learnt much!
Thanks - keep on codin'!
u r great teacher
Thank you, I try.
may I know, what algorithm are you using in this program? what are linked lists?
Yups, Linked list or array ?
@@yeobuustation It is just a simply list (array). A linked list is not necessary for this program.
you are helping me alot
Glad to hear it!
I love those Python GUI tutorials...
Thanks!
@@TokyoEdTech
You are always welcome!
Very cool!!!
Thanks- glad you liked it!
Thank you on this. So helpful. Please help. I want to add show warning message box when the user wants to save tasks but the list box is currently empty. Is that possible?
It should be if you use what is shown in this video.
hey there just wanted to ask can we convert all this into a proper app that doesn't require the code to run. Maybe you could do a tutorial on that. If not possible no problem👍
You are the best teacher by the way
Try searching for pyfreeze or py2exe / py2app.
just a suggestion: when you add a task, you made like this:
def add_task():
if task != "":
But if you add some whitespaces it will still add the task.
that's why it should look like this:
def add_task():
if task.strip() != "":
So now even if you input multiple whitespaces, it won't add the task
Awesome suggestion - thanks!
You explained well in simple way. Thanks for making this video . These types of video brings more curiosity about coding. how can I know more about all modules such as tkinter , pickles, etc? Where I can get all basics of tkinter etc ?
You're welcome. This is my go-to for tkinter info: effbot.org/tkinterbook/tkinter-index.htm
Can we add images or background Image in tkinter module ?
Yes. I don't know the exact code, but you should be able to find it in the docs.
@@TokyoEdTech OK thanks
thanks very much sir
You are welcome.
incredible channel
Thanks!
Do you have a scheduler task related one that you have certain times for doing tasks and maybe operate a web site at the appointed time?
or something like that?
I don't have that, but it would be a nice addition to the program.
im made an auto zoom program in python and i have a function that automatically join zooms at a specified time
@@urjitchakraborty5813 Cool!
At def load_task when I write except it says invalid syntax?
There is a link in the description labeled “NEED HELP?” Check that out and get back to me. Keep on codin’!
just a question about the scrollbar, why do we really need it? i noticed that even without it, i can scroll on my touchpad using 2 fingers, and it works
I'm pretty sure it is automatic - so if it is there you can ignore it.
Thanks, it is really useful.
You're welcome. Keep on codin'!
how would you write at pytest for this program? I am trying to figure out scenarios to test possible problems, but I can't seem to figure out how to do, especially for the first fuction. any advise??
Hmm...you'd probably need to check the list of tasks after each function call.
Hey man! really appreciate your help by teaching us and helping the society.
I have one question from this video - the variable "task" you defined in add_task function is a local variable right? then how are accessing "task" variable in load_task function? Are they different variable but same name ? sorry if i sound stupid.
one more question - can you help me understand for using the line "for task in tasks" inside load_task function?
:)
Hiya - that's not a stupid question at all - it's a great question! I haven't looked at the code in a long time, but if you have for task in tasks, then that task is a local variable (part of the for loop in this case).
@@TokyoEdTech hey man !
Thanks for communicating with your audience ❤️
I did some research and tried to educate myself now when i rewrote the code alone (not to brag lol) i understood the process.
Really enjoy your videos. Waiting for your next video ☺️
@@kingheisenberg674 You're welcome. Keep on codin'!
If you can help me with this problem I am on a Mac and I can’t get the scroll wheel to move on scroll at so when I click and move my cursor down it doesn’t seem to go down
Heya - check the link that says "NEED HELP?" and get back to me.
Nice video
Thanks Omar!
thanks a lot for this video..............
You are welcome - keep on codin'!
Hi Where do you download your gif images ?
I usually use openclipart.org - but you'll have to convert the images to the right size and to .gif format yourself.
@@TokyoEdTech Yeah, you can even use GIMP or www.piskelapp.com for online
I
@@TokyoEdTech OK thanks
Thank you 😊
You're welcome.
Do you have a Raspberry pi?
Also do you have any tips for someone trying to make videos in the same area? Ive have been trying for sometime and am getting almost no views
Hi. Sorry, I do not. But it is something I'd like to get into someday.
It's really hard to get traction on UA-cam - takes lots and lots of time. It took me almost 2 years to get to 1000 subscribers, but I didn't release much during that time. I'm much more active now.
I took a look at your channel. You need to update your landing page. Your channel name is awesome_pi_guy, but all I see is some Minecraft videos. Click the customize button and arrange your Pi videos at the top. Put the Minecraft videos in a separate section and add titles to them as well like you did to the PI videos. Finally, I'd make the head shot smaller so it takes up less of the screen and work on your lighting.
Beyond that, keep making content...it's a loooong marathon, not a sprint.
@@TokyoEdTech Thank you so much also i was thinking about putting my minecraft videos on a diffrent channel.
@@awesome_pi_guy That's probably a good idea - you want to focus on your niche.
@@TokyoEdTech Thank you for your time, keep doing what your doing and ill keep watching
@@awesome_pi_guy You're welcome - good luck with your channel!
Next video idea! Make a part 2 to this, but include a database, so the program can be closed, and the tasks still stay.
Watch the video - it has saving and loading of data.
@@TokyoEdTech I know, but I mean like a proper database using SQL.
@@Jan-bo4bf Why? A database is overkill for a simple app like this. Gotta use the right to for the job.
@@TokyoEdTech I think it would be a neat way to show people how to work with them. This program obviously doesn't need it.
@@Jan-bo4bf I see - that makes perfect sense. Thanks for the suggestion!
If listbox_task is emtpy how to not save it ?
I find solution :D
def save_tasks():
tasks = listbox_tasks.get(0, listbox_tasks.size())
check_is_empty = listbox_tasks.size()
if check_is_empty != 0:
pickle.dump(tasks, open("tasks.dat", "wb"))
else:
tkinter.messagebox.showwarning(title='Warning', message='There is noting to save')
Try something like:
if len(tasks)!=0:
# Save
Can you help me understand this?
I have been creating widgets like this.
label1 = Label(root)
What is this actually?
label1= tkinter.Label(root)
Will both yield the same type of label? If not what is the meaning of writing the label code as tkinter.label rather than only 'Label'?
Also the same in
root= tkinter.Tk() and
root =Tk()
What is the difference?
I dont speak english good but his the traduction:
The difference is that with the first form as used in the video you are importing so:
import tkinter
only in the second way that it is without tkinter you need to import like this:
from tkinter import * ( or the module you want for example messagebox)
I hope you understood me
Español:
La diferencia es que con el primera forma como usa en el video estas importando así:
import tkinter
solo que de la segunda forma que esta sin tkinter necesitas importar así:
from tkinter import * ( o el modulo que quieras por ejemplo messagebox)
espero que me hayas entendido
I think Mateo explained it quite well!
@@Teo-dw3ti Gracias!
@@TokyoEdTech I have a question
'wb' basically rewwrites the old tasks with new ones and and all old tasks gets deleted. Is there way to append the new tasks to the old ones?
This Helped Me a Lot, One question - will you be making more games in python. GREAT TUTORIAL
Glad to hear it! Yep, I'll be doing more eventually - stay tuned!
@@TokyoEdTech Thank you, excited for more.
I'm using python idle to create this, eventually, when I load my tasks, it always shows the Tkinter popup that I created. Should I create a file called tasks.dat on my desktop?
I'm not sure what you mean - the file will be created in the same folder as your .py file, or you can specify with the full path.
are you going to make any of the ultimate python turtle graphics turtorials???
I'm planning to add more videos to that - not sure the timing though - sorry.
@@TokyoEdTech thanks for letting me know, i thought you stopped
making video's on ultimate python turtle graphics !!
@@ruchi727 You're welcome. Yeah - I just wanted to try a few other things that had a more immediate application for me.
@@ruchi727 You're welcome. The more recent projects I've been doing are useful for my current students so I'm prioritizing them.
I would like to add slide feature to this app, like press hold slide and put the task above another also I would like to delete the tasks putting a delete button over the task. How would you do that? Can you guide me?
I don't think tkinter is that advanced to allow dragging if items in a listbox. Check the documentation to be sure.
@@TokyoEdTech Thanks, I am not familiar with Python how can I achieve what I want? And do you think this would make a good enough portfolio project for a new grad?
I'm not sure on either point. You could try a different GUI library such as QT. A portfolio should be your own work, not something copied from the Internet.
@@TokyoEdTech I will code the app myself for sure but I meant is it too simple or will it look good on resume anyways?
I do this with high school students so it might be a bit simple. You can build on it though and add features.
can this be put on a phone that does not have python?
No, sorry. You'd have to use something like Kivy if you want to use Python.
thank you for your useful Tutorial , but your program has a bug and please tell me how can i fix this bug .
when we saved the tasks and restart the program, our data is repeated many times.
sorry for my poor english
It's working fine on my computer - perhaps you copied the code incorrectly?
@@TokyoEdTech yeah my bad
@@soroushbolbolabadi9305 Next time you think "your program has a bug", please check thoroughly. It'll help you become a better coder and save us both some time. Keep on codin'!
Can you make a tutorial on making a text editor with tkinter?
I don't know a huge amount about that - making a simple text editor is really easy; however, color coding and syntax highlighting are not as easy.
Maybe like windows notepad?
I am not saying to make the next vs code, i am saying to make a simple application where you can save stuff and open stuff
@@aditgaur1585 This will get you started: www.tutorialspoint.com/python/tk_text.htm
Thank you so much!
I was wondering if I could potentially use this as a side project for my resume, or if it would be considered plagiarism. If not that is completely fine, am just wondering
I personally, don't care. But if something is on your resume, it should reflect what you can do, not what I can do. I would take the concepts learned and make your own program. Or at least add features to the base program to show what you can do.
when you first open the todolist python program, the listbox will be empty by default. If you accidentally click the save button during this time, then you will save a blank listbox and override your previously stored errands. Is there a way around this or do you just need to be careful when pressing the save button at the beginning of the program (when the listbox is empty before you add or load errands)?
You could add something like this:
if len(tasks)! =0:
# Save data
@@TokyoEdTech so simple i dont know why i couldn't think of that. thank you, sir!
You are welcome - keep on codin'!
When I tried to ran it it show me this error , but the virable 'tasks' didn't reference before line 24
File "C:\.......\Python\To-Do_list.py", line 24, in load_tasks
tasks = pickle.load(open(tasks.det, 'rb'))
UnboundLocalError: local variable 'tasks' referenced before assignment
pls help
Heya, can you paste all of your code here so I can take a look?
So, I fixed it by replacing the virebles;)
@@IntergalacticPotato1 Success!
First heart it!!
Gold!
I am not able to save tasks with pickle.dump
AttributeError: 'function' object has no attribute 'dump' ⬅ it is showing this line
Can you share all of your code and I'll take a look.
@@TokyoEdTech I saw the same comment you replied to it but I am getting some error with it when I open the .txt file it's like question marks in rhombus shape then the text.
@@krishnataneja5181 Yes, that is what pickle does.
Hola puedes enseñarnos a usar sqlite3?
No se si me entiendas pero eres mejor
I haven't used it much, but would like to give it a shot someday. For this app, it is really too much though.
@@TokyoEdTech Thanks
hey there's only 480p
Yes, very sad.
cool
Thanks.
Please suggest me a good UA-cam channel (like your's) to learn javascript......
Sorry, I can't say for sure - but do some searching as there are tons out there.
Hi, I don't know any channels about javascript. But khanacdamy.org has a free course on it.
Thanks!
load task and save task doesn't work
Is there an error message? Can you share the code?
@@TokyoEdTech hello so it says that load task is not defined even though I already used Def
And for the save button I wanna ask is it supposed to create the tasks.dat folder or am I supposed to create it because when I click save it doesn't appear anywhere
I tried by downloading your code from the description but still when I hit save it doesn't appear anywhere
@@gumpreeengthegumpreeeng As I mentioned, can you share your code so I can take a look? Otherwise, I am just guessing.
How do I share the code?
I'm only 9 years old
1st I guess
Gold!
Can you upload a proper pygame tutorial from basic..?
Eventually - but not anytime soon. I may try to use Pygame with my students in Spring. If I do, I'll have to make a tutorial for it then.
@@TokyoEdTech thank you
Second!
Silver!
Hey man! My delete, save and load button does not work. One of the errors is " task.dat" cannot be found. THis is my code. I did it a liitle bit differently, but still the same structure as yours:
import tkinter
import tkinter.messagebox
import pickle
window = tkinter.Tk()
window.title("ToDo list")
# DEFINE FUNCTIONS
def task_adding():
todo_list = task_add.get()
if todo_list !="": # not equal to something
todolist_box.insert(tkinter.END,todo_list)
else:
tkinter.messagebox.showwarning(title="Attention!", message="To add a task, please enter some task")
def task_removing():
try:
index_todo_list = list_frame.curselection()[0]
list_frame.delete(index_todo_list)
except:
tkinter.messagebox.showwarning(title="Attention!", message="To delete a task, you must select a task")
def task_loading():
try:
todo_list = pickle.load(open("task.dat","rb"))
list_frame.delete(0,tkinter.END)
for todo_list in task_add:
list_frame.inset(tkinter.END,todo_list)
except:
tkinter.messagebox.showwarning(title="Attention!", message="Cannot find task.dat")
def task_saving():
todo_list = list_frame.get(0,list_frame.size())
pickle.dump(todo_list, open("task.dat","wb"))
# CREATE GUI
list_frame = tkinter.Frame(window)
list_frame.pack()
todolist_box = tkinter.Listbox(list_frame, height=20,width =20)
todolist_box.pack(side=tkinter.TOP)
scroller = tkinter.Scrollbar(list_frame)
scroller.pack(side=tkinter.RIGHT, fill=tkinter.Y) # Location of scrollbar Y = Vertical
todolist_box.config(yscrollcommand=scroller.set) # execute the scroller command
task_add = tkinter.Entry(window, width = 70) # the window where I enter the tasks
task_add.pack()
task_add_button = tkinter.Button(window, text="Click to Add task", font=("Times New Roman",12,"bold"),background="red",width=40, command=task_adding)
task_add_button.pack()
task_remove_button = tkinter.Button(window, text=" Click to Delete task", font=("Times New Roman", 12, "bold"), background ="yellow", width=40, command=task_removing)
task_remove_button.pack()
task_load_button = tkinter.Button(window, text=" Click to Load task", font=("Times New Roman", 12, "bold"), background ="brown", width=40, command=task_loading)
task_load_button.pack()
task_save_button = tkinter.Button(window, text="Click to Save task", font=("Times New Roman", 12, "bold"), background = "blue", width = 40, command=task_saving)
task_save_button.pack()
window.mainloop()
Did you save before trying to load? Can you share the exact error messages?
Plus you have
for todo_list in task_add
Does that make sense to you?
@@TokyoEdTech Nope i did not save. And yes, i have couple of stupid line codes there. I will rewrite now.
Hello sir
Love from india 🎉❤❤ i used and modified it for my school project, i just improved the ui a bit, (please do check it out sir, please 🥺)
import tkinter as c
import tkinter.messagebox
import pickle
win=c.Tk()
win.geometry("300x400")
win.config(bg="blue4")
#heading
c.Label(win,text="..Task List..",font="bruney 19 bold",bg="black",fg="gold").pack()
#frame to show task============================================================
frame1= c.Frame(win,bd=2,bg="maroon")
frame1.place(x=0,y=340,width=300,height=60)
#frame2
frame2= c.Frame(win,bd=2,bg="lightblue1")
frame2.place(x=0,y=305,width=300,height=35)
##========================================================================
#labelframe
lf1=c.Label(win,text="write task:-",font="ariel 8 bold",bd=0)
lf1.place(x=3,y=318,width=60,height=10)
#================================
#entry field
entry_task=c.Entry(win,bd=2)
entry_task.place(x=64,y=312,width=232)
##========
#func for buttons
def add_task():
task=entry_task.get()
if task != "":
listbox_tasks.insert(c.END,task)
entry_task.delete(0,c.END)
else:
c.messagebox.showwarning(title="warning", message="you must enter a task")
##
def del_task():
try:
task_index=listbox_tasks.curselection()[0]
listbox_tasks.delete(task_index)
except:
c.messagebox.showwarning(title="warning", message="you must select a task")
##
def save_task():
tasks=listbox_tasks.get(0,listbox_tasks.size())
if len(tasks)!=0:
pickle.dump(tasks,open("tasks.dat","wb"))
else:
c.messagebox.showwarning(title="warning", message="you must add a task")
##
def load_data():
try:
tasks=pickle.load(open("tasks.dat","rb"))
listbox_tasks.delete(0,c.END)
for task in tasks:
listbox_tasks.insert(c.END,task)
except:
c.messagebox.showwarning(title="warning", message="you must have tasks")
##
#def delall_task():
#tasks=pickle.load(open("tasks.dat","rb"))
#if len(tasks) = 0:
# c.messagebox.showwarning(title="warning", message="no past data")
#lse:
#buttons==================================================================
####
#add button
ad_bu=c.Button(win,text="ADD",font="ariel 10 bold",bg="dark orange",fg="black",bd=3,cursor="hand2",command=add_task)
ad_bu.place(x=3,y=345,width=75,height=50)
#delete button
de_bu=c.Button(win,text="Delete",font="ariel 10 bold",bg="maroon",fg="black",bd=3,cursor="hand2",command=del_task)
de_bu.place(x=75,y=345,width=75,height=50)
#save button
sa_bu=c.Button(win,text="Save",font="ariel 10 bold",bg="spring green",fg="black",bd=3,cursor="hand2",command=save_task)
sa_bu.place(x=150,y=345,width=75,height=50)
#Load butoon
lo_bu=c.Button(win,text="Load task",font="ariel 10 bold",bg="medium orchid",fg="white",bd=3,cursor="hand2",command=load_data)
lo_bu.place(x=225,y=345,width=74,height=50)
#####======================================================================
listbox_tasks=c.Listbox(win,height=17,width=80)
listbox_tasks.pack()
#=====================================================================
c.mainloop()
WOW - that looks awesome!
One suggestion - you might not want to use place - on my computer I couldn't see part of the UI.