-
Notifications
You must be signed in to change notification settings - Fork 0
/
notes.txt
146 lines (104 loc) · 3.32 KB
/
notes.txt
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
133
134
135
136
137
138
139
140
141
142
143
144
https://api.forecast.io/forecast/e24dac09f9fd8317208be7bc7504d270/-37.814107,144.963280?units=si&exclude=currently,minutely,hourly
API Call Format:
https://api.forecast.io/forecast/*api-key*/LAT,LON,TIME?units=si&exclude=minutely,hourly
"15351","Sunbury Railway Station (Sunbury)","-37.5790909705787","144.727318781329"
https://api.forecast.io/forecast/e24dac09f9fd8317208be7bc7504d270/-37.5790909705787,144.727318781329?units=si&exclude=currently,minutely,hourly
"Melbourne Central" 2 days from tomorrow 5:00pm
------------------------------
------------------------------
numOfArgs = len(sys.argv)
station = str(sys.argv[1]).lower()
myNums = ['3', "7", "9"]
"""
weatherAPI = "https://api.forecast.io/forecast/e24dac09f9fd8317208be7bc7504d270/" \
"-37.814107,144.963280?units=si&exclude=currently,minutely,hourly"
response = urllib.request.urlopen(weatherAPI).read()
"""
class Counter:
def __init__(self):
self.count = 0
def value(self):
return self.count
def inc(self):
self.count += 1
print("howdy")
def main():
print(sys.argv[numOfArgs - 1])
print(station)
thingo = routes.routes()
for r in thingo:
print(r)
myNums[1] = 7.565656
for n in myNums:
print(n)
"""
print('RESPONSE:')
print(response)
response = '["foo", {"bar":["baz", null, 1.0, 2]}]'
analysed = json.load(response)
print(analysed)
"""
c = Counter()
print(c.value())
c.inc()
print(c.value())
# stops = open("stops.txt", "r")
# stopLines = []
# found = False
# for l in stops:
# stopLines.append(l)
# if station in l.lower():
# found = True
# print(l)
# stops.close()
if found:
print(l)
#print(stopLines[1])
-------------------------------------------
# STATION, (N)DAYS FROM, SPECIFIER, TIME
# melbourne central 5 days from SPECIFYER -time
# melbourne central SPECIFYER -time
# melbourne central SPECIFYER -time
# print(date.strftime("%c"))
# time = datetime.datetime.strptime("Sat May 7 05:50:50 2016","%c")
# when = combine dat + time
# apicall = generate_api(station, date, when)
# print("%s %s" % (date, time))
# print("TODAY: %s" % datetime.datetime.now().strftime("%x %I%M%p"))
# print("STATION: %s" % station)
# print("TIME: %s" % time)
if int(hoursfromnow) < 48: # Hourly prediction (up to 2 days ahead)
weatherdata = weatherdata["hourly"]["data"][hoursfromnow + 1]
tempkey = "temperature"
else: # Daily prediction (up to 1 week ahead)
hoursfromnow = int(hoursfromnow / 24)
weatherdata = weatherdata["daily"]["data"][hoursfromnow]
tempkey = "temperatureMax"
<html><head><title>s3529497 - Ass2 - Python</title></head><body>
<form action="http://127.0.0.1:34567/" method="POST">
<label for="name">Name:</label>
<input type="text" name="name" value="" size="" />
<label for="stationName">Station Names:</label>
<input type="text" name="stationName" value="" size="" />
<input type="submit" value="Submit">
</form></body></html>
print("received")
print(formData)
fieldNames = formData.keys()
data = ""
for field in fieldNames:
print(field)
data += "field is " + field + ", value is " + formData[field] + '<br>'
return data
pageinfo = ("station", "date", "timehour", "timeampm")
for l in trips:
#if l[3] == end:
# print(l)
print(l)
# trips.seek(0)
print('find')
for l in lines:
if not l: # skip any blank lines
continue
#if l[0] == trip and l[3] == end:
# print(l)