Celery 3.0 Documentationcom/group/celery-users] and an IRC channel. Here’s one of the simplest applications you can make: from celery import Celery app = Celery('hello', broker='amqp://guest@localhost//') @app.task def hello(): return to import it. In this tutorial we keep everything contained in a single module, but for larger projects you want to create a dedicated module. Let’s create the file tasks.py: from celery import Celery apply_async() method that gives greater control of the task execution (see Calling Tasks): >>> from tasks import add >>> add.delay(4, 4) The task has now been processed by the worker you started earlier, and you0 码力 | 2110 页 | 2.23 MB | 1 年前3
Celery v4.0.0 Documentationcom/group/celery-users] and an IRC channel. Here’s one of the simplest applications you can make: from celery import Celery app = Celery('hello', broker='amqp://guest@localhost//') @app.task def hello(): return to import it. In this tutorial we keep everything contained in a single module, but for larger projects you want to create a dedicated module. Let’s create the file tasks.py: from celery import Celery apply_async() method that gives greater control of the task execution (see Calling Tasks): >>> from tasks import add >>> add.delay(4, 4) The task has now been processed by the worker you started earlier, and you0 码力 | 2106 页 | 2.23 MB | 1 年前3
Celery v5.0.0 Documentationcom/group/celery-users] and an IRC channel. Here’s one of the simplest applications you can make: from celery import Celery app = Celery('hello', broker='amqp://guest@localhost//') @app.task def hello(): return and encode the password so it can always be parsed correctly. For example: from kombu.utils.url import safequote aws_access_key = safequote("ABCDEFGHIJKLMNOPQRST") aws_secret_key = safequote("ZYXK7N to import it. In this tutorial we keep everything contained in a single module, but for larger projects you want to create a dedicated module. Let’s create the file tasks.py: from celery import Celery0 码力 | 2309 页 | 2.13 MB | 1 年前3
Celery v5.0.5 Documentationcom/group/celery-users] and an IRC channel. Here’s one of the simplest applications you can make: from celery import Celery app = Celery('hello', broker='amqp://guest@localhost//') @app.task def hello(): return and encode the password so it can always be parsed correctly. For example: from kombu.utils.url import safequote aws_access_key = safequote("ABCDEFGHIJKLMNOPQRST") aws_secret_key = safequote("ZYXK7N to import it. In this tutorial we keep everything contained in a single module, but for larger projects you want to create a dedicated module. Let’s create the file tasks.py: from celery import Celery0 码力 | 2315 页 | 2.14 MB | 1 年前3
Celery v5.0.1 Documentationcom/group/celery-users] and an IRC channel. Here’s one of the simplest applications you can make: from celery import Celery app = Celery('hello', broker='amqp://guest@localhost//') @app.task def hello(): return and encode the password so it can always be parsed correctly. For example: from kombu.utils.url import safequote aws_access_key = safequote("ABCDEFGHIJKLMNOPQRST") aws_secret_key = safequote("ZYXK7N to import it. In this tutorial we keep everything contained in a single module, but for larger projects you want to create a dedicated module. Let’s create the file tasks.py: from celery import Celery0 码力 | 2313 页 | 2.13 MB | 1 年前3
Celery v5.0.2 Documentationcom/group/celery-users] and an IRC channel. Here’s one of the simplest applications you can make: from celery import Celery app = Celery('hello', broker='amqp://guest@localhost//') @app.task def hello(): return and encode the password so it can always be parsed correctly. For example: from kombu.utils.url import safequote aws_access_key = safequote("ABCDEFGHIJKLMNOPQRST") aws_secret_key = safequote("ZYXK7N to import it. In this tutorial we keep everything contained in a single module, but for larger projects you want to create a dedicated module. Let’s create the file tasks.py: from celery import Celery0 码力 | 2313 页 | 2.14 MB | 1 年前3
Mypy 1.8.0 DocumentationYou can express this idea using collections.abc.Iterable: from collections.abc import Iterable # or "from typing import Iterable" def greet_all(names: Iterable[str]) -> None: for name in names: print('Hello subtype of Union[int, str]: 1.1. Getting started 5 Mypy Documentation, Release 1.8.0 from typing import Union def normalize_id(user_id: Union[int, str]) -> str: if isinstance(user_id, int): return f'user-{100_000 adding types, the convention is to import types using the form from typing import Union (as op- posed to doing just import typing or import typing as t or from typing import *). For brevity, we often omit0 码力 | 234 页 | 902.89 KB | 1 年前3
Mypy 1.10.0+dev Documentationruntime String literal types and type comments Future annotations import (PEP 563) typing.TYPE_CHECKING Class name forward references Import cycles Using classes that are generic in stubs but not at runtime Following imports The mypy command line Specifying what to type check Optional arguments Config file Import discovery Platform configuration Disallow dynamic typing Untyped definitions and calls None and Optional configuration file Config file format Per-module and global options Inverting option values Example mypy.ini Import discovery Platform configuration Disallow dynamic typing Untyped definitions and calls None and Optional0 码力 | 318 页 | 270.84 KB | 1 年前3
Mypy 1.8.0 Documentationruntime String literal types and type comments Future annotations import (PEP 563) typing.TYPE_CHECKING Class name forward references Import cycles Using classes that are generic in stubs but not at runtime Following imports The mypy command line Specifying what to type check Optional arguments Config file Import discovery Platform configuration Disallow dynamic typing Untyped definitions and calls None and Optional configuration file Config file format Per-module and global options Inverting option values Example mypy.ini Import discovery Platform configuration Disallow dynamic typing Untyped definitions and calls None and Optional0 码力 | 318 页 | 271.55 KB | 1 年前3
Mypy 1.10.0+dev DocumentationYou can express this idea using collections.abc.Iterable: from collections.abc import Iterable # or "from typing import Iterable" def greet_all(names: Iterable[str]) -> None: for name in names: print('Hello Mypy Documentation, Release 1.10.0+dev.790e8a73d8671a41cae419b4ea07579bfb2bc292.dirty from typing import Union def normalize_id(user_id: Union[int, str]) -> str: if isinstance(user_id, int): return f'user-{100_000 adding types, the convention is to import types using the form from typing import Union (as op- posed to doing just import typing or import typing as t or from typing import *). For brevity, we often omit0 码力 | 234 页 | 913.89 KB | 1 年前3
共 565 条
- 1
- 2
- 3
- 4
- 5
- 6
- 57













