简体   繁体   English

如何在我的 python GUI 程序中使用 aria2?

[英]How to use aria2 in my python GUI program?

I am using the aria2c downloader ( https://aria2.github.io/ ) in my python script.我在我的python脚本中使用aria2c下载器( https://aria2.github.io/ )。 The aria2c is a command-line tool to batch download some stuff. aria2c是一个命令行工具,可以批量下载一些东西。

import os
#...
os.system("aria2c " + url)

The output of aria2c is displayed in the same console with the downloaded percentage and download speed etc. aria2c的output显示在同一个控制台,下载百分比下载速度等。

Now, I want to convert my python program to a GUI .现在,我想将我的 python 程序转换为GUI The GUI must display information of the download speed and percentage , which must be graphical labels in Tkinter GUI . GUI必须显示下载速度和百分比信息,这些信息必须是Tkinter GUI中的图形标签

Is there any way to use aria2c and achieve this?有没有办法使用aria2c并实现这一目标?

Seems like aria2p solves your problem.好像aria2p解决了你的问题。 Here's the link .这是链接

Python default library's subprocess module allows you to call and interact with other programs. Python 默认库的subprocess进程模块允许您调用其他程序并与之交互。 That will certainly suit your problem very well.这肯定会非常适合您的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM