##celery_study.py
from celery import Celery app=Celery('tasks',broker='amqp://guest@192.168.1.79//') @app.task def add(x,y): return x+y
linux shell启动:celery -A celery_study worker --loglevel=info
linux shell#cd 到celery_study.py的目录 执行python
>>from celery_study import add
>>add.delay(3,4)