Python
Python – Download File By Multiple Threads
The script is used to download large file by multiple threads and show progress bar in real time. Output:
The script is used to download large file by multiple threads and show progress bar in real time. Output:
We have to create zip file from output folder. After that users can download the result. Install zipfile module for python. pip install zipfile36 Use it in our python script to generate zip file. import sys, fitz # import the bindings if sys.version_info >= (3, 6): import zipfile else: import Read more…
We need to install PyMuPDF which is a Python binding with support for MuPDF (current version 1.19.*), a lightweight PDF toolkit before our work. pip3 install –upgrade pip pip3 install –upgrade pymupdf Write python script for saving PDF page to image. import sys, fitz # import the bindings if __name__ Read more…
Waf is a build automation tool written by Python and designed to assist in the automatic compilation and installation of computer software. You can learn about it at waf tutorial.
Let’s use it to build project.
The article introduces how to display an image by OpenCV in CPlusPlus and Python language. The user can exit the whole program when he presses the ESC key. CPP CMakeLists.txt macro(use_cxx11) if (CMAKE_VERSION VERSION_LESS “3.1”) if (CMAKE_CXX_COMPILER_ID STREQUAL “GNU”) set (CMAKE_CXX_FLAGS “${CMAKE_CXX_FLAGS} -std=gnu++11”) endif () else () set (CMAKE_CXX_STANDARD 11) Read more…
Downloaded the announcement of a listed company from cninfo.com.cn and saved it as a PDF file. The relevant title about it is 国泰君安 – 关于独立董事公开征集投票权的公告. Let’s extract text and table on the PDF file by python. We have to make sure the library pdfplumber had been installed. Use the command Read more…
I took books’ information from the MySQL database and tried to analyze the relation between price, score, and the number of commentators. The books’ sales information is collected from amazon as described in the article Find The Book Wanted In Amazon By Python, you can read it if you are Read more…
To find a high-quality book on amazon kindle store, I collect some books information and analyze them. The process can be divided into two main parts. Part 1. Download books’ information and save them to the database. We use BeautifulSoup to collect all books’ divs on the web page, convert Read more…
Step function The step function is simple, it gets only two values zero or one no matter what the input value is. #!/usr/bin/env python import numpy as np import matplotlib.pylab as plt def step_function(x): return np.array(x>0, dtype=np.int) if __name__ == ‘__main__’: x = np.arange( -5, 5, 0.1 ) y = Read more…