Source code to the Manning book Concurrency in Python with Asyncio.
This code ran successfully with Python version 3.10.2 Using a different version may give you different results or may not work.
Steps to Run Code Listing
-
Install Python 3.10.2, installers available at the bottom of the page at: https://www.python.org/downloads/release/python-3102/
-
Create a virtual environment and activate it. Instructions available here.
-
Install the dependencies for the project by running
pip install -r requirements.txtwithin your virtual environment. -
Several functions are in the
utilmodule - for this to import properly you need to include this module in yourPYTHONPATH. You can do this by runningexport PYTHONPATH=${PYTHONPATH}:concurrency-in-python-with-asyncio/utilwithin your terminal, changingconcurrency-in-python-with-asyncioto whichever path you have cloned this repository on your local machine. -
You should now be able to run any code listing successfully with
python3 scriptname.py, for example,python3 chapter_01/listing_1_1.pywill run the first code listing from the first chapter.