feat: 新增技能扩展N16一章相关示例源码
This commit is contained in:
15
code/newsletter/N16/01_quickstart.py
Normal file
15
code/newsletter/N16/01_quickstart.py
Normal file
@@ -0,0 +1,15 @@
|
||||
from rocketry import Rocketry
|
||||
|
||||
app = Rocketry(execution="main")
|
||||
times = 0
|
||||
|
||||
|
||||
@app.task('every 1 second')
|
||||
def echo():
|
||||
global times
|
||||
times += 1
|
||||
print(f"Running {times} times...")
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
app.run()
|
||||
Reference in New Issue
Block a user