#๐Ÿ”’ pystyle help

73 messages ยท Page 1 of 1 (latest)

maiden fjordBOT
#

@light sphinx

Python help channel opened

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.

light sphinx
#

I want to print a text that has pink and white just like this using pystyle but cannot find a way how to.

viral osprey
#

What have you tried?

light sphinx
#

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

viral osprey
#

wow, last update was a few years ago

light sphinx
#

i know

viral osprey
#

broken image links too

light sphinx
#

They don't even give good info on how to use it

viral osprey
#

I wonder if it's maintained still

light sphinx
#

Many people use it but

viral osprey
#

Maybe there's another way to do what you want?

light sphinx
#

I went through the source of the pystyle

viral osprey
#

You just want colored text in your TUI?

light sphinx
#

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

viral osprey
#

Where did you get your example from?

light sphinx
#

Their github

viral osprey
#

I'm not sure you can do what you want to do in a terminal.

light sphinx
#

Oh wait

#

the picture?

viral osprey
#

yes, the picture

light sphinx
#

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

viral osprey
#

Your friend is doing it in the terminal?

light sphinx
#

yes

viral osprey
#

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.

light sphinx
#

Idk anymore

#

its alright

viral osprey
#

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

maiden fjordBOT
#

Cross-platform colored terminal text.

Released on <t:1666665382:D>.

vast bay
#

And on windows 11 i think it works by default? Unsure

viral osprey
#

That just lets you change the colors of the terminal

#

you have to pass it an argument too

vast bay
#

But windows is weird

viral osprey
#

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

vast bay
#

So this isnt true

viral osprey
#

The limitations are well-documented.

vast bay
#

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"])
light sphinx
#

I wanted a gradient color

#

not a solid color

vast bay
#

You make gradients using ansi escape codes

light sphinx
#

im aware

#

I tried

#

It gives an error

#

I already deleted the file

#

So its alright

maiden fjordBOT
#
Python help channel closed

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