Hi, I require a python code which will draw the Drobbox logo (The name is not ne
ID: 3744462 • Letter: H
Question
Hi, I require a python code which will draw the Drobbox logo (The name is not neccesary just the logo). There is code provided of a box which is 100 pixel by 100 pixel, the dropbox logo must be drawn in this box and must fit the size of the box (meaning it should not go over the sides and should be a perfect fit. It must be done in Python 3.6.1 or Higher. The box image is provided as is the code for it down below. After the logo is drawn the pen should return to the exact starting point of where it began before it drew the box. Any other questions please let me know down below.
from turtle import *
#box
pencolor('Black')
fillcolor('#3B5998')
pendown()
begin_fill()
setheading(90)
forward(100)
setheading(0)
forward(100)
setheading(270)
forward(100)
setheading(180)
forward(100)
end_fill()
penup()
Explanation / Answer
host_id = "?"
BASE_URL = ’https://client10.dropbox.com/’
register_url = BASE_URL + ’register_host’
list_url = BASE_URL + "list"
# headers
headers = {’content-type’:
’application/x-www-form-urlencoded’,
’User-Agent’: "Dropbox ARM" }
# message
data = ("buildno=ARM&tag=&uuid=42&"
"server_list=True&host_id=%s"
"&hostname=r" % host_id)
r = requests.post(register_url,
data=data, headers=headers) extract data
data = json.loads(r.text)
host_int = data["host_int"]
root_ns = data["root_ns"]
# fetch data list
root_ns = str(root_ns) + "_-1"
data = data + ("&ns_map=%s&dict_return=1"
"&server_list=True&last_cu_id=-1&"
"need_sandboxes=0&xattrs=True"
% root_ns)
# fetch list of files
r = requests.post(list_url,
data=data, headers=headers)
data = json.loads(r.text)
paths = data["list"]
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.