You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 31, 2024. It is now read-only.
I am using json-cfg in a python application and is working ok, but now I need to save in the json some configuration parameters for holding console colors.
For example, in my app I use this to print a string to console in red color: print("\033[0;32mThis is some text in red color")
Now I am trying to get this color values from the config json, but can make it work.
I put this in the json file: RedColor: "\033[0;32m"
and then I try to use it like this:
print("{}This is some text in red color").format(config.RedColor())
it don't work because is not a valid scape char in json... I have tried to scape it in the json, defining it with double backslash: RedColor: "\\033[0;32m"
but still don't work...
Is there any way to achieve this?
Thanks in advance.
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I am using json-cfg in a python application and is working ok, but now I need to save in the json some configuration parameters for holding console colors.
For example, in my app I use this to print a string to console in red color:
print("\033[0;32mThis is some text in red color")
Now I am trying to get this color values from the config json, but can make it work.
I put this in the json file:
RedColor: "\033[0;32m"
and then I try to use it like this:
print("{}This is some text in red color").format(config.RedColor())
it don't work because is not a valid scape char in json... I have tried to scape it in the json, defining it with double backslash:
RedColor: "\\033[0;32m"
but still don't work...
Is there any way to achieve this?
Thanks in advance.
The text was updated successfully, but these errors were encountered: