mirror of
https://github.com/jlengrand/ShowMeYourBigSatellite.git
synced 2026-03-10 08:41:21 +00:00
The coordinates are randomly generated every time a GET request to get_coordinates is made. The client requests for a new position every second once the Google Map stuff is initialized. Communication is done using JSON objects.
13 lines
297 B
Python
13 lines
297 B
Python
import random
|
|
|
|
def random_coordinates():
|
|
lat_range = [59, 61]
|
|
long_range = [9, 17]
|
|
return (
|
|
random.randint(long_range[0], long_range[1]),
|
|
random.randint(lat_range[0], lat_range[1]))
|
|
|
|
|
|
if __name__ == "__main__":
|
|
for i in range(10):
|
|
print random_coordinates() |