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…
The article introduces a way to reduce the size of the gif file. The python script analysis gif file and generate many png files from multiple frames. Then it takes a few png files to combine a new smaller gif file. In addition, You can use OpenCV to convert the Read more…
The instance of vtkImporter contains vtkRenderWindow and vtkRenderer objects. It supports to recover original scene including lights, cameras, actors, etc. Here is a simple example which imports 3D studio file and shows the whole scene. import vtk DataRoot = “/Users/weiyang/Downloads/VTKData” importer = vtk.vtk3DSImporter() importer.ComputeNormalsOn() importer.SetFileName( DataRoot + “/Data/iflamigm.3ds” ) importer.Read() Read more…
I want to get the solution of the equation Bisection Method The first algorithm for the problem is bisection method. The algorithm bisection method doesn’t require derivation for the equation. It just needs a possible solution range [l, r], then calculates the variable mid as , compares the result of Read more…