@@ -1501,7 +1501,7 @@ import csv
1501
1501
from tabulate import tabulate
1502
1502
with open (< filename> , encoding = ' utf-8' , newline = ' ' ) as file :
1503
1503
lines = csv.reader(file , delimiter = ' ;' )
1504
- headers = [a .title() for a in next (lines)]
1504
+ headers = [header .title() for header in next (lines)]
1505
1505
table = tabulate(lines, headers)
1506
1506
print (table)
1507
1507
```
@@ -1644,7 +1644,7 @@ def send_page(sport):
1644
1644
def odds_handler (sport ):
1645
1645
team = request.forms.get(' team' )
1646
1646
home_odds, away_odds = 2.44 , 3.29
1647
- response.headers[' Content-Type' ] = ' application/json'
1647
+ response.headers[' Content-Type' ] = ' application/json'
1648
1648
response.headers[' Cache-Control' ] = ' no-cache'
1649
1649
return json.dumps([team, home_odds, away_odds])
1650
1650
```
@@ -1653,8 +1653,8 @@ def odds_handler(sport):
1653
1653
``` python
1654
1654
# $ pip3 install requests
1655
1655
>> > import requests
1656
- >> > url = ' http://localhost:8080/odds/football'
1657
- >> > data = {' team' : ' arsenal f.c.' }
1656
+ >> > url = ' http://localhost:8080/odds/football'
1657
+ >> > data = {' team' : ' arsenal f.c.' }
1658
1658
>> > response = requests.post(url, data = data)
1659
1659
>> > response.json()
1660
1660
[' arsenal f.c.' , 2.44 , 3.29 ]
@@ -1716,7 +1716,7 @@ from pycallgraph import output, PyCallGraph
1716
1716
from datetime import datetime
1717
1717
time_str = datetime.now().strftime(' %Y%m%d %H%M%S' )
1718
1718
filename = f ' profile- { time_str} .png '
1719
- drawer = output.GraphvizOutput(output_file = filename)
1719
+ drawer = output.GraphvizOutput(output_file = filename)
1720
1720
with PyCallGraph(output = drawer):
1721
1721
< code_to_be_profiled>
1722
1722
```
0 commit comments