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 have a problem with this code with Python 3.6.5, pony 0.7.6 | |
# An exception is thrown: | |
# "pony.orm.core.TransactionError: db_session is required when working with the database" | |
# in the "I shall feed thee!" line. | |
# also see https://github.com/ponyorm/pony/issues/126 | |
import asyncio | |
from pony.orm import commit, db_session, select, Database, Required | |
db = Database() |
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 concurrent.futures | |
from concurrent.futures import FIRST_COMPLETED, ALL_COMPLETED | |
import time | |
from random import random | |
def do_magic(title): | |
time.sleep(random() * 3) | |
print("Bye", title) | |
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
WHAT IS GITHUB . com |