ThreeBackticks.py utility to format code snippets for this forum
This little utility is a bit overkill but what the heck...
Many people initially have difficulty formating their Python code so it looks good in posts to the Pythonisa Forum. This script attempts to properly format your code with appropriate carrage returns and backticks so that it is ready to post to the forum.
Remember that you can edit your own posts by clicking the word
editat the top right of the post.
Edit: Fixed bug: The first letter of each line created in the TextView is capitalized which is suboptimal typing in Python code.
Bug: The first letter of each new line created in the TextView is capitalized which is suboptimal typing in Python code.
You can turn that off by setting
ui.AUTOCAPITALIZE_NONE. While you're at it, you might also want to turn off auto-correction (tends to get in the way when writing code):
text_view.autocapitalization_type = ui.AUTOCAPITALIZE_NONE text_view.autocorrection_type = False
Thx... Fixed in the code.
Very cool. Very useful.