This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The code for my article with the same name. You can find it at the URL below: | |
# https://www.mvanga.com/blog/basic-music-theory-in-200-lines-of-python | |
# MIT License | |
# | |
# Copyright (c) 2021 Manohar Vanga | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncio | |
import aioredis | |
async def add_new_win(pool, winner): | |
# Creating tasks doesn't schedule them | |
# so you can create multiple and then | |
# schedule them all in one go using `gather` | |
task1 = pool.zincrby('wins_counter', 1, winner) | |
task2 = pool.incr('total_games_played') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I ran into a couple of problems following the example on the Shiv (RTD) docs page | |
The following files worked for me from a python3 virtual env called test_shiv_env | |
Created .py file | |
test_shiv_env/bakerydemo/bakerydemo/main.py | |
import sys |