Ich möchte lernen, wie man eine Funktion asynchron in Python3 aufruft. Ich denke Tornado kann dies tun. Derzeit ist mein Code nichts auf der Kommandozeile zurückkehrt:Asynchroner Funktionsaufruf
#!/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()
Dank
Vielen Dank, Berislav :) –