Tony Tan tonytan748.github.io
1.

2 ways to get subprocess result in multiprocessing pool

Get the result when running subprocess, close it if the result is True123456789101112131415161718192021222324from multiproceeing import Poolimport Queueimport timedef test(p): ...
2.

python descriptor howto guide

https://docs.python.org/3.6/howto/descriptor.html AbstractDefines descriptors, summarizes the protocol, and shows how descriptors are called. Examines a custom descriptor and se...
3.

Understanding Django's Cached_property Decorator

This blog is transfer from http://ericplumb.com/blog/understanding-djangos-cached_property-decorator.html There is not a lot of documentation out there about Django’s cached_pro...
4.

SQLAlchemy Example: Create Database, CURD, Faker

1sudo pip install sqlalchemy 1sudo pip install faker 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666...
5.

Building RESTful APIs with Tornado

this blog is forward from here Tornado is a Python Web framework and asynchronous networking library that provides excellent scalability due to its non-blocking network I/O. It ...
6.

Creating a multiprocessing Downloader App

12345678910111213141516171819202122232425262728293031323334import multiprocessingimport osimport requestsclass MultiProcDownloader(object): def __init__(self, urls): s...
7.

A multiprocessing tutorial

this blog translate from http://www.blog.pythonlibrary.org/2016/08/02/python-201-a-multiprocessing-tutorial/ The multiprocessing module was added to Python in version 2.6. It wa...
8.

Building a simple workflow engine in Python

this blog translate from http://supercoderz.in/building-a-simple-workflow-engine-in-python/ In my last post I described how a workflow engine works and the various key parts of ...
9.

django-celery simple use

Install celery, django, django-celery, reidsDjango settings.py12345INSTALLED_APPS = ( ... 'djcelery', 'app1',) 12345import djcelerydjcelery.setup_lo...
10.

Configuring and Running Django + Celery in Docker Containers

After reading this blog post, you will be able to configure Celery with Django, PostgreSQL, Redis, and RabbitMQ, and then run everything in Docker containers. This blog translat...