Socket Chatroom server – Creating chat application with sockets in Python

///Socket Chatroom server – Creating chat application with sockets in Python

Socket Chatroom server – Creating chat application with sockets in Python

FavoriteLoadingAdd to favorites

We’ve made it through the basics of working with sockets, and now we’re ready to try to actually build something with them, so, in this sockets with Python tutorial, we’re going to build a console-based chat app.

Text-based tutorials and sample code:

Channel membership:
Discord:
Support the content:
Twitter:
Facebook:
Twitch:
G+:

source

By |2019-05-22T19:17:12+00:00May 22nd, 2019|Python Video Tutorials|41 Comments

41 Comments

  1. I Samurai I May 22, 2019 at 7:17 pm - Reply

    So the code that follows the else statement, handles the connection that have already been established but not for the newly created ones right? I'm a little confused

  2. Roger gavroche May 22, 2019 at 7:17 pm - Reply

    Hey, really good video but, I don't understand : I have a " 'NoneType' object is not subscriptable " error on line 47 and I don't know why. Iwrote the exact same line as you and review it several times but it still don't working.
    Please, I really need your help :'(

  3. Vaibhav Singh May 22, 2019 at 7:17 pm - Reply

    Hey Sentdex, I've following your channel for a long time now and I've grown accustomed to your style of teaching. I just have a little suggestion to you that I think would make your videos more awesome. Before writing any line of code that might not be obvious for the viewers to imagine and see why it's used, please explain a little bit about it or what the end result would be, sometimes it's hard for us to figure out and try to formulate as we what the end result might be. Like at 3:10 you explained why we used setsockopt () but at 14:20 and 17:30 it started to get cluttered up very fast and I got lost.
    Just a little input from my side. Thank you for your tutorials.

  4. AUGUSTUS CAESER May 22, 2019 at 7:17 pm - Reply

    please do django channels chat apppp

  5. Андрей локас May 22, 2019 at 7:17 pm - Reply

    oooo wow you are just superb!!
    its my fav tutorials 🙂
    hope you do full course tutorials for python!
    thanks !!

  6. hellow 24 May 22, 2019 at 7:17 pm - Reply

    Just joking bro, i really enjoyed the video and really i got inspired by this

  7. hellow 24 May 22, 2019 at 7:17 pm - Reply

    Such an amazing explanation,,,,,,,,, i understood nothing,

  8. Randy Diaz May 22, 2019 at 7:17 pm - Reply

    Someone is cheating on python! lol false, true is javascript/c++/java/Go. Also note that you can do

    if not message:

    instead of

    if message is False:

  9. Tobias Lundgren May 22, 2019 at 7:17 pm - Reply

    Thank you for an awesome tutorial!

  10. Raj Polinovsky May 22, 2019 at 7:17 pm - Reply

    Thank you for the video.!
    Very interesting.

    But there are many such examples.

    And how can you make a chat using stur so that you can send messages for NAT?

  11. Sam Slim May 22, 2019 at 7:17 pm - Reply

    You can use Mediator design pattern in this tutorial

  12. Tech Mind May 22, 2019 at 7:17 pm - Reply

    Wow, these tutorials are timely af

  13. Sachin reddy May 22, 2019 at 7:17 pm - Reply

    OMG!!!! it's Edward Snowden making YouTube videos. Bro….How are you on YouTube? Big Fan..

  14. Sébastien Lavoie May 22, 2019 at 7:17 pm - Reply

    22:09 The code runs!!! 🙂 Superb tutorial! As always, it's fun to watch. By the way, if I may, I would suggest splitting long lines so that you don't have to zoom out. As long as parentheses are used, you can pretty much cut the string wherever you want for any kind of statement, like:
    print(f'Very long {text_variable} going '
    'here and continuing there. '
    'Actually with proper indentation of course.')

    Thank you. Your kitchen must be filled with quite a huge collection of mugs, that's also entertaining :).

  15. ze dias May 22, 2019 at 7:17 pm - Reply

    I like your fish cup

  16. Krzych4ever May 22, 2019 at 7:17 pm - Reply

    Can someone tell e if I add my test to that and do few minor changes can I post it into my github(with declaration that good portion is from sentdex)?

  17. Kittu Penugonda May 22, 2019 at 7:17 pm - Reply

    please create personal chat application

  18. Kune Mohith May 22, 2019 at 7:17 pm - Reply

    Hey sentdex, How do you learn/refer docs/sourcecode without an IDE like pycharm/intelliJ. Please tell me a way to refer documentation without internet. How do you do it?

  19. Nguyễn Văn Tín May 22, 2019 at 7:17 pm - Reply

    It's been a long time..

  20. Finance Owl May 22, 2019 at 7:17 pm - Reply

    Awesome. Love socket prog

  21. bloodgain May 22, 2019 at 7:17 pm - Reply

    Good start to this tutorial; I'm looking forward to seeing the next part.

    Minor quibble with your receive_message function: since your "good" return value is a dict, it's really better if you return an empty dict on failure, or at least None, rather than False. Multivariate return types are problematic because they are less predictable to users and require extra — and usually non-Pythonic — handling code everywhere the function is called. Pandas does this, and it drives me nuts, but there's no other package that approaches what it does. None gets a pass because it's a non-value, and "may return None" is considered a standard function contract by the Python community — which, of course, you'd say explicitly in your docstring.

    Since both None and empty dict are "falsey", you can still check with "if [not] message:", though some "ask forgiveness, not permission" diehards will say you should really just try to access message and handle the empty/None case in the except clause. Note that the latter method is only advisable in Python, though, and using exceptions for flow control is frowned upon in most programming languages.

  22. Liangyu Min May 22, 2019 at 7:17 pm - Reply

    long time no see….

  23. ThatOnlyFan May 22, 2019 at 7:17 pm - Reply

    Yaaaaay! You're back!

  24. Muhammad Usman May 22, 2019 at 7:17 pm - Reply

    i m promoting your channel in udemy, when ever they say buy this series from us,its good its super cheap i paste your website links down in the comments 😀

  25. Coded Pain May 22, 2019 at 7:17 pm - Reply

    I LOVE YOU! I am literally trying to figure out how to make a chatroom server, which only receives messages from clients and delivers them to other clients connected, for a whole week now

  26. VISHAL SHARMA May 22, 2019 at 7:17 pm - Reply

    hey sentdex I love your tutorials You are awesome

  27. 4Destraidos English Channel May 22, 2019 at 7:17 pm - Reply

    like

  28. Aditya Chitrigemath May 22, 2019 at 7:17 pm - Reply

    Hey sentdex could you do a video on OpenCL.

  29. MA CODEPAGE May 22, 2019 at 7:17 pm - Reply

    Waiting for the next part. Great video Sentdex.

  30. Koens May 22, 2019 at 7:17 pm - Reply

    I love you and your videos sentdex!!! Thanks for all of the incredible content, you're the reason I started Python! <3

  31. Aditya Singh May 22, 2019 at 7:17 pm - Reply

    Ayyyye!! You're back!! I owe you one bro… Your machine learning videos have made a huge boost in my resume!! Thought to inform you that you are making a huge difference!! Love from India !!

  32. joshua donatante May 22, 2019 at 7:17 pm - Reply

    What are these quads you got hung on a wall? Have you already talked about it? I can see some of them may be acrobatic ones! Will you share you point of view on UAVs?

  33. hamza bouissi May 22, 2019 at 7:17 pm - Reply

    can u tell us how many connection can connect into one chatroom ?!

  34. Nabeegh Ahmed May 22, 2019 at 7:17 pm - Reply

    I remember your old days bro, that small room and making GTA V AI videos, you have come a long way and it was phenomenal to be a part of this

  35. Samir Data Academy May 22, 2019 at 7:17 pm - Reply

    Really cool video

  36. soukaina Ouhame May 22, 2019 at 7:17 pm - Reply

    Nice !

  37. night soul May 22, 2019 at 7:17 pm - Reply

    Niceee

  38. Michael H. Armstrong May 22, 2019 at 7:17 pm - Reply

    4th

  39. Francesco Buccoliero May 22, 2019 at 7:17 pm - Reply

    Cool!

  40. Stinosko May 22, 2019 at 7:17 pm - Reply

    Better to have the stripper to be safe than sorry 🤔

  41. Harsath Zuckonit May 22, 2019 at 7:17 pm - Reply

    WOW….This is Interesting.

Leave A Comment

*