Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
Change font in console
-
There is an option to change the font in the editor. Is there a way to change the font in the console? Programmatically I can do console.set_font(), but even when I use a monospace font such as Courier, something seems off in the way in which it renders spaces (not the same width as the other chars, as it should, being monospace). I often use some "ASCII Art" of sorts for a quick output/debug (and fun :) ) and this makes it that much harder...
Thanks!
D. -
@domiriel , sorry I don't know the answer to your question. But just in case you didn't know, if you create a file called 'pythonista_startup.py' in the 'site-packages' dir, it will be executed when Pythonista starts up. Just when you get your answer this could be handy for you. My pythonista_startup.py looks like -
# coding: utf-8 import sys, os, console print('my startup script\n') from objc_util import * UIScreen = ObjCClass('UIScreen') from plistlib import readPlist screen = UIScreen.mainScreen() screen.setBrightness_(0.25) UIView.beginAnimations_(None) UIView.setAnimationDuration_(0) print('switching off animations\n') print('screen brightness:'.upper(), '{:f}'.format(screen.brightness())) fnt = ('Menlo', 22) console.set_font(*fnt) print('Font set to {}-{}'.format(*fnt)) def pyst_version_str(): plist = readPlist(os.path.abspath(os.path.join(sys.executable, '..', 'Info.plist'))) return plist['CFBundleShortVersionString'] print(('Pythonista Version:{}'.format(pyst_version_str())))
-
what device/version are you on? I could not repeat what you described.
print('#'*20+('\n#'+' '*18+'#')*9+'\n'+'#'*20)
prints a box. -
It does!
I found what I had messed up: having pasted some code from another place (I had originally written it in the desktop), it brought along some tabs mixed in with spaces (some tool along the way messed those up) and I didn't notice it in the editor, only in the console (different fonts, due to all the experimentation).
So, all in all, a completely noob mistake from someone programming in Python for 20 years :/
Thanks for such quick assistance!