Tic Tac Toe Game - Python Tkinter GUI Tutorial

  Рет қаралды 84,272

Codemy.com

Codemy.com

Күн бұрын

Пікірлер: 233
@Codemycom
@Codemycom 4 жыл бұрын
▶️ Watch Entire Tkinter Playlist ✅ Subscribe To My KZbin Channel: bit.ly/2UFLKgj bit.ly/2IGzvOR ▶️ See More At: ✅ Join My Facebook Group: Codemy.com bit.ly/2GFmOBz ▶️ Learn to Code at Codemy.com ✅ Buy a Codemy T-Shirt! Take $30 off with coupon code: youtube1 bit.ly/2VC9WUN ▶️ Get The Code bit.ly/3fLFQ8p
@PhoenixVids123
@PhoenixVids123 2 жыл бұрын
Hi! I would just like some help with the reset function! I did everything as you said and I don't get an error, but, when I try to use it, it doesn't do anything! Do you know how I could fix this?
@PhoenixVids123
@PhoenixVids123 2 жыл бұрын
Also, When a player wins, it doesn't change the box colour but it does disable the buttons! Do you know why?
@Codemycom
@Codemycom 2 жыл бұрын
@@PhoenixVids123 put it away for a few days, come back and watch the videos again and follow along with your code to see what you did wrong. The time off will reset your brain enough to see your errors.
@PhoenixVids123
@PhoenixVids123 2 жыл бұрын
@@Codemycom You just got a new subscriber!
@Codemycom
@Codemycom 2 жыл бұрын
@@PhoenixVids123 nice!
@carsoma19
@carsoma19 3 жыл бұрын
Covered a lot of ground in this video. Very informative. We appreciate the preparation, humor and insightful commentary.
@Codemycom
@Codemycom 3 жыл бұрын
Thanks! Glad you enjoyed it.
@navoditsachdeva4986
@navoditsachdeva4986 4 жыл бұрын
Your channel have such a real and great series on Python Tkinter
@Codemycom
@Codemycom 4 жыл бұрын
Glad you think so!
@AllyG1967
@AllyG1967 2 жыл бұрын
Thank you. My class and I completed this as our second Tkinter project and it has helped increase our understanding some more.
@Codemycom
@Codemycom 2 жыл бұрын
Very cool!
@atindrapal238
@atindrapal238 4 жыл бұрын
Thank you! Thank you so much for this video and also for the previous " print file " video... 😊
@Codemycom
@Codemycom 4 жыл бұрын
My pleasure 😊
@kapibara2440
@kapibara2440 4 ай бұрын
You are an amazing teacher! This channel is in my top three KZbin Series. The other are: Bro Code and Tech with Tim. 😊
@Codemycom
@Codemycom 4 ай бұрын
Thanks
@marwaelesawy5918
@marwaelesawy5918 2 жыл бұрын
at first I write your code, then I edited it and delete 70 rows and just write 16 rows, and I happy with that so thank you so much🌷
@Codemycom
@Codemycom 2 жыл бұрын
awesome
@david0411
@david0411 2 жыл бұрын
What was your solution?
@sunnywu4174
@sunnywu4174 Жыл бұрын
Ur helping me get through so much of my programming class ! Great teacher fr 🎉
@Codemycom
@Codemycom Жыл бұрын
Happy to hear it!
@jonan2199
@jonan2199 3 жыл бұрын
you could make a list of all winning combinations (each as it's own list of three necessary squares) and loop over all 8 lists and compare if the player won. For this, you need to pre-initialize two lists, one for the winning combinations (list of 8 lists of three squares), and one for keeping track of what squares are occupied by what player. Then determining the winner is much more compact.
@Codemycom
@Codemycom 3 жыл бұрын
Sure, lots of ways you could do it
@xt.apollagaming771
@xt.apollagaming771 4 жыл бұрын
The way you are teaching is really awesome 😊
@Codemycom
@Codemycom 4 жыл бұрын
Glad you like it!
@AaronProgZ
@AaronProgZ Жыл бұрын
Thanks for making this video! The audio and video was not bad.
@Codemycom
@Codemycom Жыл бұрын
welcome
@flacdontbetter
@flacdontbetter 4 жыл бұрын
Weird question: How come when you call the reset command in the menu button you don't need to write it as reset() but just write it as reset...I had this issue and couldn't figure out why it wasn't working until I saw that yours did not have the brackets and tried it without, is it something to do with attaching the reset function rather than calling it?
@Codemycom
@Codemycom 4 жыл бұрын
It's a quirk of tkinter. If you want to use functions, you have to call a lambda.
@swastiksarkar
@swastiksarkar 4 жыл бұрын
When I click the buttons and the letters 'X' and 'O' appears, my buttons are expanding creating gaps around them.
@Codemycom
@Codemycom 4 жыл бұрын
Did I change the font size? I don't recall, you should be able to see the code in the video
@ruslanak3381
@ruslanak3381 2 жыл бұрын
thanks, this video was helpful and very informative.Also it was easy to understand the code because of commentary
@Codemycom
@Codemycom 2 жыл бұрын
Glad you enjoyed it!
@savannahwasko6469
@savannahwasko6469 4 жыл бұрын
Your videos are so helpful! You explain everything very well. If I wanted to make the rest option a message box though, where would I put that?
@viswamberprasad9418
@viswamberprasad9418 4 жыл бұрын
hey John! the text assignment to the button in the function b_clicked,i.e b['text']='X' is not working for me! please provide me a solution or a new method
@Codemycom
@Codemycom 4 жыл бұрын
Check your code for typos.
@viswamberprasad9418
@viswamberprasad9418 4 жыл бұрын
@@Codemycom i did john,still no luck,there are no typos, The code: #x_player is set to true,as x starts first x_player=True #counter to check tie count=0 def when_clicked(button): global x_player,count if button['text']==' ' and x_player==True: button['text']='X' x_player=False count+=1 elif button['text']==' ' and x_player==False: button['text']='O' x_player=True count+=1 else: print('Space Is Occupied!') messagebox.showerror('Oops!','Looks Like That Space Is Occupied!')
@Codemycom
@Codemycom 4 жыл бұрын
@@viswamberprasad9418 Sure there is...you called your buttons button['text']...it should be b['text']
@viswamberprasad9418
@viswamberprasad9418 4 жыл бұрын
@@Codemycom but the function's parameter,is (button)in my code,so doesn't it work the same way as 'b' ....or is Naming the input parameter 'button' wrong?
@Codemycom
@Codemycom 4 жыл бұрын
@@viswamberprasad9418 Not sure if that's the problem but I wouldn't name a button as button. I wouldn't name a label label or an entry entry etc
@codewithahmed9806
@codewithahmed9806 4 жыл бұрын
Nice Sir Keep It up and make more awesome tkinter project like this .....
@Codemycom
@Codemycom 4 жыл бұрын
Thank you, I will
@codewithahmed9806
@codewithahmed9806 4 жыл бұрын
@@Codemycom ok sir
@DONGGASOGAMING69
@DONGGASOGAMING69 Ай бұрын
why when i repeat the code it doesnt work
@LourdHarshanR
@LourdHarshanR 3 жыл бұрын
Can u do a program for chess
@AliChowdary
@AliChowdary 3 жыл бұрын
What do i do with line 5? i dont know where i should redirect the file location to because ofc i dont have your pc so that file location isnt working for me. help please :)
@Codemycom
@Codemycom 3 жыл бұрын
Point it to where that icon or any icon is sitting on your pc. Or go back to the beginning of this playlist where I discuss it, or leave it off.
@mangoking7126
@mangoking7126 3 жыл бұрын
Sir, there is a glitch in the code- If you click 4 buttons once and reset the game and click 5 more buttons and the game is not finished, it says tied because count = 9
@Codemycom
@Codemycom 3 жыл бұрын
ok, so try to fix it as an exercise
@haziqasyraf1998
@haziqasyraf1998 3 жыл бұрын
where is the code?
@neoniq_q
@neoniq_q 11 ай бұрын
how to make it with flet?
@user-yk9tv1lv5n
@user-yk9tv1lv5n Жыл бұрын
I used the exact same code as you on vs code but the colour of winning player doesn't change why is this?
@Codemycom
@Codemycom Жыл бұрын
Because you only think you used the same code…you have some typo somewhere
@charusrivastava5724
@charusrivastava5724 2 жыл бұрын
The video is very helpful but I am facing a problem. Menu(reset button) is not getting displayed in mac. What should I do to resolves this?
@Codemycom
@Codemycom 2 жыл бұрын
It is getting displayed...it's just that mac's have their menu bars at the top of the screen on your monitor, not on the app.
@aryanmehta5317
@aryanmehta5317 3 жыл бұрын
my global button is not working when i want to make 2 windows with one windows as this code can anyone help what to do??
@jaguelo1
@jaguelo1 3 жыл бұрын
I have able to figure out to minimize redundancy of the codes. Create a function to change background color, function to check wither X or O wins. These functions has 3 parameters with type Button. So call this function pass the 3 specific button combinations.
@jaguelo1
@jaguelo1 3 жыл бұрын
And also create a button in for loop and put to a list.
@Codemycom
@Codemycom 3 жыл бұрын
@@jaguelo1 Cool
@sudin99and81
@sudin99and81 4 жыл бұрын
will u make more series or this module cause I've learned a lot not only bout module but also python i mean like default python functions
@Codemycom
@Codemycom 4 жыл бұрын
what module are you referring to?
@sudin99and81
@sudin99and81 4 жыл бұрын
@@Codemycom umm tkinter and is there any application made using tkinter?
@Codemycom
@Codemycom 4 жыл бұрын
@@sudin99and81 I have a playlist with like 115 tkinter videos in the comment section below
@sudin99and81
@sudin99and81 4 жыл бұрын
@@Codemycom i know I've watched all but like will u do more things with it ... is this gonna end?
@Codemycom
@Codemycom 4 жыл бұрын
@@sudin99and81 No, I release tkinter videos usually on Mondays, Wednesdays, an Fridays
@anonjutuba5722
@anonjutuba5722 3 жыл бұрын
works fine, but I can't really figure out how to make it simplier as you mentioned in the end
@Codemycom
@Codemycom 3 жыл бұрын
No worries
@reyesjoeroshan7286
@reyesjoeroshan7286 4 жыл бұрын
oh I like all your videos.. espcly Tkinter Videos I've Also Made a TicTacToe With Tkinter but this code you used is easy to do but does it consumes more memory, I made a algorith which checks victory in row column and diagonally without copy pasting(im a beginner) :) and keep uploading ..
@vanshatcode
@vanshatcode 4 жыл бұрын
when pygames series come , Waiting for that : )
@KaruVision
@KaruVision 4 жыл бұрын
Thank you! The code worked perfectly!
@Codemycom
@Codemycom 4 жыл бұрын
You're welcome!
@Codemycom
@Codemycom 3 жыл бұрын
​@x binary01 It's always in the pinned comment
@aayushraj2918
@aayushraj2918 2 жыл бұрын
reset function is not working, any solution please
@Codemycom
@Codemycom 2 жыл бұрын
Look at your code, compare it to my code, determine what you did differently.
@PhoenixVids123
@PhoenixVids123 2 жыл бұрын
For me, I am using PyCharm on mac and when I do root.iconbitmap("TicTacToeIcon.ico") it does not show my icon for the window, instead, it shows the default icon! How would I fix this because I don't get an error message.
@loniaomi4857
@loniaomi4857 Жыл бұрын
Sir can I get a flowchart for the program?
@Codemycom
@Codemycom Жыл бұрын
I have no idea what that is.
@UncleQuizMaster
@UncleQuizMaster 4 жыл бұрын
Awesome vid!
@Codemycom
@Codemycom 4 жыл бұрын
Thanks!
@xtips2717
@xtips2717 4 жыл бұрын
Cool! I first understood it well. Then I tried to recode it again on my own to see how well I would be.
@Codemycom
@Codemycom 4 жыл бұрын
Nice
@itayf.848
@itayf.848 3 жыл бұрын
Can you make a tutorial about tic tac toe but player vs computer, not player vs player?
@Codemycom
@Codemycom 3 жыл бұрын
That's more an AI thing than a tkinter thing
@itayf.848
@itayf.848 3 жыл бұрын
But it still player vs player game...
@alhassanmusah7242
@alhassanmusah7242 Жыл бұрын
Awesome job sir Thanks alot
@a.j2059
@a.j2059 2 жыл бұрын
Love this content Please am using this code for my students
@Codemycom
@Codemycom 2 жыл бұрын
Happy to hear it!
@siddharth5339
@siddharth5339 3 жыл бұрын
how did he get x and o like what is he clicking to make x and o come up
@Codemycom
@Codemycom 3 жыл бұрын
Just watch the video, I show you exactly.
@suryabhavithperugupalli7041
@suryabhavithperugupalli7041 4 жыл бұрын
Love your videos
@Codemycom
@Codemycom 4 жыл бұрын
Thanks!
@shivansh9387
@shivansh9387 3 жыл бұрын
Sir what you say about that KZbin algorithm in every video and why?
@Codemycom
@Codemycom 3 жыл бұрын
If you click the thumbs up, the youtube algorithm knows that people like the video, and makes it more likely for others to see the video.
@shivansh9387
@shivansh9387 3 жыл бұрын
@@Codemycom Did it 👍😊
@Codemycom
@Codemycom 3 жыл бұрын
@@shivansh9387 thanks!
@devshreeshah6024
@devshreeshah6024 3 жыл бұрын
Can I get the code for single player? i.e Player vs Computer
@Codemycom
@Codemycom 3 жыл бұрын
I don’t have a video on that
@mycode9004
@mycode9004 3 жыл бұрын
hi sir I just copy and paste the button o wins but the o in not win though the 3 buttons are o what is the solution of is sir
@Codemycom
@Codemycom 3 жыл бұрын
Sorry, I'm not sure what you mean...you have an error in your code somewhere.
@ita27rmp100
@ita27rmp100 4 жыл бұрын
May you give me the link of this code in github?
@Codemycom
@Codemycom 4 жыл бұрын
github.com/flatplanet/Intro-To-TKinter-KZbin-Course
@ita27rmp100
@ita27rmp100 4 жыл бұрын
@@Codemycom thank you
@Codemycom
@Codemycom 4 жыл бұрын
sure thing
@aao9353
@aao9353 2 жыл бұрын
i have the problem when
@aao9353
@aao9353 2 жыл бұрын
it dosent work at all
@Codemycom
@Codemycom 2 жыл бұрын
You're doing something wrong then, because there's no reason for it not to work.
@codewithahmed9806
@codewithahmed9806 4 жыл бұрын
How to write minimum if elif condition in this project
@Codemycom
@Codemycom 4 жыл бұрын
that’s the exercise I tasked you with
@codewithahmed9806
@codewithahmed9806 4 жыл бұрын
@@Codemycom Please Give me hint
@balain501
@balain501 4 жыл бұрын
@@Codemycom How about this code: if b[3]=='X': if b[1] =='X' and b[2] =='X': winner = True elif b[6]=='X' and b[9]=='X': winner = True elif b[5]=='X' and b[7]=='X': winner = True if b[5]=='X': if b[4]=='X' and b[6]=='X': winner = True elif b[1] =='X' and b[9]=='X': winner = True if b[7]=='X': if b[5]='X' and b[1]=='X': winner = True elif b[8]=='X' and b[9]=='X': winner = True (We are taking one button per row and checking conditions accordingly)
@reyesjoeroshan7286
@reyesjoeroshan7286 4 жыл бұрын
@@balain501 this code is complex bro cuz it only checks X we want to copy paste it and change it to O :(
@balain501
@balain501 4 жыл бұрын
@@reyesjoeroshan7286 it has been months. But I think I checked this code. It works. Still if you check the no. of ifs, nothing minimized :)
@lilyfullery4779
@lilyfullery4779 2 жыл бұрын
thank u , my concept got cleared
@Codemycom
@Codemycom 2 жыл бұрын
glad to hear it
@najlanaimi5030
@najlanaimi5030 2 жыл бұрын
Hi How we reset or restart our tic tac toe game in this code ?? pleace answer me
@Codemycom
@Codemycom 2 жыл бұрын
Keep watching the playlist, I cover that topic in a video.
@mohammedredwan9466
@mohammedredwan9466 Жыл бұрын
You could simply use nested loops
@Codemycom
@Codemycom Жыл бұрын
you can always do things a million different ways
@wagyua5752
@wagyua5752 4 жыл бұрын
Will you make an AI for this tic tac toe?
@Codemycom
@Codemycom 4 жыл бұрын
no, this is just a simple tic tax toe game
@ashutoshjoshi4005
@ashutoshjoshi4005 4 жыл бұрын
Can I use pycharm for this project?
@Codemycom
@Codemycom 4 жыл бұрын
You can try, but I don't recommend pycharm ever, for anything.
@Codemycom
@Codemycom 4 жыл бұрын
@Debaditya Nath So? That's completely irrelevant lol Every day I get dozens of questions from students having trouble with pycharm. That you currently aren't doesn't mean anything.
@linusssssssss
@linusssssssss 3 жыл бұрын
@@Codemycom I think Pycharm is great ;)
@meralmaradia4774
@meralmaradia4774 3 жыл бұрын
Nothing comes up on the screen when I run this!!!!
@Codemycom
@Codemycom 3 жыл бұрын
What did you do differently than the video?
@gaitondegaoni1696
@gaitondegaoni1696 4 жыл бұрын
Walter white teaching coding instead of chemistry
@Codemycom
@Codemycom 4 жыл бұрын
ha
@lucasgagne9529
@lucasgagne9529 2 жыл бұрын
Anyone know why my colors are not changing after a win?
@lucasgagne9529
@lucasgagne9529 2 жыл бұрын
Im on Mac btw, it seems changing colors is not supported?
@Codemycom
@Codemycom 2 жыл бұрын
@@lucasgagne9529 Yeah, mac's have the ability to change simple colors :-p you just messed up that part of the code. Rewatch the video and figure out what you did differently.
@gloria..
@gloria.. 3 жыл бұрын
Hey I got a bug in 11:11 whenever i try test out the code it brings the error text even if the whole tkinter has no X nor O what should I do? Here is the code: from tkinter import * from tkinter import messagebox root = Tk() # root.geometry("1200*710") # X starts so true clicked = True count = 0 #Button clicked function def b_click(b): global clicked, count if b["text"] == " " and clicked == True: b["text"] = "X" clicked = False count += 1 elif b["text"] == " " and clicked == False: b["text"] = "O" clicked = True count += 1 else: messagebox.showerror("Tic Tac Toe", "The box is already chosen Pick another box") #Build the buttons b1= Button(root, text= "", font=("Helvetica", 20), height = 3, width = 6, bg = "SystemButtonFace",command = lambda: b_click(b1)) b2= Button(root, text= "", font=("Helvetica", 20), height = 3, width = 6, bg = "SystemButtonFace",command = lambda: b_click(b2)) b3= Button(root, text= "", font=("Helvetica", 20), height = 3, width = 6, bg = "SystemButtonFace",command = lambda: b_click(b3)) b4= Button(root, text= "", font=("Helvetica", 20), height = 3, width = 6, bg = "SystemButtonFace",command = lambda: b_click(b4)) b5= Button(root, text= "", font=("Helvetica", 20), height = 3, width = 6, bg = "SystemButtonFace",command = lambda: b_click(b5)) b6= Button(root, text= "", font=("Helvetica", 20), height = 3, width = 6, bg = "SystemButtonFace",command = lambda: b_click(b6)) b7= Button(root, text= "", font=("Helvetica", 20), height = 3, width = 6, bg = "SystemButtonFace",command = lambda: b_click(b7)) b8= Button(root, text= "", font=("Helvetica", 20), height = 3, width = 6, bg = "SystemButtonFace",command = lambda: b_click(b8)) b9= Button(root, text= "", font=("Helvetica", 20), height = 3, width = 6, bg = "SystemButtonFace",command = lambda: b_click(b9)) #Grid the buttons b1.grid(row = 0, column = 0) b2.grid(row = 0, column = 1) b3.grid(row = 0, column = 2) b4.grid(row = 1, column = 0) b5.grid(row = 1, column = 1) b6.grid(row = 1, column = 2) b7.grid(row = 2, column = 0) b8.grid(row = 2, column = 1) b9.grid(row = 2, column = 2) root.mainloop()
@gloria..
@gloria.. 3 жыл бұрын
I found where I went wrong whilst I was creating the buttons (b1, b2, b3 etc) I did not leave a space in the so it did not have space to input X or O so it kept on bring the click another box error.
@alextysen
@alextysen 3 жыл бұрын
Thank you very much. You're great!
@Codemycom
@Codemycom 3 жыл бұрын
Thanks!
@YOGIT_Singh
@YOGIT_Singh 3 жыл бұрын
Can i do this same on Jupiter Notebook ???????????
@Codemycom
@Codemycom 3 жыл бұрын
Try it and see
@muchirajunior
@muchirajunior 2 жыл бұрын
Thanks for the help
@Codemycom
@Codemycom 2 жыл бұрын
Welcome!
@phil6794
@phil6794 4 жыл бұрын
You are one of the best
@Codemycom
@Codemycom 4 жыл бұрын
Thanks!
@bipinbhaivaghela5318
@bipinbhaivaghela5318 3 жыл бұрын
The code was very useful...thank you...very nicely.. explained..
@artastica8522
@artastica8522 4 жыл бұрын
What is root.iconbitmap?
@Codemycom
@Codemycom 4 жыл бұрын
The titlebar icon
@xyzterror6462
@xyzterror6462 3 жыл бұрын
Just remove it from the top of the code
@sorooshkorhani3842
@sorooshkorhani3842 3 жыл бұрын
What's the theme name?
@Codemycom
@Codemycom 3 жыл бұрын
What theme? There is no theme...
@LourdHarshanR
@LourdHarshanR 3 жыл бұрын
Thanks a lot🌹❤🙏🙏🙏 bro I am ur fan from now Put more programs in kivy
@LourdHarshanR
@LourdHarshanR 3 жыл бұрын
Tkinter turtle python etc
@Codemycom
@Codemycom 3 жыл бұрын
@@LourdHarshanR kivy every monday, tkinter every tuesday
@LourdHarshanR
@LourdHarshanR 3 жыл бұрын
Bro it doesn't show result for O as winner
@LourdHarshanR
@LourdHarshanR 3 жыл бұрын
Sorry bro I forgot to give checkifwon method for O Now it works correctly
@viswamberprasad9418
@viswamberprasad9418 4 жыл бұрын
Would really appreciate if the source code is provided John!
@Codemycom
@Codemycom 4 жыл бұрын
All my source code is on github, link in the pinned comment above
@viswamberprasad9418
@viswamberprasad9418 4 жыл бұрын
@@Codemycom thnx again John!
@Codemycom
@Codemycom 4 жыл бұрын
@@viswamberprasad9418 Sure thing
@joshuakidssong1965
@joshuakidssong1965 3 жыл бұрын
8:16
@manovikasreyya7221
@manovikasreyya7221 3 жыл бұрын
how to solve pylint errors while wildcard import
@Codemycom
@Codemycom 3 жыл бұрын
stop using pylint
@manovikasreyya7221
@manovikasreyya7221 3 жыл бұрын
@@Codemycom while using import * I am getting bunch of errors
@Codemycom
@Codemycom 3 жыл бұрын
@@manovikasreyya7221 yeah, stop using pylint
@manovikasreyya7221
@manovikasreyya7221 3 жыл бұрын
@@Codemycom how to stop pylint
@Codemycom
@Codemycom 3 жыл бұрын
@@manovikasreyya7221 How did you start using it? I don't use it.
@jager0724
@jager0724 4 жыл бұрын
If you got crushed by your day and can't stand the minutiae of life, here's the check_win function in full. Just paste it in! It's 118 lines long, so get ready for a bumpy ride! def check_win(): global winner winner = False if b1["text"] == "X" and b2["text"] == "X" and b3["text"] == "X": b1.config(bg="green") b2.config(bg="green") b3.config(bg="green") winner = True messagebox.showinfo("Game Info", "X wins the game") disable_all_buttons() elif b4["text"] == "X" and b5["text"] == "X" and b6["text"] == "X": b4.config(bg="green") b5.config(bg="green") b6.config(bg="green") winner = True messagebox.showinfo("Game Info", "X wins the game") disable_all_buttons() elif b7["text"] == "X" and b8["text"] == "X" and b9["text"] == "X": b7.config(bg="green") b8.config(bg="green") b9.config(bg="green") winner = True messagebox.showinfo("Game Info", "X wins the game") disable_all_buttons() elif b1["text"] == "X" and b4["text"] == "X" and b7["text"] == "X": b1.config(bg="green") b4.config(bg="green") b7.config(bg="green") winner = True messagebox.showinfo("Game Info", "X wins the game") disable_all_buttons() elif b2["text"] == "X" and b5["text"] == "X" and b8["text"] == "X": b2.config(bg="green") b5.config(bg="green") b8.config(bg="green") winner = True messagebox.showinfo("Game Info", "X wins the game") disable_all_buttons() elif b3["text"] == "X" and b6["text"] == "X" and b9["text"] == "X": b3.config(bg="green") b6.config(bg="green") b9.config(bg="green") winner = True messagebox.showinfo("Game Info", "X wins the game") disable_all_buttons() elif b1["text"] == "X" and b5["text"] == "X" and b9["text"] == "X": b1.config(bg="green") b5.config(bg="green") b9.config(bg="green") winner = True messagebox.showinfo("Game Info", "X wins the game") disable_all_buttons() elif b3["text"] == "X" and b5["text"] == "X" and b7["text"] == "X": b3.config(bg="green") b5.config(bg="green") b7.config(bg="green") winner = True messagebox.showinfo("Game Info", "X wins the game") disable_all_buttons() if b1["text"] == "O" and b2["text"] == "O" and b3["text"] == "O": b1.config(bg="green") b2.config(bg="green") b3.config(bg="green") winner = True messagebox.showinfo("Game Info", "O wins the game") disable_all_buttons() elif b4["text"] == "O" and b5["text"] == "O" and b6["text"] == "O": b4.config(bg="green") b5.config(bg="green") b6.config(bg="green") winner = True messagebox.showinfo("Game Info", "O wins the game") disable_all_buttons() elif b7["text"] == "O" and b8["text"] == "O" and b9["text"] == "O": b7.config(bg="green") b8.config(bg="green") b9.config(bg="green") winner = True messagebox.showinfo("Game Info", "O wins the game") disable_all_buttons() elif b1["text"] == "O" and b4["text"] == "O" and b7["text"] == "O": b1.config(bg="green") b4.config(bg="green") b7.config(bg="green") winner = True messagebox.showinfo("Game Info", "O wins the game") disable_all_buttons() elif b2["text"] == "O" and b5["text"] == "O" and b8["text"] == "O": b2.config(bg="green") b5.config(bg="green") b8.config(bg="green") winner = True messagebox.showinfo("Game Info", "O wins the game") disable_all_buttons() elif b3["text"] == "O" and b6["text"] == "O" and b9["text"] == "O": b3.config(bg="green") b6.config(bg="green") b9.config(bg="green") winner = True messagebox.showinfo("Game Info", "O wins the game") disable_all_buttons() elif b1["text"] == "O" and b5["text"] == "O" and b9["text"] == "O": b1.config(bg="green") b5.config(bg="green") b9.config(bg="green") winner = True messagebox.showinfo("Game Info", "O wins the game") disable_all_buttons() elif b3["text"] == "O" and b5["text"] == "O" and b7["text"] == "O": b3.config(bg="green") b5.config(bg="green") b7.config(bg="green") winner = True messagebox.showinfo("Game Info", "O wins the game") disable_all_buttons() if count == 9 and winner == False: messagebox.showinfo('Game Info', "It's a tie, boys! Ya'll losers! Do another one.") disable_all_buttons()
@vedanshvyas-yl4dd
@vedanshvyas-yl4dd 6 ай бұрын
providing source code with videos would be extremely helpful ,,,, thanks
@Codemycom
@Codemycom 6 ай бұрын
That's why I do it.
@ansarifayaz9529
@ansarifayaz9529 4 жыл бұрын
I want to create one-player game please suggest me
@Codemycom
@Codemycom 4 жыл бұрын
I couldn't possibly. Do whatever you want. :-p
@soumitraguhathakurta517
@soumitraguhathakurta517 2 жыл бұрын
Thank you Sir
@Codemycom
@Codemycom 2 жыл бұрын
Welcome!
@kibromgebreheiwotbedane4987
@kibromgebreheiwotbedane4987 4 жыл бұрын
I don't understand the whole system. it is so complex
@Codemycom
@Codemycom 4 жыл бұрын
What about it is confusing? Maybe start the playlist on video 1 and just start watching...
@aakash2333
@aakash2333 3 жыл бұрын
You are really cool person
@Codemycom
@Codemycom 3 жыл бұрын
Ha thanks!
@pintokatendejonathan1740
@pintokatendejonathan1740 4 жыл бұрын
Merci pour cette formation
@kshyst
@kshyst 3 жыл бұрын
nice thanks !
@Codemycom
@Codemycom 3 жыл бұрын
Welcome!
@LourdHarshanR
@LourdHarshanR 3 жыл бұрын
Do a program for ludo
@Codemycom
@Codemycom 3 жыл бұрын
I don’t know what that is?
@sakshamkarna9041
@sakshamkarna9041 3 жыл бұрын
while(me==like_this_video): print("Very cool video. enjoyed it") break
@Codemycom
@Codemycom 3 жыл бұрын
print("Thanks!")
@Acem8887
@Acem8887 4 жыл бұрын
i made an aim training game lmao
@Codemycom
@Codemycom 4 жыл бұрын
fun
@kodakzak2836
@kodakzak2836 2 жыл бұрын
@@bhavyanavyadancechannel8276 from tkinter import * win = Tk() l = Label(win, text="I think he said no").pack()
@sameersahu8271
@sameersahu8271 3 жыл бұрын
Thanks
@djangodev
@djangodev 3 жыл бұрын
Cod plz
@Codemycom
@Codemycom 3 жыл бұрын
always in the pinned comment
@user-mi8pj5lh7y
@user-mi8pj5lh7y 2 жыл бұрын
sir I did the exact thing you did, but my reset function is not working edit: I just found where I gone wrong, I gave the command for button as reset() instead of just reset Thank you for this video, it helped me a lot
@Codemycom
@Codemycom 2 жыл бұрын
:-)
@AmitPatel-cl6ou
@AmitPatel-cl6ou Жыл бұрын
Thnks
@Codemycom
@Codemycom Жыл бұрын
Welcome
@tedidervishi
@tedidervishi Жыл бұрын
🔥
@Codemycom
@Codemycom Жыл бұрын
🙂
@dimitriosdesmos4699
@dimitriosdesmos4699 4 жыл бұрын
pygam next
@Codemycom
@Codemycom 4 жыл бұрын
It's on the list
@sudin99and81
@sudin99and81 4 жыл бұрын
👍👍
@Codemycom
@Codemycom 4 жыл бұрын
:-)
@ArjunSingh_29
@ArjunSingh_29 2 жыл бұрын
You look like Walter White
@Codemycom
@Codemycom 2 жыл бұрын
Ha!
@ararshad4780
@ararshad4780 2 жыл бұрын
This is not run In this program "C:/gui/codemy.ico" not defined Plz solved my program
@Codemycom
@Codemycom 2 жыл бұрын
That's the icon at the top of the program. You can remove it or add your own icon
@hussein0762
@hussein0762 Жыл бұрын
Thanks for this nice video, for who wants smaller code, write this: if b1['text'] == 'X' and b2['text'] == 'X' and b3['text'] == 'X' or b1['text'] == 'O' and b2['text'] == 'O' and b3['text'] == 'O': b1.config(bg='red') b2.config(bg='red') b3.config(bg='red') winner = True if b1.cget('text') == 'X': messagebox.showinfo('Tic Tac Toe', 'Congratulations X Wins') else: messagebox.showinfo('Tic Tac Toe', 'Congratulations O Wins') disable_all_buttons()
@alhassanmusah7242
@alhassanmusah7242 Жыл бұрын
Awesome job sir Thanks alot
@Codemycom
@Codemycom Жыл бұрын
Welcome
@akshithisola5629
@akshithisola5629 3 жыл бұрын
8:16
Tkinter Course - Create Graphic User Interfaces in Python Tutorial
5:37:31
freeCodeCamp.org
Рет қаралды 3,4 МЛН
1% vs 100% #beatbox #tiktok
01:10
BeatboxJCOP
Рет қаралды 67 МЛН
UFC 310 : Рахмонов VS Мачадо Гэрри
05:00
Setanta Sports UFC
Рет қаралды 1,2 МЛН
REAL or FAKE? #beatbox #tiktok
01:03
BeatboxJCOP
Рет қаралды 18 МЛН
Let's code a TIC TAC TOE game in python! ⭕
21:30
Bro Code
Рет қаралды 151 М.
Tic Tac Toe AI with MiniMax using Python | Part 2: Minimax
11:22
Java Coding Community
Рет қаралды 37 М.
Modern Graphical User Interfaces in Python
11:12
NeuralNine
Рет қаралды 1,6 МЛН
How To Code Tic Tac Toe With Python | Programming Tutorial For Beginners
15:11
I Redesigned the ENTIRE YouTube UI from Scratch
19:10
Juxtopposed
Рет қаралды 970 М.
Minimax: How Computers Play Games
14:37
Spanning Tree
Рет қаралды 215 М.
Conway's Game of Life tutorial in Python & Pygame - OOP
1:02:01
Programming With Nick
Рет қаралды 3,7 М.
Python TIC TAC TOE Tutorial | Beginner Friendly Tutorial
25:15
Code Coach
Рет қаралды 213 М.
Simple GUI Calculator in Python
22:51
NeuralNine
Рет қаралды 292 М.
1% vs 100% #beatbox #tiktok
01:10
BeatboxJCOP
Рет қаралды 67 МЛН