Search code examples
pythonmodulecommand-line-interface

Is it possible to utilize a CLI (module/app/library) for use in my own Python script?


I am fairly new to coding but love Python and am trying to understand something as I've run into a specific issue I need solved!

To give an example for context -

I am currently trying to stylize a pyfiglet title (centered) as a colored gradient. There seems to be no way to do this ASIDE FROM:

https://github.com/wasi-master/gradient_figlet

However, this is a CLI module/tool and I have no idea how to implement it into my script. There is no documentation and I am used to being provided with examples such as:

import gradient-figlet

gradient_figlet("TEST HELLO")

To give a printed gradient text (figlet) result as gradient-figlet accomplishes when used in command line using:

python -m gradient_figlet YOUR_TEXT

Is this possible in general?

Any help would be appreciated.

On a side note - I'd really like to be able to center things in console if anyone has any tips :)


Solution

  • I spoke with the creator of the repo and he kindly updated the repo to support usage within a script!

    https://github.com/wasi-master/gradient_figlet

    Hope this helps someone!