from restaurant import * def loadRestaurants(filename): ifile = open(filename, "r") restaurants = [] for line in ifile: restaurant = Restaurant() restaurant.loadFromLine(line) restaurants.append(restaurant) return restaurants def main(): # Load small restaurant file filename = "/home/alinen/public/cs21/restaurants-small.json" allRestaurants = loadRestaurants(filename) # Print info about the loaded restaurants print("The number of restaurants is", len(allRestaurants)) for i in range(len(allRestaurants)): restaurant = allRestaurants[i] print("Name: "+restaurant.getName()) main()