Files
freeCodeCamp/curriculum/challenges/italian/07-scientific-computing-with-python/python-for-everybody/networking-write-a-web-browser.md
Nicholas Carrigan (he/him) f25e3e69f8 feat: enable new langs (#42491)
Enable italian and portuguese
2021-06-15 13:19:18 +05:30

709 B

id, title, challengeType, videoId, dashedName
id title challengeType videoId dashedName
5e7b9f0c0b6c005b0e76f073 Networking: Write a Web Browser 11 zjyT9DaAjx4 networking-write-a-web-browser

--question--

--text--

What does the following code create?:

import socket

mysock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
mysock.connect(('data.pr4e.org', 80))
cmd = 'GET http://data.pr4e.org/romeo.txt HTTP/1.0\r\n\r\n'.encode()
mysock.send(cmd)

while True:
    data = mysock.recv(512)
    if len(data) < 1:
        break
    print(data.decode(),end='')
mysock.close()

--answers--

A simple web server.


A simple email client.


A simple todo list.


A simple web browser.

--video-solution--

4