Hi!
I want to make my objects open up web pages with Python, is there any way to do this? I would have to create urls with each iteration and inserting into the object/dictionary so every game is assigned a url. The first object in the image would for example open the game's boxscore with the user's default browser.
There is no query in my script.
def get_alfred_items():
results = []
url = "https://www.alfredapp.com/workflows/"
for i, j in zip(scores_list, player_leaders):
results.append({
"title": f"{i[0]} {i[1]} - {i[2]} {i[3]} ({gametime_list[scores_list.index(i)]})", # [home] [pts] - [pts] [away]
"subtitle": f"{j[0]}: {j[1]}pts/{j[2]}reb/{j[3]}ast - {j[4]}: {j[5]}pts/{j[6]}reb/{j[7]}ast",
"url": url + i[0], # I WANT TO DO THIS
})
return results
if __name__ == "__main__":
alfred_json = json.dumps({
"items": get_alfred_items()
})
sys.stdout.write(alfred_json)