Intro Python Networking - UDP

preview_player
Показать описание

An introduction to networking in python.
This video shows how to send data over a UDP connection from a server to a client.
Рекомендации по теме
Комментарии
Автор

Thanks a lot, as a beginner, this program gave me enough confidence to go further.

dhruvinshah
Автор

Wish the series continued in python3.4!  You did a great job.

Going to have to search how to send different formats with Python3.4.

timisw
Автор

Thanks! Can't wait for the next installment.

DanielGoodrick
Автор

Can you please create the other videos for this tutorial! I really love the way you explained this. It made sooo much sense to me the way you presented it!!!

mike_marquez
Автор

Very informative tutorial! Keep up the great work!

wabeti
Автор

why stopped? I await for more videos (TCP, etc)

pveratt
Автор

import socket # Import socket module
import time

host = "localhost" # Get local machine name
port = 5454# Reserve a port for your service.
data = "just some text"
data = data.encode('utf-8')

s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) # Create a socket object

while 1:
s.sendto(data, (host, port))
print ("sent " + data.decode('utf-8'))
time.sleep(1)



#this works fine in python 3 versions

mllachin
Автор

this was a great video.. but i was really hoping that you would have the rest of the videos on your channel =(

techgeek
Автор

Very good tutorial. I think it is in Python 2.x. Are there any changes in Python 3. If so can you do one for Python 3 as well. Thanks.

Aarmaxian
Автор

that udp solution is good for relations between server, clients in simple multiplayer games? thx for udp tutorial, it's great :-D

marcinboryczko
Автор

@nnikitaka I cant see why not but im not familiar with the python blender interface

JoshMcCullochNZ
Автор

Can u use this for a game that is made a blender?, blender uses python as a programing language

nnikitaka
Автор

great - when's the next in the series coming out?

SamJoseph
Автор

Great tutorial! I have a question about Python. In C, you can make functions. How would you do that in Python?

AKSoapy
Автор

@aten747 Is this on the sender or receiver script?

JoshMcCullochNZ
Автор

if I wanted to receive different data each time would I need to make a new script or put in another while loop in their?

tango
Автор

Strings in python 3 are unicode by default. But I imagine that sockets need a buffer of bytes. To make ascii strings put a "b" in front of your string like so b"hello world". I haven't got python3 installed to test this so get back to me if it doesn't work.

JoshMcCullochNZ
Автор

@Hcwool
Of course. Your can send anything you can transform into a string. Yous just need to convert it back at the other end. Ill show that in a future video

JoshMcCullochNZ
Автор

I got an error with  s.sendto (data, (HOST, PORT))

excaliberx
Автор

@largestpixel i tried sending it over land and i get the "out of context address" windows error, how do i fix this?

atenofficial
visit shbcf.ru