-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.py
More file actions
53 lines (40 loc) · 1.1 KB
/
main.py
File metadata and controls
53 lines (40 loc) · 1.1 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
import get_game
import get_gamebox
import get_playbyplay
import json
class GameBox:
home = ''
away = ''
class GameMatch:
HomeTeam = ''
AwayTeam = ''
GameStatus = ''
gameID = '401071198'
gameinfo = get_game.get_game(gameID)
gamebox = get_gamebox.gamebox(gameID)
gameplaybyplay = get_playbyplay.playbyplay(gameID, (len(gameinfo[2][0])-2))
# game scroe
Game = GameMatch()
Game.AwayTeam = gameinfo[0]
Game.HomeTeam = gameinfo[1]
Game.GameStatus = gameinfo[2]
# game box
GmaeBox = GameBox()
GameBox.home = gamebox[0]
GameBox.away = gamebox[1]
# save data
Gamescorejson = {}
Gamescorejson['AwayTeam'] = Game.AwayTeam
Gamescorejson['HomeTeam'] = Game.HomeTeam
Gamescorejson['GameStatus'] = Game.GameStatus
with open('Gamescore.json', 'w') as outfile:
json.dump(Gamescorejson, outfile)
Gameboxjson = {}
Gameboxjson['Away'] = GameBox.away
Gameboxjson['Home'] = GameBox.home
with open('Gamebox.json', 'w') as outfile:
json.dump(Gameboxjson, outfile)
Gameplayjson = {}
Gameplayjson['PlaybyPlay'] = gameplaybyplay
with open('Gameplay.json', 'w') as outfile:
json.dump(Gameplayjson, outfile)