Colours of code

my python code does not change colour, is there anything I am meant to do for it to do so?

https://replit.com/@Faridahadedoyin

Hey @Faridahadedoyin welcome to the forums!

Can you please provide a link to the repl? This way it is easier for staff and members of the community to help you!

Also see this guide on how to share your code:


You could import termcolor and use colored(“text”, “color”). Or you could use ANSII escape codes. Both of these are great options to change the color of text. I personally like to use ANSII escape codes with f-strings so it’s not cluttered. I hope this helps!
I probably missed a few, feel free to add them in, it’s a wiki.

https://replit.com/@Faridahadedoyin/Python#boring%20stuff

@Faridahadedoyin on further inspection is this a school assignment? If so, it is against Replit Ask policy for community members to request or post complete answers to homework-like questions. On the other hand, the community can assist you in working through and understanding the core fundamentals of computer programming to help you figure out your question by yourself, though.

ohh you’re probably talking about syntax highlighting. you’ll want to change the filename from

boring stuff

to

boring_stuff.py

or anything you want, really. just remember to add .py at the end, and when you code, you’ll start getting the colors/syntax highlighting @Faridahadedoyin

5 Likes

In that file I don’t see anything that would print color, the most I see is return ‘’.

noo I don’t think you understand he doesn’t want colors in the py output, he wants it in the ide

1 Like

My bad, whoops!


@Faridahadedoyin by the way I notice your code is in a file that isn’t a main.py file, if you are wondering and if needed you could move that code to main.py or you can change the .replit file: first click on the three dots next to Files click Show Hidden Files, click on the .replit file. Go to entrypoint = or run = and change the file name to the one you want ran.

2 Likes

Yeh it works now thanks for the help!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.