Tic Tac Toe Game - Python Tkinter GUI Tutorial

แชร์
ฝัง
  • เผยแพร่เมื่อ 4 พ.ย. 2024

ความคิดเห็น • 232

  • @Codemycom
    @Codemycom  4 ปีที่แล้ว +8

    ▶️ Watch Entire Tkinter Playlist ✅ Subscribe To My TH-cam 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 ปีที่แล้ว

      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 ปีที่แล้ว

      Also, When a player wins, it doesn't change the box colour but it does disable the buttons! Do you know why?

    • @Codemycom
      @Codemycom  ปีที่แล้ว +1

      @@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 ปีที่แล้ว

      @@Codemycom You just got a new subscriber!

    • @Codemycom
      @Codemycom  ปีที่แล้ว

      @@PhoenixVids123 nice!

  • @carsoma19
    @carsoma19 3 ปีที่แล้ว +16

    Covered a lot of ground in this video. Very informative. We appreciate the preparation, humor and insightful commentary.

    • @Codemycom
      @Codemycom  3 ปีที่แล้ว +3

      Thanks! Glad you enjoyed it.

  • @navoditsachdeva4986
    @navoditsachdeva4986 4 ปีที่แล้ว +10

    Your channel have such a real and great series on Python Tkinter

    • @Codemycom
      @Codemycom  4 ปีที่แล้ว +3

      Glad you think so!

  • @atindrapal238
    @atindrapal238 4 ปีที่แล้ว +12

    Thank you! Thank you so much for this video and also for the previous " print file " video... 😊

    • @Codemycom
      @Codemycom  4 ปีที่แล้ว

      My pleasure 😊

  • @kapibara2440
    @kapibara2440 2 หลายเดือนก่อน

    You are an amazing teacher! This channel is in my top three TH-cam Series. The other are: Bro Code and Tech with Tim. 😊

    • @Codemycom
      @Codemycom  2 หลายเดือนก่อน

      Thanks

  • @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.

  • @marwaelesawy5918
    @marwaelesawy5918 ปีที่แล้ว +1

    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  ปีที่แล้ว

      awesome

    • @david0411
      @david0411 ปีที่แล้ว +1

      What was your solution?

  • @jonan2199
    @jonan2199 2 ปีที่แล้ว +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  2 ปีที่แล้ว

      Sure, lots of ways you could do it

  • @sunnywu4174
    @sunnywu4174 ปีที่แล้ว

    Ur helping me get through so much of my programming class ! Great teacher fr 🎉

    • @Codemycom
      @Codemycom  ปีที่แล้ว

      Happy to hear it!

  • @xt.apollagaming771
    @xt.apollagaming771 3 ปีที่แล้ว +1

    The way you are teaching is really awesome 😊

    • @Codemycom
      @Codemycom  3 ปีที่แล้ว

      Glad you like it!

  • @savannahwasko6469
    @savannahwasko6469 3 ปีที่แล้ว +5

    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?

  • @ruslanak3381
    @ruslanak3381 ปีที่แล้ว +1

    thanks, this video was helpful and very informative.Also it was easy to understand the code because of commentary

    • @Codemycom
      @Codemycom  ปีที่แล้ว +1

      Glad you enjoyed it!

  • @AaronProgZ
    @AaronProgZ ปีที่แล้ว

    Thanks for making this video! The audio and video was not bad.

  • @bipinbhaivaghela5318
    @bipinbhaivaghela5318 3 ปีที่แล้ว +1

    The code was very useful...thank you...very nicely.. explained..

  • @codewithahmed9806
    @codewithahmed9806 4 ปีที่แล้ว +2

    Nice Sir Keep It up and make more awesome tkinter project like this .....

  • @KaruVision
    @KaruVision 3 ปีที่แล้ว +1

    Thank you! The code worked perfectly!

    • @Codemycom
      @Codemycom  3 ปีที่แล้ว

      You're welcome!

    • @Codemycom
      @Codemycom  3 ปีที่แล้ว

      ​@x binary01 It's always in the pinned comment

  • @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.

  • @jaguelo1
    @jaguelo1 2 ปีที่แล้ว

    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 2 ปีที่แล้ว

      And also create a button in for loop and put to a list.

    • @Codemycom
      @Codemycom  2 ปีที่แล้ว +1

      @@jaguelo1 Cool

  • @alhassanmusah7242
    @alhassanmusah7242 ปีที่แล้ว

    Awesome job sir Thanks alot

  • @reyesjoeroshan7286
    @reyesjoeroshan7286 4 ปีที่แล้ว +2

    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 ..

  • @a.j2059
    @a.j2059 2 ปีที่แล้ว

    Love this content
    Please am using this code for my students

    • @Codemycom
      @Codemycom  2 ปีที่แล้ว

      Happy to hear it!

  • @jager0724
    @jager0724 4 ปีที่แล้ว +2

    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()

  • @alextysen
    @alextysen 2 ปีที่แล้ว

    Thank you very much. You're great!

  • @lilyfullery4779
    @lilyfullery4779 2 ปีที่แล้ว

    thank u , my concept got cleared

    • @Codemycom
      @Codemycom  2 ปีที่แล้ว

      glad to hear it

  • @sudin99and81
    @sudin99and81 4 ปีที่แล้ว +3

    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 ปีที่แล้ว +1

      what module are you referring to?

    • @sudin99and81
      @sudin99and81 4 ปีที่แล้ว

      @@Codemycom umm tkinter
      and is there any application made using tkinter?

    • @Codemycom
      @Codemycom  4 ปีที่แล้ว +1

      @@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 ปีที่แล้ว +1

      @@sudin99and81 No, I release tkinter videos usually on Mondays, Wednesdays, an Fridays

  • @muchirajunior
    @muchirajunior ปีที่แล้ว

    Thanks for the help

  • @suryabhavithperugupalli7041
    @suryabhavithperugupalli7041 4 ปีที่แล้ว

    Love your videos

  • @UncleQuizMaster
    @UncleQuizMaster 3 ปีที่แล้ว

    Awesome vid!

  • @pintokatendejonathan1740
    @pintokatendejonathan1740 4 ปีที่แล้ว

    Merci pour cette formation

  • @swastiksarkar
    @swastiksarkar 4 ปีที่แล้ว +1

    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

  • @hussein0762
    @hussein0762 ปีที่แล้ว +1

    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()

  • @flacdontbetter
    @flacdontbetter 3 ปีที่แล้ว +2

    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  3 ปีที่แล้ว +2

      It's a quirk of tkinter. If you want to use functions, you have to call a lambda.

  • @phil6794
    @phil6794 4 ปีที่แล้ว

    You are one of the best

  • @soumitraguhathakurta517
    @soumitraguhathakurta517 2 ปีที่แล้ว

    Thank you Sir

  • @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 ปีที่แล้ว +1

      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.

  • @kshyst
    @kshyst 3 ปีที่แล้ว

    nice
    thanks !

  • @itayf.848
    @itayf.848 3 ปีที่แล้ว +2

    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...

  • @user-mi8pj5lh7y
    @user-mi8pj5lh7y ปีที่แล้ว

    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

  • @mangoking7126
    @mangoking7126 3 ปีที่แล้ว +1

    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 ปีที่แล้ว +2

      ok, so try to fix it as an exercise

    • @haziqasyraf1998
      @haziqasyraf1998 2 ปีที่แล้ว

      where is the code?

  • @LourdHarshanR
    @LourdHarshanR 3 ปีที่แล้ว +1

    Can u do a program for chess

  • @aakash2333
    @aakash2333 3 ปีที่แล้ว

    You are really cool person

  • @mohammedredwan9466
    @mohammedredwan9466 ปีที่แล้ว

    You could simply use nested loops

    • @Codemycom
      @Codemycom  ปีที่แล้ว

      you can always do things a million different ways

  • @viswamberprasad9418
    @viswamberprasad9418 4 ปีที่แล้ว +2

    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 ปีที่แล้ว +1

      @@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

  • @shivansh9387
    @shivansh9387 3 ปีที่แล้ว +1

    Sir what you say about that TH-cam algorithm in every video and why?

    • @Codemycom
      @Codemycom  3 ปีที่แล้ว +1

      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!

  • @anonjutuba5722
    @anonjutuba5722 3 ปีที่แล้ว

    works fine, but I can't really figure out how to make it simplier as you mentioned in the end

  • @vanshatcode
    @vanshatcode 3 ปีที่แล้ว +1

    when pygames series come , Waiting for that : )

  • @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.

  • @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 ปีที่แล้ว +1

      @@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

  • @gaitondegaoni1696
    @gaitondegaoni1696 4 ปีที่แล้ว +1

    Walter white teaching coding instead of chemistry

  • @sameersahu8271
    @sameersahu8271 3 ปีที่แล้ว

    Thanks

  • @devshreeshah6024
    @devshreeshah6024 3 ปีที่แล้ว +1

    Can I get the code for single player? i.e Player vs Computer

    • @Codemycom
      @Codemycom  3 ปีที่แล้ว

      I don’t have a video on that

  • @vedanshvyas-yl4dd
    @vedanshvyas-yl4dd 4 หลายเดือนก่อน

    providing source code with videos would be extremely helpful ,,,, thanks

    • @Codemycom
      @Codemycom  4 หลายเดือนก่อน

      That's why I do it.

  • @wagyua5752
    @wagyua5752 4 ปีที่แล้ว +2

    Will you make an AI for this tic tac toe?

    • @Codemycom
      @Codemycom  4 ปีที่แล้ว +1

      no, this is just a simple tic tax toe game

  • @Acem8887
    @Acem8887 4 ปีที่แล้ว +8

    i made an aim training game lmao

    • @Codemycom
      @Codemycom  4 ปีที่แล้ว +2

      fun

    • @kodakzak2836
      @kodakzak2836 2 ปีที่แล้ว +4

      @@bhavyanavyadancechannel8276 from tkinter import *
      win = Tk()
      l = Label(win, text="I think he said no").pack()

  • @siddharth5339
    @siddharth5339 2 ปีที่แล้ว

    how did he get x and o
    like what is he clicking to make x and o come up

    • @Codemycom
      @Codemycom  2 ปีที่แล้ว

      Just watch the video, I show you exactly.

  • @tedidervishi
    @tedidervishi 11 หลายเดือนก่อน

    🔥

    • @Codemycom
      @Codemycom  11 หลายเดือนก่อน

      🙂

  • @sudin99and81
    @sudin99and81 4 ปีที่แล้ว +2

    👍👍

  • @sakshamkarna9041
    @sakshamkarna9041 2 ปีที่แล้ว

    while(me==like_this_video):
    print("Very cool video. enjoyed it")
    break

    • @Codemycom
      @Codemycom  2 ปีที่แล้ว

      print("Thanks!")

  • @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.

  • @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.

  • @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??

  • @ashutoshjoshi4005
    @ashutoshjoshi4005 4 ปีที่แล้ว +1

    Can I use pycharm for this project?

    • @Codemycom
      @Codemycom  4 ปีที่แล้ว +2

      You can try, but I don't recommend pycharm ever, for anything.

    • @Codemycom
      @Codemycom  3 ปีที่แล้ว +2

      @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 ;)

  • @aayushraj2918
    @aayushraj2918 2 ปีที่แล้ว

    reset function is not working, any solution please

    • @Codemycom
      @Codemycom  2 ปีที่แล้ว +1

      Look at your code, compare it to my code, determine what you did differently.

  • @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 ปีที่แล้ว +1

      Sorry, I'm not sure what you mean...you have an error in your code somewhere.

  • @loniaomi4857
    @loniaomi4857 ปีที่แล้ว

    Sir can I get a flowchart for the program?

    • @Codemycom
      @Codemycom  ปีที่แล้ว

      I have no idea what that is.

  • @viswamberprasad9418
    @viswamberprasad9418 4 ปีที่แล้ว +1

    Would really appreciate if the source code is provided John!

    • @Codemycom
      @Codemycom  4 ปีที่แล้ว +1

      All my source code is on github, link in the pinned comment above

    • @viswamberprasad9418
      @viswamberprasad9418 4 ปีที่แล้ว +1

      @@Codemycom thnx again John!

    • @Codemycom
      @Codemycom  4 ปีที่แล้ว +1

      @@viswamberprasad9418 Sure thing

  • @ita27rmp100
    @ita27rmp100 4 ปีที่แล้ว +1

    May you give me the link of this code in github?

    • @Codemycom
      @Codemycom  4 ปีที่แล้ว

      github.com/flatplanet/Intro-To-TKinter-TH-cam-Course

    • @ita27rmp100
      @ita27rmp100 4 ปีที่แล้ว

      @@Codemycom thank you

    • @Codemycom
      @Codemycom  4 ปีที่แล้ว

      sure thing

  • @neoniq_q
    @neoniq_q 9 หลายเดือนก่อน

    how to make it with flet?

  • @YOGIT_Singh
    @YOGIT_Singh 3 ปีที่แล้ว

    Can i do this same on Jupiter Notebook ???????????

    • @Codemycom
      @Codemycom  3 ปีที่แล้ว +1

      Try it and see

  • @meralmaradia4774
    @meralmaradia4774 3 ปีที่แล้ว

    Nothing comes up on the screen when I run this!!!!

    • @Codemycom
      @Codemycom  3 ปีที่แล้ว

      What did you do differently than the video?

  • @dimitriosdesmos4699
    @dimitriosdesmos4699 4 ปีที่แล้ว +1

    pygam next

    • @Codemycom
      @Codemycom  4 ปีที่แล้ว +1

      It's on the list

  • @codewithahmed9806
    @codewithahmed9806 4 ปีที่แล้ว +1

    How to write minimum if elif condition in this project

    • @Codemycom
      @Codemycom  4 ปีที่แล้ว

      that’s the exercise I tasked you with

    • @codewithahmed9806
      @codewithahmed9806 4 ปีที่แล้ว +1

      @@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 :)

  • @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

  • @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.

  • @AmitPatel-cl6ou
    @AmitPatel-cl6ou ปีที่แล้ว

    Thnks

  • @sorooshkorhani3842
    @sorooshkorhani3842 3 ปีที่แล้ว

    What's the theme name?

    • @Codemycom
      @Codemycom  3 ปีที่แล้ว

      What theme? There is no theme...

  • @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...

  • @joshuakidssong1965
    @joshuakidssong1965 3 ปีที่แล้ว +1

    8:16

  • @ArjunSingh-cw1jo
    @ArjunSingh-cw1jo ปีที่แล้ว

    You look like Walter White

  • @artastica8522
    @artastica8522 4 ปีที่แล้ว +1

    What is root.iconbitmap?

    • @Codemycom
      @Codemycom  4 ปีที่แล้ว

      The titlebar icon

    • @xyzterror6462
      @xyzterror6462 3 ปีที่แล้ว

      Just remove it from the top of the code

  • @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.

  • @LourdHarshanR
    @LourdHarshanR 3 ปีที่แล้ว

    Do a program for ludo

    • @Codemycom
      @Codemycom  3 ปีที่แล้ว

      I don’t know what that is?

  • @djangodev
    @djangodev 3 ปีที่แล้ว +1

    Cod plz

    • @Codemycom
      @Codemycom  3 ปีที่แล้ว +1

      always in the pinned comment

  • @PhoenixVids123
    @PhoenixVids123 ปีที่แล้ว

    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.

  • @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.

  • @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

  • @alhassanmusah7242
    @alhassanmusah7242 ปีที่แล้ว

    Awesome job sir Thanks alot

  • @akshithisola5629
    @akshithisola5629 3 ปีที่แล้ว

    8:16