Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to autoReset in new write #39

Open
LcyDev opened this issue Oct 21, 2021 · 1 comment
Open

Option to autoReset in new write #39

LcyDev opened this issue Oct 21, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@LcyDev
Copy link

LcyDev commented Oct 21, 2021

This would be like colorama's init(autoreset=true)
Every time a new line is written, reset the colors and effects to default.

This should be pretty easy.
In my code i just used write(rs.all) after every sys.stdout output.

@feluxe
Copy link
Owner

feluxe commented Jan 15, 2022

Thanks for your suggestion!

I really don't think it's good practice to mess with globals such as sys.stdout / sys.stderr for some styling convenience. ^^

But if people really want to do this, I could imagine implementing something like sty.auto_reset(file_object), to allow overriding a file object (e.g. sys.stdout) with a reset-wrapper. It would require that the documentation for that function warns the user about the shortcomings and dangers of such approach.

@feluxe feluxe added the enhancement New feature or request label Jan 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants