Created
February 7, 2019 11:51
-
-
Save songritk/1d283ce0eb67653f92541e9e973b1c17 to your computer and use it in GitHub Desktop.
ตัวอย่าง client เปลี่ยนข้อความตัวอักษรเป็นตัวพิมพ์ใหญ่ สำหรับการเรียนวิชา Computer Networks, NPU Computer Engineer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
from socket import * | |
serverName='127.0.0.1' | |
serverPort=12002 | |
clisock=socket(AF_INET,SOCK_DGRAM) | |
mesg=input('Input lowercase sentence:') | |
clisock.sendto(mesg.encode(),(serverName, serverPort)) | |
modifiedMessage, serverAddress = clisock.recvfrom(2048) | |
print(modifiedMessage.decode()) | |
clisock.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment