forked from perciplex/raas-starter
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrun.py
35 lines (29 loc) · 886 Bytes
/
run.py
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
import gym
import gym_raas
import numpy as np
import time
from os import system
import urllib.request
env = gym.make("raaspendulum-v0")
env.reset()
obs = []
print("\nBeginning ping test to google.com ...")
print(system("ping -c 1 www.google.com"))
print("\nBeginning google.com html download with wget ...")
print(system("wget www.google.com"))
print("\nBeginning google.com html download with urlopen ...")
try:
response = urllib.request.urlopen("http://www.google.com/")
html = response.read()
print(html)
except:
print("Download has failed using `urlopen`.")
print("\nBeginning file download with urlretrieve ...")
try:
url = "http://i3.ytimg.com/vi/J---aiyznGQ/mqdefault.jpg"
cat = urllib.request.urlretrieve(url)
print(cat[1])
except:
print("Download has failed using `urlretrieve`.")
print("\nJob done. Sleeping for 1 hour")
time.sleep(3600)