I get a sort of Error Messagge that I should not use a "bare Except ..." I have to check the 'line of the text file' (saved in raw_results ...) in which the third charachter is a dot ('.'). Is there another way avoiding to use Try ... Except ?
Thx for help
with open(file_to_read, 'r') as fi:
raw_results = fi.readlines()
date_of_game = []
home_team = []
away_team = []
home_team_goals = []
away_team_goals = []
for i in range(len(raw_results)):
try:
if raw_results[i][2] == '.':
date_of_game.append(raw_results[i][:5])
if raw_results[i + 1] != "A Tav.":
home_team.append(raw_results[i + 1].strip('\n'))
away_team.append(raw_results[i + 2].strip('\n'))
home_team_goals.append(raw_results[i + 3].strip('\n'))
away_team_goals.append(raw_results[i + 4].strip('\n'))
else:
home_team.append(raw_results[i + 2].strip('\n'))
away_team.append(raw_results[i + 3].strip('\n'))
home_team_goals.append(raw_results[i + 4].strip('\n'))
away_team_goals.append(raw_results[i + 5].strip('\n'))
except:
''' ... do nothing '''