Je voudrais apprendre comment appeler une fonction de manière asynchrone dans Python3. Je pense que Tornado peut le faire. À l'heure actuelle, mon code retourne rien sur la ligne de commande:Appel de fonction asynchrone
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
async def count(end):
"""Print message when start equals end."""
start = 0
while True:
if start == end:
print('start = {0}, end = {1}'.format(start, end))
break
start = start + 1
def main():
# Start counting.
yield count(1000000000)
# This should print while count is running.
print('Count is running. Async!')
if __name__ == '__main__':
main()
Merci
Merci, Berislav :) –