简体   繁体   English

如何在 IDLE 上运行特定于命令提示符的 python 库?

[英]How do I run python libraries specific to command prompt on IDLE?

I wish to run some commands which are specifically made for command line interface in idle environment.我希望在空闲环境中运行一些专门为命令行界面制作的命令。

There is a library in python called "Ezflix" which is for streaming torrent videos. python中有一个名为“Ezflix”的库,用于流式传输torrent视频。 It runs properly on command line interface but does not work when I run it on python idle.它在命令行界面上正常运行,但当我在 python idle 上运行它时不起作用。

I know that command line commands cant be used in idle but I just wish to find if there is any possibility or any hack to make it run on idle.我知道命令行命令不能在空闲状态下使用,但我只想找到是否有任何可能性或任何黑客可以让它在空闲状态下运行。

According to https://pypi.org/project/ezflix/ , ezflix is a "command line utility", one which happens to be written in Python.根据https://pypi.org/project/ezflix/ezflix是一个“命令行实用程序”,恰好是用 Python 编写的。 At this level, it is intended to be run from a command line terminal/console.在此级别,它旨在从命令行终端/控制台运行。

Such a program, even if written in python, might not be a Python library module, meaning that it is not intended that you import it and directly access its functions.这样的程序,即使是用 Python 编写的,也可能不是 Python模块,这意味着您不打算导入它并直接访问其功能。 If this is true, it would not have a supported and documented application program interface (API).如果这是真的,它就没有支持和记录的应用程序接口 (API)。 If so, one could read the code and import it anyway, but the private internal objects and names might change from version to version.如果是这样,人们仍然可以阅读代码并导入它,但是私有内部对象和名称可能会因版本而异。 So the best way to access it from a Python program would be to run it separately, for instance, with subprocess, as suggested in the comments.因此,从 Python 程序访问它的最佳方法是单独运行它,例如,如评论中所建议的,使用子进程。

It turns out the ezflix does have a documented API and so it is also a library module.事实证明,ezflix确实有一个文档化的 API,因此它也是一个库模块。 The is briefly described at the bottom of the pypi page linked above.在上面链接的 pypi 页面底部简要描述了这一点。

from ezflix import Ezflix
ez = Ezflix(<arguments>)
...

I presume that the package itself contains more information on its usage.我认为包本身包含有关其用法的更多信息。

None of the above has anything to do with whether you run your program directly with python or with IDLE or with any other IDE.以上都不是有什么关系,你是否直接与Python或闲置或与任何其他IDE运行程序 What could matter is whether the ezflix user interface specifically requires that it be run connected to the system terminal/console.重要的是 ezflix 用户界面是否特别要求它连接到系统终端/控制台运行。 Noting I saw on its pypi page suggests this.注意到我在它的 pypi 页面上看到了这一点。 It might also be that the movie player window somehow interferes with the IDLE GUI window, but I also do not expect this.也可能是电影播放器​​窗口以某种方式干扰了 IDLE GUI 窗口,但我也不指望这一点。

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

相关问题 Python - 如何从 IDLE 与命令提示符运行模块 - Python - How to run module from IDLE vs. command prompt 我如何通过命令提示符运行多个 python 文件 - How do i run multiple python files through command prompt 如何在 Windows 7 的命令提示符中运行 Python 程序? - How do I run a Python program in the Command Prompt in Windows 7? 为什么这在Python IDLE shell中有效,但在我从命令提示符下作为Python脚本运行时却没有? - Why does this work in the Python IDLE shell but not when I run it as a Python script from the command prompt? 如何从命令外壳/命令提示符运行python文件? - How do I run the python files from command shell/command prompt? 如何从将运行 python 文件的命令提示符调用 bat 文件? - How do I call a bat file from command prompt which will run a python file? 如何从 windows 命令提示符在虚拟环境中运行 python 程序? - How do I run a python program in a virtual environment from windows command prompt? 如何在Windows 10中从常规命令提示符处激活python anaconda并运行脚本 - How do I activate python anaconda and run script from regular command prompt in Windows 10 如何使用 CMD 提示在 IDLE 中运行 python 脚本 - How to run a python script in IDLE using CMD prompt 命令提示符中的Python套接字错误,但不处于空闲状态 - Python socket error in command prompt but not in idle
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM