Python 3 Programming Tutorial - Sockets intro

preview_player
Показать описание
In this Python 3 tutorial video, we cover the socket module. The socket module is a part of the standard library, so no installation is required. Sockets are an integral part for networking, but often confusing. I am by no means an expert on sockets, but I can at least share the knowledge I have on them.

Bitcoin donations: 1GV7srgR4NJx4vrk7avCmmVQQrqmv87ty6
Рекомендации по теме
Комментарии
Автор

Hey SentDex! I have just finished your Python Basics Playlist! I have been learning from it since almost 3 days. Thanks a lot! Your explanation is simply unbelievable! I know the whole basics of python today and that's solely because of you.

THANKS A LOT!

yeshwanthallampati
Автор

About your video:
Thanks for putting this up for Python 3, and pointing out the differences it has with P2. Because I'm stupid (and stubborn) enough to run P3 on Windows and P2 on my Linux VM and Raspberry Pi, as a beginner, this was a very big help.

About your channel:
About a year ago I started to learn some 'easier to grasp' languages/libs. (HTML, CSS, some frameworks, Ruby (RoR) and Python (Django)) (My curiosity also let me stumble upon some C/C++/C#/Java and x_86 assembly as well, just to introduce myself to the differences in syntax. Not to actually start coding in obviously.)
Wanted to tell you that your video's are a really nice 'bridge' from the absolute basics to starting to use libraries on your own and starting to tackle small problems on your own. For all the content and information I leeched off your channel you should definately be rewarded. In a couple years I will hopefully graduate and have the financial breathing room to donate to basicly everyone that taught me as much as you did as a token of appreciation. Untill then I hope this message will fulfill that role.

THANKS A LOT BRO

plp
Автор

Yay, you made the socket videos. Thank you so much.

BrewOnABike
Автор

I started learning python recently and found so many resources but none of them were helpful. But your videos and website were so much helpful and understandable. thank you so much for putting so many efforts. looking forward to learn more.

vineelgarsa
Автор

Man, you are AWESOME!! I spent the last 6 hours trying to figure out something related to sockets and this tutorial just cleared everything <3

vivekteega
Автор

LIKED YOUR VIDEO...

FYI:
AF_INET == "Address Family_ Internet" == "Address Family_ipv4"

So AF == "Address Family"

Indeed sockets (including "web" sockets) are challenging as a concept mostly because even the guys who thought up the protocol back in the mid/late 2000's knew what they NEEDED, but could only describe what they needed as "something BETTER than HTTP" :-|

THAT begs the question "WHAT was 'HTTP'" to them, and WHAT were its WEAKNESSES that even NEEDED to be BETTER?"
:-|

IF "HTTP" is a "PROTOCOL for FORMING and USING a CONNECTION between CODE playing the ROLE of SERVER and code playing the ROLE of CLIENT", THEN:
- HTTP was BI-DIRECTIONAL, in that information was flowing BOTH directions (FROM Client TO Server as a REQUEST, then FROM Server to CLIENT as a RESPONSE);
- HTTP was SYNCHRONOUS (I'll use this term carefully here); The SERVER COULDN'T send a RESPONSE until it had completely received (and processed) a REQUEST;
- HTTP was HALF-DUPLEX (If the CLIENT was SENDING its request, then the SERVER COULDN'T be sending its response until the connection was "clear");

These limitations were QUICKLY recognized in the mid/late 2000's because BANDWIDTH was still LOW throughout much of the world.

SO FAR SO GOOD...

SINCE Humans being have an (amazing) build-in capability to NEGATE things (you could argue this is how we dreamed up the concept of "God"), then all the top Internet propeller-heads started thinking of a NEW, BETTER protocol that was still bi-directional, but WASN'T synchronous and WASN'T half-duplex.
:-O
** VOILA ** - they now KNEW what this brave, new protocol needed to be (basically "NOT HTTP"), but it needed a cool name...
Well, they must've been friends with the guys who dreamed up "Hadoop" and every OTHER stupid, NON-self-describing technology name, because "WEBSOCKET" didn't make sense to ME back THEN... and it still DOESN'T now either :-|

But we're stuck with it ;-)

WHY they couldn't have simply called it "HTTP2" or "HTTP.next" or "HTTPgen2" or "HTTPg2"... but that would have made sense, and that's simply goes against the very nature of the entire Internet ;-)

SO a "WEBSOCKET" is the name given to both the PROTOCOL and even the actual CONNECTIONS between clients and servers...
"Let's OPEN a SOCKET" (equivalent to saying "Let's open a CONNECTION")
"Let's SEND a MESSAGE using WEBSOCKET" (equivalent to saying "Let's send a message using a PROTOCOL")

You'd think it's been nearly 30 YEARS since Al Gore "created the Internet" ;-)...
... and we STILL SUCK at both NAMING and EXPLAINING some pretty important concepts.

IMAGINE if MEDICINE was as bad a INTERNET ENGINEERING :-O
IMAGINE if DOCTORS were as bad as INTERNET ENGINEERS :-O
We'd all be dead.

Cheers,
-Mark Vogt | Senior Solution Architect/Data Scientist, Avanade (www.avanade.com)

VOGTLANDOUTDOORS
Автор

Hey +sentdex, might you be able to create a tutorial for making a messaging application with sockets and either localhost/ip or a personal server? I'm quite interested in sockets and messaging, and I feel like combining them would be cool. Keep up the great work!

darkhailhailfire
Автор

There is a difference between teaching programming and saying type this and it will just work.

benjahnz
Автор

*types "import socket"*. "sockets are part of python standard libraries so you don't have to download anything". OHH! Thank GOD! No downloading crap!

quantumcored
Автор

Thanks qlot
Finally I found this tut
Is detailed
Cause you explan every step that u do
Ilove you man
God place you
Greetings from Iraq

bit
Автор

you room is more organized than my life

thinkinganame
Автор

I love your tutorials so much, very informative and an effective way to learn. keep it up man

nocraftgames
Автор

Thank you! Simplicity is key and th is lecture certainly i was helpful to learn about sockets and how to basically work with them

TheAncientOneOfDays
Автор

Thankyou, i was looking for this. your other tutorial on image processing are also awesome.

cybermascot
Автор

This is excellent. I have been trying to learn more on this subject. Awsome!!

Jenko
Автор

the 49 dislikes are script kitties, Love your channel dude your doing gods work

hyperunstable
Автор

Very good stuff u break it down so anyone can learn with a little effort

keenanwilliamson
Автор

my programme does not terminate it keeps on waiting in the loop for the next method how make it exit the loop when there is no more data to receve

nabhirajjain
Автор

You are such a nice guy, you are giving us free course. Thanks :)

miosz
Автор

Thanks a lot for this! You were super clear 👍🏻 ☺️ first video I found of your's def checking out the others!

daofudaofu