This repository contains all of the code samples found in my book 'Concurrency with Python'.
concurrency-with-python's Introduction
concurrency-with-python's People
Forkers
windyeh morristech hongbo-miao mckang kangweon xuongrong86 dieptran43 hemanthkodandarama albertflorinus cda-gti-upmconcurrency-with-python's Issues
chapter 9 loopForever won't run on Python 3.7
Hi!
the file for chapter 9 loopForever.py
won't run since there's a Syntax Error at lines 8, 15, 21 and 22. It seems that for Python 3.7 the syntax asyncio.async
is no longer valid
Chap 1: lorempixel not working
Lorempixel's endpoint seems out. Here's a functional code for sequential download:
import urllib.request
from os import mkdir
import time
SAVEPATH = "tmp/"
URL = "https://picsum.photos/200/300"
NUM_OF_IMAGES = 4
try:
mkdir(SAVEPATH)
except:
pass
def download_img(img_path, filename):
print("Downloading image from ", img_path)
urllib.request.urlretrieve(img_path, filename)
def main():
t0 = time.time()
for i in range(NUM_OF_IMAGES):
img_name = SAVEPATH + "image-" + str(i) + ".jpg"
download_img(URL, img_name)
total_time = time.time() - t0
print(f"Total execution time: {total_time}")
if __name__ == '__main__':
main()
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.