I&C SCI 32 Lecture Notes - Lecture 4: Newline

40 views2 pages

Document Summary

# this is an example of the raw materials used to connect a python. # program to another program using a socket. # here to use good design principles -- we"ve written only one function, # for example -- but this at least demonstrates how the underlying. # parts of the python standard library work. # will focus on designing a better solution. import socket. # first, we"ll create a socket, which we"ll need in order to connect. # to the echo server. echo_socket = socket. socket() try: print("connecting to echo server") # now we"ll connect, using the echo_host and echo_port values. # on a socket takes a single parameter that indicates where to. # connect; in this case, we"re passing a single tuple containing. # a host and a port, which is why there are two sets of parentheses. # now that we"re connected, we"ll ask the user to type a message,

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers
Class+
$30 USD/m
Billed monthly
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
7 Verified Answers

Related Documents