summaryrefslogtreecommitdiffstatshomepage
path: root/docs/esp8266/tutorial/network_tcp.rst
diff options
context:
space:
mode:
Diffstat (limited to 'docs/esp8266/tutorial/network_tcp.rst')
-rw-r--r--docs/esp8266/tutorial/network_tcp.rst4
1 files changed, 2 insertions, 2 deletions
diff --git a/docs/esp8266/tutorial/network_tcp.rst b/docs/esp8266/tutorial/network_tcp.rst
index 26a2f469ce..852fc82f39 100644
--- a/docs/esp8266/tutorial/network_tcp.rst
+++ b/docs/esp8266/tutorial/network_tcp.rst
@@ -61,6 +61,7 @@ of the request you need to specify the page to retrieve.
Let's define a function that can download and print a URL::
def http_get(url):
+ import socket
_, _, host, path = url.split('/', 3)
addr = socket.getaddrinfo(host, 80)[0][-1]
s = socket.socket()
@@ -74,8 +75,7 @@ Let's define a function that can download and print a URL::
break
s.close()
-Make sure that you import the socket module before running this function. Then
-you can try::
+Then you can try::
>>> http_get('http://micropython.org/ks/test.html')