def extract_news(trending_terms, get_objects=False, dangerous=False, safe=True): # Returns a list of NewsWebsite Objects websites = Navigator.navigate(trending_terms, dangerous, safe) # Returns a list of Link Objects articles = Seeker.seek(websites) links = [] # Writes to file, to be FTP'ed, additionally returns as Link objects if specified if get_objects: for article in articles: link = MaxSubSequence.extract_data(article, get_objects) if link: links.append(link) return links else: for article in articles: MaxSubSequence.extract_data(article, get_objects)
nav_bot_name = str(input("Nav bot name: ")) nav_bot_x = int(input("Nav bot x coordinate: ")) nav_bot_y = int(input("Nav bot y coordinate: ")) nav_bot_dir = str(input("Nav bot direction: ")) nav_bot_inst = str(input("Nav bot movement: ")) fight_bot_name = str(input("Fight bot name: ")) fight_bot_x = int(input("Fight bot x coordinate: ")) fight_bot_y = int(input("Fight bot y coordinate: ")) fight_bot_dir = str(input("Fight bot direction: ")) fight_bot_inst = str(input("Fight bot movement: ")) nav_bot = Navigator(nav_bot_name, nav_bot_x, nav_bot_y, Direction[nav_bot_dir]) for m in [char for char in nav_bot_inst]: nav_bot.navigate() set_movement(m, nav_bot, map) nav_bot.reply("I am robot") fight_bot = Fighter(fight_bot_name, fight_bot_x, fight_bot_y, Direction[fight_bot_dir]) for m in [char for char in fight_bot_inst]: fight_bot.fight() set_movement(m, fight_bot, map) fight_bot.reply() tokota_bot = Tokota("XT009", 0, 0, Direction.N) print(nav_bot.get_x()) print(nav_bot.get_y()) print(nav_bot.get_direction()) print(nav_bot.__class__.function)