How to change font size in python

2 Likes

TL;DR probably impossible

Hmm, see I used to be really interested about console manipulation which is why I’m writing my first “long” high-quality post in a while. Basically, the way I’ve always seen it (correct me if I’m wrong) is that printing to the console (with print/stdout in python) is just about telling the actual console handler in replit what the output should be. This is what essentially happens on replit:

your code:

print("Hello World")

→
replit server:

  1. detects that a print statement is there
  2. adds this to buffer if not flush
  3. if buffer is at limit/flush then it’ll add your printed stuff to the running console it’s keeping (IIRC this is basically the same as a file except that this is a special file that gets displayed)
  4. sends back the console output

So, this is replit interpreting your code and sending the output. I’d hedge my bets on what happening is the replit has the console string returned and renders it client-side via js UI. That is, I don’t think (maybe it is but idk) that replit using Linux settings to do this, and even if they were they likely made it so that they can’t be accessed.

Please correct me if I am wrong here :stuck_out_tongue:

4 Likes

I think it’d be a CSS thing (because xtermjs handles rendering text client-side), but block lettering would have the same effect as increasing the font size

6 Likes

That would be a terminal setting, not a code setting, and since the replit* terminal is not really configurable, then this is probably not possible.

3 Likes

You can not increase font size, though you CAN make text, bold, italic and change the font color.

To bold text, use the function as described below,
def bold(type): sys.stdout.write("\033[1m" + type + "\033[0m")
To use this function,

bold("Hello world!")

If you are interested, visit this link for more console manipulation techniques.

3 Likes

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