Simple GUI Chat in Python

  Рет қаралды 171,307

NeuralNine

NeuralNine

3 жыл бұрын

In this video we learn how to build a simple Python chat with a graphical user interface.
◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾
📚 Programming Books & Merch 📚
💻 The Algorithm Bible Book: www.neuralnine.com/books/
🐍 The Python Bible Book: www.neuralnine.com/books/
👕 Programming Merch: www.neuralnine.com/shop
💻 Exclusive Content 💻
👥 Patreon: / neuralnine
🌐 Social Media & Contact 🌐
📱 Website: www.neuralnine.com/
📷 Instagram: / neuralnine
🐦 Twitter: / neuralnine
🤵 LinkedIn: / neuralnine
📁 GitHub: github.com/NeuralNine
🎵 Outro Music From: www.bensound.com/

Пікірлер: 321
@Murat-xh6jg
@Murat-xh6jg 2 жыл бұрын
the way you explain what you doing while doing it, is awesome. I am a VERY new Pythoner and was looking for a video to understand this server client communication. you video did the trick
@matheus-sm
@matheus-sm 2 жыл бұрын
Man, that really help me! I'm searching for this kind of content in portuguese for weeks, without any sucess... Thanks so much!
@notsobob
@notsobob 3 жыл бұрын
I love your videos, man. Apart from learning a lot, your English is impeccable, in particular your intonation and your ability to paraphrase; all your tutorials are really watchable.
@HomelessDeamon
@HomelessDeamon 3 жыл бұрын
Kudos To you NeuralNine this is perfect, as always, have a great day.
@alex_mahone
@alex_mahone 3 жыл бұрын
Another great video! Thanks! Even though you said gui programming is not your thing, but would you make a video or a series of videos going over some gui programming in Python? It's been a weakness of mine, but would like to work on it, and who better to teach it than you :)
@deeparose2926
@deeparose2926 2 жыл бұрын
This is literally amazing!!:)
@preetijain2396
@preetijain2396 3 жыл бұрын
Excellent Tutorial!! Thanks a lot!
@ComputerScienceSimplified
@ComputerScienceSimplified 3 жыл бұрын
Awesome video, keep up the amazing work! :)
@anton-r
@anton-r 3 жыл бұрын
thanks for video as i understand , time 9:30 python must get an Iterable variable this way you put an (arg , ) . it can be tuple , list , etc ..
@eliasc9322
@eliasc9322 3 жыл бұрын
Excelente video !! podrias intentar que el cliente (humano) interactúe con un bot, basado en aiml? y que luego las conversaciones se guardaran en un archivo.json usando tynidb seria genial....
@earthling6717
@earthling6717 2 жыл бұрын
Two small bug fixes >>>> 1.call self.sock.connect() method in client after getting nickname input from client , cause if the client do not input the nickname .. server do not accept other clients ... 2. Before Broadcasting "joined server message" or sending a confirmation massage from server to the client do a small delay .. cause the GUI is not ready yet so it will not show up to the client who just joined Btw, this is the best practical video on socket programming that i found on KZbin
@mixup2216
@mixup2216 2 жыл бұрын
For the first one it is better to create the client handle thread immediately after connecting and then have the beginning of the handle wait for the nick. I think in general it is good practice to fix bugs like this on the server side so that way you wouldn't have someone maliciously connecting to the server without sending any input to block new people from entering or have a client that connects and then their client freezes or something.
@preetijain2396
@preetijain2396 3 жыл бұрын
I we want to make a connection and chat between two different systems, then to what should we change our IP adresses and in which file??
@Lex-qt1cc
@Lex-qt1cc 2 жыл бұрын
I'm 5 minutes in and it's crazy how everything that you say makes sense. Wish I could have found you earlier :)
@dakshsharma-se6rr
@dakshsharma-se6rr 28 күн бұрын
heyy ! do you have source code
@leonardonetagamer
@leonardonetagamer 3 жыл бұрын
Can you please show us how to port forward so we can use the chat from other systems?? I tried with no luck ... thanks!
@omaral-halabiah2851
@omaral-halabiah2851 3 жыл бұрын
I have please, can you put the code for this example on your github account so that we can access it and correct our mistakes
@scottlee38
@scottlee38 Жыл бұрын
Awesome! This will be useful later!
@eyob6288
@eyob6288 2 жыл бұрын
love ur videos by the way🔥🔥🔥🔥
@rizkydewasakti
@rizkydewasakti 2 жыл бұрын
First of all Great Video Neural! *cheers im wondering if you can make another video about combining chat application (sending text) with image transferring using socket library. I hope u can make those tutorials when you have a free time! Thanks
@faijaanmemon
@faijaanmemon 3 жыл бұрын
I think I found an angel ♥️ lots of love and power to you 💝
@shapelvm
@shapelvm 3 жыл бұрын
Thanks a lot from Belarus)!!!
@suryadharshan7048
@suryadharshan7048 3 жыл бұрын
Awesome tutorial. Btw, message sending function shown here enables all clients to broadcast message to everyone. Can u show us the coding of how to send a message to a specific client in the chatroom, so that only that specific client can read it?
@Hamza-ce7ol
@Hamza-ce7ol Жыл бұрын
Dabu bhai ne assignment di thi TCP wali ?
@alinaliea5600
@alinaliea5600 Жыл бұрын
This channel is a gem man on god
@leox23
@leox23 2 жыл бұрын
Awesome video, thank you so much! How can I make it work from a computer in a different network? (not local) I would really apreciate an answer!!!
@ionvud3649
@ionvud3649 3 жыл бұрын
Супер ! Отличный урок
@eladfixler4017
@eladfixler4017 3 жыл бұрын
Thank you man Can you do a clip about communication between tow computer from different local ips?
@danielniels22
@danielniels22 3 жыл бұрын
hello, have you figured out a way to do that? or do you have some code or videos on making that? (communicating between two computers)
@420oppa69
@420oppa69 2 жыл бұрын
@@danielniels22 you need to set the host to '0.0.0.0' and redirect the port on your router to your pc, then connect the client trough your open ip address and port
@Jdeadevil
@Jdeadevil Жыл бұрын
I think you could have explained some of the server script a little better than just "I'm going to type this here" and "this is a basic setup for a server", but just my two cents, it would be useful for people to change code later when they know how it works.
@Clickerztv
@Clickerztv 3 жыл бұрын
how you turned your CMD to transparent background ?
@simssim262
@simssim262 3 жыл бұрын
U deserve million subs
@flashbao1922
@flashbao1922 3 жыл бұрын
I am making all of your codes into notes and it is going to help me get better!
@dakshsharma-se6rr
@dakshsharma-se6rr 28 күн бұрын
heyy ! do you have source code
@mathscomputing93
@mathscomputing93 Жыл бұрын
New Follower. Thank you. Greetings from Mexico
@bassemgouty9840
@bassemgouty9840 3 жыл бұрын
a discord bot making tutorial would be much appreciated especially for the latest versions of discordpy module , keep it up !
@alphascript
@alphascript 3 жыл бұрын
I have a series, sorry for the shameless plug ;)
@bassemgouty9840
@bassemgouty9840 3 жыл бұрын
@@alphascript i ll be more than glad to check it up
@alphascript
@alphascript 3 жыл бұрын
@@bassemgouty9840 Thank you! :D
@SahajOberoi
@SahajOberoi 3 жыл бұрын
I think free code camp has a video on discord bots
@eze9312
@eze9312 3 жыл бұрын
@@alphascript btw ur vídeos are cool
@erik-martin
@erik-martin 3 жыл бұрын
I did this years ago with pygame to build my GUI, what a pain in the butt that was. This looks much cleaner (and quicker).
@_demonamv
@_demonamv 2 жыл бұрын
Don't mind but using pygame is not smart, when there is tkinter
@erik-martin
@erik-martin 2 жыл бұрын
@@_demonamv yes tkinter is the better choice. For me it was more about learning than using the best library.
@_demonamv
@_demonamv 2 жыл бұрын
@@erik-martin Hmm
@barsamrizi5568
@barsamrizi5568 3 жыл бұрын
how do I change the IP to mine? I looked at your website but there was only the 127.0.0.1 Lhost. If I change it to my ip the firewall let it enter, but i can not connect with other devices.
@GrindUntilYouShine
@GrindUntilYouShine Жыл бұрын
Just clicking on the video had a question before it finished so after knee finishes the code for this project how do they go about turning it into a actual app for others to use?
@AdoukaStalks
@AdoukaStalks 3 жыл бұрын
Ive been looking for one!
@NeuralNine
@NeuralNine 3 жыл бұрын
now you found it :)
@omkhard1833
@omkhard1833 2 жыл бұрын
Hi NeuralNine , I m stuck at what @ is used for in python , I saw in some Paramiko programing lectures of my Class ? thanks for any help
@mehdismaeili3743
@mehdismaeili3743 Жыл бұрын
Excellent.thanks.
@manoramapatra8091
@manoramapatra8091 3 жыл бұрын
The moment my idiotic tests will get over I am gonna your all videos from scratch and will try all of them.... Till then I am busting that like button(you are awesome) without even watching
@NeuralNine
@NeuralNine 3 жыл бұрын
Appreciate it brother :)
@zombiekiller7101
@zombiekiller7101 3 жыл бұрын
Same I am also stuck studying for shitty exams😭
@zuberkariye2299
@zuberkariye2299 3 жыл бұрын
@@zombiekiller7101 same
@mikearchman
@mikearchman 2 ай бұрын
I haven't tried this yet,, still watching tutorials. You're earlier videos before this on the same you too use lists to store clients and nicknames. Is there a reason you wouldn't use dictionary instead? That seems convenient.
@eggcat287
@eggcat287 2 жыл бұрын
Do you need to port foward or can you join from another pc ? im gonna start the video like that
@Talkren
@Talkren Жыл бұрын
Is there a way to incorporate an "Online users" section to this? I was trying to this on my own but I got stuck. I wasn't sure if it was something that would need to be done server side and updated to the client or what.
@mixup2216
@mixup2216 2 жыл бұрын
What is the point first defining the client as a class then executing it? Could it work just fine if you made it like the server?
@charan2446
@charan2446 2 жыл бұрын
Exception in Tkinter callback Traceback (most recent call last): File "/usr/lib/python3.9/tkinter/__init__.py", line 1892, in __call__ return self.func(*args) File "/mnt/404EA75214A150D1/Files/Langs/Py_files/client.py", line 72, in write self.sock.send(message.encode('utf-8')) BrokenPipeError: [Errno 32] Broken pipe
@omarmohmad6999
@omarmohmad6999 2 жыл бұрын
It's great, can you explain to us how to make it support encryption messages?
@mr_dysha
@mr_dysha 2 жыл бұрын
Great video!!!
@rupayanroy5997
@rupayanroy5997 3 жыл бұрын
Can anyone help ,please? I did a quite similar program , and everything seems to work just fine, but as soon as I give a nickname , then the other tkinter box (where one would eventually text) kind of freezes and becomes unresponsive The server is running perfectly and connections are okay but the above said problem is something I am not understanding **I have done the program in spyder** Any help would be appreciated!!
@JoelBinsarJupiter
@JoelBinsarJupiter 3 жыл бұрын
thanks man
@davidjoeljoseph3117
@davidjoeljoseph3117 3 жыл бұрын
you are just awesome so i am going to hit and burst your subscribe and like button
@TechBacking
@TechBacking 2 жыл бұрын
Superb
@aryamanchatterjee1654
@aryamanchatterjee1654 3 жыл бұрын
May I keep this project in my CV for interview?
@mcayu6326
@mcayu6326 2 жыл бұрын
Thanks brooo
@saumyakumarthakur3751
@saumyakumarthakur3751 3 ай бұрын
Hey! In Mac OS, the UI frameworks can only be accessed using "main thread", it took me a while to find out why this code was not working for me :)
@MB-ol4hd
@MB-ol4hd Жыл бұрын
Hi there, bit of a new Python coder and having some issues with this coding tutorial that I can't seem to resolve. Once the nickname has been sent from the client to the server, the application drops and I receive "Tcl_AsyncDelete: async handler deleted by the wrong thread" in the terminal from the client side and "nickname = client.recv(1024) ConnectionResetError: [WinError 10054] An existing connection was forcibly closed by the remote host" from the server terminal. Any pointers would be greatly appreciated :)
@eseseis7251
@eseseis7251 3 жыл бұрын
now add asymetric , public and private key for everyone , a file where this can be defined.
@cs_guide_
@cs_guide_ 3 жыл бұрын
Great video
@Enalysis
@Enalysis 3 жыл бұрын
I'm attempting to make it a public server, but when I put my private IPv4 in the Server and my public IPv4 in the client it gives me this error: Traceback (most recent call last): File "C:/Users/REDACTED/PycharmProjects/test/client.py", line 98, in client = Client(HOST, PORT) File "C:/Users/REDACTED/PycharmProjects/test/client.py", line 14, in __init__ self.sock.connect((host, port)) ConnectionRefusedError: [WinError 10061] No connection could be made because the target machine actively refused it
@mixup2216
@mixup2216 2 жыл бұрын
Have you tried setting the IP of both to the public?
@Strawberry-oz1qu
@Strawberry-oz1qu 2 жыл бұрын
Amazing tutorial, but please explain how I can make this chat room work over my home wifi. So that different laptops can send messages in that group chat and host a server on my laptop only. Is it possible? Anyone can help as I am actually very new to networking.
@frog2818
@frog2818 3 жыл бұрын
Thanks
@mattmovesmountains1443
@mattmovesmountains1443 3 жыл бұрын
I'm in way over my head here, but thought I'd follow along to see what I can learn. But after all of that... "OSError: [Errno 99] Cannot assign requested address"
@Luke-sz2ir
@Luke-sz2ir 2 жыл бұрын
nice video and all but when i tryed to test it i could only enter my name and when i started debuging it sayed "15 line [WinError 10061] No connection could be made because the target machine actively refused it" is there maybe a sulution
@spoockybro
@spoockybro Жыл бұрын
Nice video! 34:51 what is with that "Tcl_AsyncDelete: async handler deleted by the wrong thread" error message?
@dakshsharma-se6rr
@dakshsharma-se6rr 28 күн бұрын
heyy ! do you have source code
@spoockybro
@spoockybro 28 күн бұрын
​@@dakshsharma-se6rr I think I do not, but I remember I got rid of the issue by deleting 1 row of the original code
@sumedh7735
@sumedh7735 3 жыл бұрын
Awesome
@yarkngulact3553
@yarkngulact3553 3 жыл бұрын
Dang this video rocks! How can i set it so my friend can join me from another computer?
@dynoagency1323
@dynoagency1323 3 жыл бұрын
port forwarding
@swiveiproduction9192
@swiveiproduction9192 3 жыл бұрын
could you make a tutorial on how to use python plug io, I just think the way you explain this stuff is much easier
@rehanamohammad5852
@rehanamohammad5852 2 жыл бұрын
hi i am getting this error in cmd:python: can't open file 'C:\Users\Admin\serever.py': [Errno 2] No such file or directory
@usefsanjari7618
@usefsanjari7618 Жыл бұрын
Hi thanks for this awesome video. i wrote the codes exactly like this but when i send a message nothing appears on the chat screen , what is the problem ? not showing me any errors too
@PawixTheGreat
@PawixTheGreat 4 ай бұрын
Same, have u figured it out?
@beronicous7086
@beronicous7086 2 жыл бұрын
Can you make an entire thorough tutorial about Socket and threading?
@MrStrongBro
@MrStrongBro Жыл бұрын
For some reason when I run the program, the tkinter window doesn't pop up. 'Process finished with exit code 0' and literally nothing happened. I'm not getting any error messages.
@daniloalvaro2142
@daniloalvaro2142 2 жыл бұрын
Hello I HAVE THIS PROBLEM, why is this statement pops out in cmd: (ConnectionRefusedError: [WinError 10061] No connection could be made because the target machine actively refused it )?
@goodn1051
@goodn1051 3 жыл бұрын
could you make a video on how to use socket to send large sized videos
@samuelhellqvist1396
@samuelhellqvist1396 2 жыл бұрын
I seem to have a problem in the very last line of code: client = Client(HOST, PORT) I get the error message: TypeError: Client() takes no arguments Does anyone know how to fix this?
@mohitesahil5284
@mohitesahil5284 2 жыл бұрын
same error
@ServerDotExe
@ServerDotExe 2 жыл бұрын
if you figured out how to fix it tell me please!
@Koaleck
@Koaleck Жыл бұрын
how did you do the last part with the command "Python server.py"? because i did that in my command prompt and it says that it didn't find anything
@Talkren
@Talkren Жыл бұрын
You will need to either open IDLE and launch it via that OR you need to update your Path system variable file. Otherwise you can open CMD, type 'py' and get the Python interface in CMD. But this is the same thing as just using IDLE.
@ChannelName991
@ChannelName991 3 жыл бұрын
Hey, I actually made a chat app very similar to that. Your explanation was really clear btw, thanks
@a67tejaskhandale99
@a67tejaskhandale99 2 жыл бұрын
can you p;lease send me the source code. please,
@king17388
@king17388 Жыл бұрын
@@a67tejaskhandale99 can you send to me as well
@king17388
@king17388 Жыл бұрын
if in python can you send to me as well
@b07x
@b07x 3 жыл бұрын
I didnt watch yet, but i know its a good video.
@NeuralNine
@NeuralNine 3 жыл бұрын
hahahah thank you :D
@dedisupardi2815
@dedisupardi2815 Жыл бұрын
Cool 👍
@therealbiggaskell
@therealbiggaskell 11 ай бұрын
how can these two scripts be set up if I want different computers on different networks to join the server? I have port forwarding enabled for my ipv4 address, but when I replace my server scripts ip constant with it, and then use my public ipv4 address for the client constant, it doesnt connect
@dakshsharma-se6rr
@dakshsharma-se6rr 28 күн бұрын
heyy ! do you have source code
@zhabiboss
@zhabiboss Жыл бұрын
Cannot fully see your code because of your facecam, but overall the explanation is magnificent!
@JonoBaritaspasial
@JonoBaritaspasial 2 жыл бұрын
Thanks. Very helpful
@andreymota75
@andreymota75 3 жыл бұрын
Nice video men
@NeuralNine
@NeuralNine 3 жыл бұрын
thanks :)
@nameundefined6265
@nameundefined6265 3 жыл бұрын
I would like to use pyQt5 for GUIs if I were you. pyQt > tkinter Btw there is an alternative to youtube called LBRY.tv and you should check that out. Btw I like the video, and everyone should do same.
@shrishsunder1794
@shrishsunder1794 3 жыл бұрын
nice one
@NeuralNine
@NeuralNine 3 жыл бұрын
thank you :)
@selarone
@selarone 2 жыл бұрын
Im having the issue where the server file is running fine it's just the client file that dosen't want to run
@dankmemequeen9581
@dankmemequeen9581 2 жыл бұрын
I always wondered, what does the intro say in the beginning? Does anyone know?
@shuvadipghosh374
@shuvadipghosh374 2 жыл бұрын
Sir when we are closing the gui window the full program is not closing
@mysteriousjuice7061
@mysteriousjuice7061 2 жыл бұрын
can anyone help me on how to get the nicknames list from the server to the client-side and put the list of nicknames to the GUI (inside the combobox)?
@__3093
@__3093 3 жыл бұрын
WOOO
@SaikyoSenpai
@SaikyoSenpai 2 жыл бұрын
self.input_area.delete('1.0','end') showing syntax error def stop(self): same for this one
@elijahjacobson-media8773
@elijahjacobson-media8773 2 жыл бұрын
when i run this it shows this error: server.listen() ^ SyntaxError: invalid syntax
@pratiksherchan6603
@pratiksherchan6603 2 жыл бұрын
server.py file doesnot run in cmd its show some syntax error but it runs in pycharm any help?
@semeremanchawi1228
@semeremanchawi1228 3 жыл бұрын
Best
@diypersonalacc
@diypersonalacc 3 жыл бұрын
Do you have this project how to download this
@eyob6288
@eyob6288 2 жыл бұрын
can u make a video on a feature that can make a custom ip and port config
@coderanger7708
@coderanger7708 3 жыл бұрын
You could have used a dictionary for client-nickname to make it simpler right
@NeuralNine
@NeuralNine 3 жыл бұрын
True that i guess ^^
@coderanger7708
@coderanger7708 3 жыл бұрын
@@NeuralNine yeah that whole code where you use two indices to remove two items from two lists can be reduced to one line
@letsgetremixed1345
@letsgetremixed1345 2 жыл бұрын
Damn I wish there was this exact video but for java
@ravjotsingh8504
@ravjotsingh8504 3 жыл бұрын
can anyone upload code on github i want to compare coz i am getting errors
@ehsam8202
@ehsam8202 2 жыл бұрын
When i try to run it through cmd prompts it says "TypeError: bind() takes exactly one argument (2 given)". What should i do?
@sklj1239
@sklj1239 2 жыл бұрын
Try putting them between (), so it takes it as a tuple. :D
@darkdragonseye7371
@darkdragonseye7371 3 ай бұрын
"AF_INET" is not defined Pylance(reportUnderfinedVarible) [Ln 7, Col 31]
@leonardonetagamer
@leonardonetagamer 3 жыл бұрын
I also edited the code to send multiple messages in a row ... can you show how to make one the client.recv part stop when it recieves one message?
@ellisdoesstuff
@ellisdoesstuff 6 ай бұрын
how did you do it i beg i havent been able to make it work
@leonardonetagamer
@leonardonetagamer 6 ай бұрын
@@ellisdoesstuff it wasn't working for me either actually, idk what went wrong
@nikro7239
@nikro7239 3 жыл бұрын
Is it possible to integrate it with a mobile app?
@rishabh8312
@rishabh8312 Жыл бұрын
self.text_area.pack(padx=20, pady=5) TypeError: Pack.pack_configure() missing 1 required positional argument: 'self'
Simple Voice Chat in Python
8:32
NeuralNine
Рет қаралды 41 М.
Modern Graphical User Interfaces in Python
11:12
NeuralNine
Рет қаралды 1,4 МЛН
skibidi toilet 73 (part 1)
04:46
DaFuq!?Boom!
Рет қаралды 25 МЛН
Когда стал самым умным
00:13
Double Bubble
Рет қаралды 16 МЛН
Which one will take more 😉
00:27
Polar
Рет қаралды 6 МЛН
Python Sockets Simply Explained
39:33
NeuralNine
Рет қаралды 147 М.
Coding Encrypted Chat in Python
20:33
NeuralNine
Рет қаралды 41 М.
Python GUI Development With PySimpleGUI
15:15
Real Python
Рет қаралды 993 М.
Simple TCP Chat Room in Python
25:39
NeuralNine
Рет қаралды 200 М.
Top 18 Most Useful Python Modules
10:50
Tech With Tim
Рет қаралды 920 М.
The Simplest Python Chat You Can Build
7:00
NeuralNine
Рет қаралды 56 М.
I use Drag and Drop to build modern Python Apps
14:08
Softlinks
Рет қаралды 30 М.
Camera Chat in Python
10:11
NeuralNine
Рет қаралды 40 М.
Broken Flex Repair #technology #mobilerepair
0:55
ideal institute aligarh
Рет қаралды 14 МЛН
План хакера 🤯 #shorts #фильмы
0:59
BruuHub
Рет қаралды 845 М.
Why spend $10.000 on a flashlight when these are $200🗿
0:12
NIGHTOPERATOR
Рет қаралды 15 МЛН
Распаковка айфона под водой!💦(🎥: @saken_kagarov on IG)
0:20
Взрывная История
Рет қаралды 8 МЛН
NOTHING PHONE 2A - НЕОБЫЧЕН ВО ВСЕМ!
30:39
DimaViper
Рет қаралды 47 М.
Нужен ли робот пылесос?
0:54
Катя и Лайфхаки
Рет қаралды 587 М.