Created
February 18, 2021 12:29
-
-
Save aerique/d461924307631fafd13c087fc8979bea to your computer and use it in GitHub Desktop.
Use the Python Rich library from Common Lisp.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env -S sbcl --script | |
;;;; Assumes the Python Rich library has been installed. | |
;;;; - https://github.com/willmcgugan/rich#rich | |
;;;; | |
;;;; To install (and assuming no Python experience): | |
;;;; - `python3 -m venv venv` | |
;;;; - `bash` | |
;;;; - `source venv/bin/activate` | |
;;;; - `pip install --upgrade pip` | |
;;;; - `pip install rich` | |
;;;; | |
;;;; Afterwards you can delete the `venv` directory and your system will be | |
;;;; as before. | |
;;;; | |
;;;; Also assumes Quicklisp is installed in its default location. | |
#-quicklisp | |
(let ((quicklisp-init (merge-pathnames "quicklisp/setup.lisp" | |
(user-homedir-pathname)))) | |
(when (probe-file quicklisp-init) | |
(load quicklisp-init))) | |
(ql:quickload :py4cl :silent t) | |
(py4cl:import-module "rich") | |
(py4cl:import-module "rich.__main__") | |
(py4cl:import-module "rich.console") | |
;(rich:print (rich.__main__:make_test_card)) | |
;; We need to force terminal colors. | |
(py4cl:python-method (rich.console:console :force_terminal t) | |
:print (rich.__main__:make_test_card)) | |
;(rich:inspect (rich.console:console)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Using
.sh
as extension is pretty dumb.