0

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. It runs properly on command line interface but does not work when I run it on 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.

eyllanesc
  • 235,170
  • 19
  • 170
  • 241
divesh
  • 71
  • 7
  • checkout `subprocess` library – Pratik Dec 03 '19 at 05:35
  • Please check this - https://stackoverflow.com/questions/89228/calling-an-external-command-from-python?rq=1 – stud3nt Dec 03 '19 at 05:38
  • 1
    Why do you have to use IDLE? Why not use the native command line interface? – Gino Mempin Dec 03 '19 at 06:39
  • I don't understand why you want to run on IDLE but I would understand if you want to run it from Python's script. But you don't need to use IDLE to run Python's script. Use `os.system("command")` or see module [subprocess](https://docs.python.org/3/library/subprocess.html – furas Dec 03 '19 at 07:43
  • The real question should be 'How do I run a command line utility from a Python program'. This depends on whether the particular utility is written in Python and if so, whether it has a Python API. (ezflix does.) This has nothing to do with IDLE in particular. See answer. – Terry Jan Reedy Dec 03 '19 at 16:51

1 Answers1

0

According to https://pypi.org/project/ezflix/, ezflix is a "command line utility", one which happens to be written in 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. If this is true, it would not have a supported and documented application program interface (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.

It turns out the ezflix does have a documented API and so it is also a library module. The is briefly described at the bottom of the pypi page linked above.

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. What could matter is whether the ezflix user interface specifically requires that it be run connected to the system terminal/console. Noting I saw on its pypi page suggests this. It might also be that the movie player window somehow interferes with the IDLE GUI window, but I also do not expect this.

Terry Jan Reedy
  • 18,414
  • 3
  • 40
  • 52