发布时间:2024-08-12 14:01
pip install ISS-Info
import ISS_Info
import turtle
import time
import json
import urllib.request
screen = turtle.Screen()
screen.setup(720, 360)
screen.setworldcoordinates(-180, -90, 180,90)
screen.bgpic(\"map.png\")
screen.bgcolor(\"black\")
screen.register_shape(\"isss.gif\")
screen.title(\"Real time ISS tracker\")
iss = turtle.Turtle()
iss.shape(\"isss.gif\")
http://api.open-notify.org/astros.json
astronauts = turtle.Turtle()
astronauts.penup()
astronauts.color(\'black\')
astronauts.goto(-178,86)
astronauts.hideturtle()
url = \"http://api.open-notify.org/astros.json\"
response = urllib.request.urlopen(url)
result = json.loads(response read())
print(\"There are currently \" + str(result [\"number\"]) + \" astronauts in space:\")
print(\"\")
astronauts.write(\"People in space: \" + str(result[\"number\"]), font=style)
astronauts.sety(astronauts.ycor() - 5)
people = result[\"people\"]
for p in people:
print(p[\"name\"] + \" on: \" + p[\"craft\"])
astronauts.write(p[\"name\" ] + \"on:\" + p[\"craft\"], font=style)
astronauts.sety(astronauts.ycor() - 5)
http://api.open-notify.org/iss-now.json
while True :
location = ISS_Info.iss_current_loc()
lat = location[\'iss_ position\'][\'latitude\']
lon = location[\'iss_ position\'][\'longitude\']
print(\"Position: \\n latitude: {}, longitude: {}\" .format(lat, lon))
pos = iss.pos()
posx = iss.xcor()
if iss.xcor() >= (179.1): ### Stop drawing at the right edge of
iss.penup() ### the screen to avoid a
iss.goto(float(lon), float(lat)) ### horizontal wrap round line
time.sleep(5)
else:
iss.goto(float(lon), float(lat))
iss.pendown()
time.sleep(5)
# 深圳
lat = 112.5118928
lon = 23.8534489
prediction = turtle.Turtle()
prediction.penup()
prediction.color(\'yellow\')
prediction.goto(lat, lon)
prediction.dot(5)
prediction.hideturtle()
url = \'http://api.open-notify.org/iss-pass.json?lat=\' + str(lat-90) + \'&lon=\' + str(lon)
response = urllib.request.urlopen(url)
result = json.loads(response.read())
over = result [\'response\'][1][\'risetime\']
prediction.write(time.ctime(over), font=style)
目标检测FPN(Feature Pyramid Networks)的使用
OpenCV计算机视觉实战 - 图像特征(Harris+Sift)检测 和 全景图像拼接
.net6 web api中使用SqlSugar(MySQL数据库)
在MATLAB中快速画圆(给出圆心坐标和半径就能直接画的那种)
SAP 电商云 Spartacus UI 根据 url 设置 site context 的具体例子
集群计算——Spark-Spark Core 、Spark Streaming、Spark SQL、MLlib、Spark集群管理器
人工智能、数据挖掘、机器学习和深度学习之间,主要有什么关系?
c语言strcpy两字符串长度不同,(C语言)自己写字符串操作函数(一)——strlen/strcpy/strcat/strcmp/st...