How to dynamically execute code and capture it's output? #5332
Replies: 4 comments
-
What is the value of |
Beta Was this translation helpful? Give feedback.
0 replies
-
It's
|
Beta Was this translation helpful? Give feedback.
0 replies
-
Not quite an answer, but
Per https://xon.sh/subproc_types.html I don't think HiddenCommandPipeline captures the output as something you can store for later use. |
Beta Was this translation helpful? Give feedback.
0 replies
-
I noticed that
which works as I wanted to and is shorter than subprocess version. Thank you :) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
How to dynamically execute code and capture it's output?
Example script:
I'd like to be able to capture output of cmd, which in this case can be for example
1244
, but above code printsNone
as stdout. I know I can just use python subprocess, but maybe there's some shorter way to do it using some xonsh commands ($()
maybe)?Thank you.
Beta Was this translation helpful? Give feedback.
All reactions