Tag: Python

Email Keep-Alive Procedure-Tongyi Qianwen

·5079 words·11 min read

This article introduces the method of implementing the mailbox keep-alive program through Tongyi Qianwen, and gives detailed code examples....

Pyinstaller packaging FAQ

·2304 words·5 min read

This article introduces common problems and solutions encountered when using PyInstaller to package Python programs. First, the article provides an explanation of the basic commands and parameters of PyInstaller, such as -Fw for generating a single executable file and hiding the console window, and --add-data for adding resource files. Next, the article discusses two main problems: one is the problem that the packaged program is too large due to the use of Anaconda, which is recommended to be solved by creating a virtual environment and installing only necessary libraries; the other is the problem of missing resource files after packaging, and two solutions are proposed: one is to write a hook script to specify the resource folder or file that needs to be included; the other is to use the --add-data option to directly specify the data path and target location to be added in the command line....

Asynchronous: Python's asyncio/greenlet, Java's CompletableFuture

·5719 words·12 min read

This article introduces several methods for implementing asynchronous programming in Python and Java, including threading, asyncio, and greenlet in Python, as well as CompletableFuture in Java. It provides a detailed comparison of these tools in terms of control, scheduling mechanisms, and ecosystem support, and includes corresponding code examples to illustrate their usage....