kute / eventor Goto Github PK
View Code? Open in Web Editor NEW多线程,进程,协程 任务执行器
Home Page: https://kute.github.io/2017/01/05/Python-Eventor-module.html
License: MIT License
多线程,进程,协程 任务执行器
Home Page: https://kute.github.io/2017/01/05/Python-Eventor-module.html
License: MIT License
import multiprocessing
from multiprocessing import Pool
class pdf_gen():
def __init__(self):
pdf = self.pdf = FPDF()
pdf.set_auto_page_break(True,0.1)
def get_data_from_mysql(self) :
pdf = self.pdf
# connection is established and result is stored in 'res'.
dup = []
dup.insert(0,res)
z = tuple(dup)
return z
def mysql_to_pdf_data(self,*result) :
try :
pdf = self.pdf
# Entered data need to be in pdf
finally :
pdf.output('save_pdf.pdf','F')
def main() :
pdf = pdf_gen()
recover_data = pdf.get_data_from_mysql()
pool = multiprocessing.Pool(multiprocessing.cpu_count())
pool.map(pdf.mysql_to_pdf_data,recover_data)
Below picture shows that CPU was using only 1 core instead 2 were there.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.