Replies: 1 comment
-
Hey @salasac, After some discussion, the team came up with the following suggestions:
Also, I personally recommend trying out the Python SDK since it should allow you to interact with z/OS without having to invoke the Zowe CLI 🙏 In the meantime, this PR might help 🙏 |
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
Uh oh!
There was an error while loading. Please reload this page.
-
Link to script; https://github.com/zowe/zowe-cli-sample-scripts/blob/main/python/pyzowe/pyzowe.py
I have a minor suggestion for the pyzowe module that sets up the terminal environment
When executing the subprocess.run() method, I've added the following parameter: " env=os.environ | {"FORCE_COLOR": "0"} ".
Note, since it uses the os.environ method, it'll be necessary to import os.
Why? Well, for a little bit of context, for my purposes I'm using the "zowe zos-files search" command to search datasets for a given string. When you run this in a terminal (and perhaps for other commands too), the results are nicely formatted and uses ANSI colors to highlight useful info.
Unfortunately, these ANSI color codes will now be in the results of your "commandResponse" and inadvertently breaks the JSON formatting. So, by adding the environment variable "FORCE_COLOR:0", you effectively disable the ability to use these ANSI color codes, and they won't exist in your output.
Beta Was this translation helpful? Give feedback.
All reactions