#๐ pystyle help
73 messages ยท Page 1 of 1 (latest)
@light sphinx
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
I want to print a text that has pink and white just like this using pystyle but cannot find a way how to.
What have you tried?
Everything I literally can't even tell you
I've tried everything on the pystyle github to help me
I've tried stuff on stack overflow
I've messed around with random lines of code
I just have no thoughtts at this point
wow, last update was a few years ago
i know
broken image links too
They don't even give good info on how to use it
I wonder if it's maintained still
Many people use it but
Maybe there's another way to do what you want?
I went through the source of the pystyle
You just want colored text in your TUI?
Yes
I just want the text to be like that
pink to white gradient
if theres a way to get the code of it i can add it in there
and it would work
but I cant find it
Where did you get your example from?
Their github
I'm not sure you can do what you want to do in a terminal.
yes, the picture
my friend sent it to me asking how to do it
so I tried
and have no clue
If there is a way to revert a file like main.pyc to main.py
then my issue would be solved because its in his old file
but its obfuscated
Your friend is doing it in the terminal?
yes
Are you sure it's not a particular font that he is using?
The only way I know of to change text color in terminals is on a character by character basis.
Also you would need a terminal that supported a big palette which isn't the case by default.
If you do want to mess around with colors you can try termcolor
If you want to make that work on Windows you will need colorama
!pypi colorama
Iirc u can just do something weird like os.system('color')
And on windows 11 i think it works by default? Unsure
That just lets you change the colors of the terminal
you have to pass it an argument too
Youd think
But windows is weird
Well I don't know about Windows 11 but you should be able to do it in Windows 10
everything you never wanted to know about the palette for the windows cli
It's only got a 16-color palette unless you use the Terminal app
It does support ansi is the point im making!!
So this isnt true
The limitations are well-documented.
Thought it seems the os.system("color") is just something done to be more clear. Any input works.
From stackoverflow
For windows, calling os.system("") makes the ANSI escape sequence get processed correctly:
import os
os.system("") # enables ansi escape characters in terminal
COLOR = {
"HEADER": "\033[95m",
"BLUE": "\033[94m",
"GREEN": "\033[92m",
"RED": "\033[91m",
"ENDC": "\033[0m",
}
print(COLOR["GREEN"], "Testing Green!!", COLOR["ENDC"])
You make gradients using ansi escape codes
This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.
๐ pystyle help