-
Is it possible to use Here is how you can run it with import subprocess as sp
print(
sp.run(
["gum", "filter"],
encoding="utf-8",
input="foo\nbar\nbaz\n",
stdout=sp.PIPE,
).stdout
) Can you do this with sh? The following code lets the user interact with the TUI and captures the output but does not provide an input. import sh
import sys
print(sh.gum("filter", _in=sys.stdin, _err=sys.stderr)) I know there are Python-based alternatives to |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I could not find a way to make import sh # Not 1.x.
import sys
print(sh.gum("filter", _in="foo\nbar\nbaz\n", _err=sys.stderr)) |
Beta Was this translation helpful? Give feedback.
I could not find a way to make
gum filter
work in sh 1.14. However, after an upgrade to sh 2.0 the obvious solution (below) works. This is a clear improvement to sh.