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.
Sample code for this basics series: http://pythonprogramming.net/beginner-python-programming-tutorials/
Python 3 Programming tutorial Playlist: http://www.youtube.com/watch?v=oVp1vrfL_w4&feature=share&list=PLQVvvaa0QuDe8XSftW-RAxdo6OmaeL85M
Code from this video has been adapted, updated, and ported from Python 2.7 from: http://www.binarytides.com/python-socket-programming-tutorial/
http://seaofbtc.com
http://sentdex.com
http://hkinsley.com
https://twitter.com/sentdex
Bitcoin donations: 1GV7srgR4NJx4vrk7avCmmVQQrqmv87ty6
Amazon Auto Links: No products found.
Hello Sir,
Can you please suggest me a book or full video series for Python socket programming…
THANK YOU!!!!!!!!
Thanks a lot for your video. I’m trying to pass the course called py4e now and on the way I’ve just stumbled across some difficulties to understand sockets and your video was a big help.
what will request line do?
ryan gosling is that u
very good
I’d like to create a Python program that shuts down all devices on my network. (IP address space: [192,168,0,0], [192,168,255,255]) We only use Windows 7 and 10 each 64 BIT. – Who has three pupating children knows the reason … 😉
How can I change the code?
I have created the following program, but it does not work. Who can help me or write a better code?
There is the following error message:
ip = raw_input(“[[192,168,0,0],[192,168,255,255]]:”)
NameError: name ‘raw_input’ is not defined
Program Design:
import socket
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
ip = raw_input(“[[192,168,0,0],[192,168,255,255]]:”)
nachricht = raw_input(“Nachricht: Jetzt ist Schlafenszeit”)
s.sendto(nachricht, (ip, 1))
s.close()
if message == “shutdown” :
ser.close()
os.system(“shutdown -h now”)
sys.exit()
else: print(“Gute Nacht”)
Who have a better idea?
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!
What does this line means? s=socket.socket(socket.AF_INET, socket.SOCK_STREAM) What does this syntax means “socket.socket()” and socket.AF_INIT? Can’t we use just AF_INIT and Stream as parameter?
what kind of difference does it make to use urllib and socket module anyway?
port 20, wat?
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
mfw ftp is on 21 not 20
you room is more organized than my life
Hey sentdex, I want real-time communication between a Raspberry pi device and Android application.
What should I do?
Please share your knowledge.
bro you will you use 21 first then use port 20 for connection to FTP .
Sentdex i need your gmail username for a tool that I coded for you I hope you will enjoy it
I think the best way to get an IP address or using other words to resolve the server name using CMD is by using NSLOOKUP
why did u add “‘nn” in request ?
hi! great tutorial series. I run the code but didnt get the same output, I got this
78.41.204.27
b’HTTP/1.1 505 HTTP Version Not Supportedrnconnection: closernserver: nginxrndate: Mon, 12 Mar 2018 20:27:23 GMTrncontent-length: 0rnrn’
why is this happening?
you’re a hell of a funny person xD
All i heared was (suck it)
I love your tutorials so much, very informative and an effective way to learn. keep it up man
Hello sentdex thank,s for making this series can you make real chat application in python through which sender can send text and image like skype
Hey I need some help! I want to write a private pyradio with sockets but I don’t know how to stream it. Could you help me?
I have the tool ready just give me the email address i promise this code is not scam code
You are such a nice guy, you are giving us free course. Thanks 🙂