Giter Site home page Giter Site logo

volker48 / python-concurrency Goto Github PK

View Code? Open in Web Editor NEW
155.0 8.0 66.0 28 KB

Code examples from my toptal engineering blog article

Home Page: http://www.toptal.com/python/beginners-guide-to-concurrency-and-parallelism-in-python

License: MIT License

Python 100.00%
python python-concurrency asyncio multiprocessing

python-concurrency's Introduction

Python concurrency

This is the code used as examples in the post that I wrote for the Toptal Engineering Blog.

Running the examples

The examples have all been tested under Python 3.6.4 running on OS X. They should work on other operating systems and Python 3.5+, but I haven't tested it everywhere.

  1. Get an Imgur API Key
  2. Install dependencies with pip install -r requirements.txt
  3. Run an example IMGUR_CLIENT_ID=your_client_id threading_imgur.py
    1. For the rq_imgur.py example you will also need to be running a redis server

python-concurrency's People

Contributors

codingthat avatar dependabot[bot] avatar kevinji avatar vmorris avatar volker48 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

python-concurrency's Issues

threading_imgur has a bug

Exception in thread Thread-7:
Traceback (most recent call last):
File "C:\Users\zmrenwu\AppData\Local\Programs\Python\Python35\lib\threading.py", line 914, in _bootstrap_inner
self.run()
File "D:/Users/zmrenwu/PycharmProjects/ConcurrentAndParallel/thread.py", line 25, in run
download_link(directory, link)
File "D:\Users\zmrenwu\PycharmProjects\ConcurrentAndParallel\download.py", line 21, in download_link
f.write(image.read())
File "C:\Users\zmrenwu\AppData\Local\Programs\Python\Python35\lib\http\client.py", line 461, in read
s = self._safe_read(self.length)
File "C:\Users\zmrenwu\AppData\Local\Programs\Python\Python35\lib\http\client.py", line 609, in _safe_read
raise IncompleteRead(b''.join(s), amt)
http.client.IncompleteRead: IncompleteRead(53280 bytes read, 361937 more expected)

It seems image.read() incured.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.