-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
132 lines (127 loc) · 3 KB
/
main.py
File metadata and controls
132 lines (127 loc) · 3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
# from turtle import Turtle, Screen
# import random
#
# # tim = Turtle()
# screen = Screen()
# screen.colormode(255)
# #
# # colors = ['red', 'blue', 'green', 'yellow', 'purple', 'pink', 'cyan']
#
# # for numside in range(3, 8):
# # angle = 360 / numside
# # for i in range(numside):
# # tim.forward(100)
# # tim.right(angle)
#
# # dir = [0, 90, 180, 270]
# # tim.width(5)
# # tim.speed("fastest")
# #
# # def random_color():
# # r = random.randint(0, 255)
# # g = random.randint(0, 255)
# # b = random.randint(0, 255)
# # random_col = (r, g, b)
# # return random_col
#
# # for i in range(0, 100):
# # tim.color(random_color())
# # tim.forward(30)
# # tim.setheading(random.choice(dir))
# # tim.color(random.choice(colors))
# # size = 10
# # for _ in range(int(360 / size)):
# # tim.color(random_color())
# # tim.circle(100)
# # tim.setheading(tim.heading() + size)
#
# # timmy_the_turtle.shape("turtle")
# #
# # timmy_the_turtle.forward(100)
# # timmy_the_turtle.left(90)
# # timmy_the_turtle.forward(100)
# # timmy_the_turtle.left(90)
# # timmy_the_turtle.forward(100)
# # timmy_the_turtle.left(90)
# # timmy_the_turtle.forward(100)
# #
# # screen = Screen()
# # screen.exitonclick()
#
# # import heroes
# # heroes = heroes.gen()
# # print(heroes)
#
# import colorgram as cg
#
# color_list = cg.extract("images.jpg", 30)
# color_palette = []
#
# for count in range(len(color_list)):
# rgb = color_list[count]
# color = rgb.rgb
# color_palette.append(color)
#
# tim = Turtle()
# i=0
# tim.penup()
# tim.setheading(255)
# tim.forward(300)
# tim.setheading(0)
# num_of_dot = 100
#
# for dot in range(1, num_of_dot + 1):
# color = random.choice(color_palette)
# tim.dot(20, (color.r, color.g, color.b))
# tim.forward(50)
# if dot % 10 == 0:
# tim.setheading(90)
# tim.forward(50)
# tim.setheading(180)
# tim.forward(500)
# tim.setheading(0)
# my_list = [10, 20, 30, 40, 50]
# for i in range(len(my_list)):
# print(i)
# print(my_list[i])
# new = [i*2 for i in range(1,5) if i == 2]
# print(new)
# import tkinter
# window = tkinter.Tk()
# window.title("Phonetic")
# window.minsize(400, 400)
#
# def mile_to_km():
# re = int(entry.get()) * 1.60934
# label1.config(text=re)
#
# label = tkinter.Label(window, text="Enter Mile: ")
# label.grid(row=0, column=0)
# entry = tkinter.Entry(width=30)
# entry.grid(row=0, column=1)
#
# button = tkinter.Button(text="convert", command=mile_to_km)
# button.grid(row=0, column=2)
#
# label1 = tkinter.Label()
# label1.grid(row=1, column=0)
#
# window.mainloop()
# def add(*args):
# for n in args:
# print(n)
#
# add(4,5,6)
#
# def calculate(**kwargs):
# print(kwargs)
# for k, v in kwargs.items():
# print(f'{k} = {v}')
#
# calculate(add= 3, mul= 5)
import requests
res = requests.get(url="http://api.open-notify.org/iss-now.json")
res.raise_for_status()
jss = res.json()
print(jss["iss_position"]["longitude"])
print(jss["iss_position"]["latitude"])