Created
August 12, 2014 19:39
-
-
Save thomasballinger/28e249db937db2c6d91f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from curtsies.fmtfuncs import * | |
import code | |
import traceback | |
class Interp(code.InteractiveInterpreter): | |
def showtraceback(self): | |
output_lines = [] | |
lines = ['asdf', 'asdfa.py', 'asdfasdf'] | |
for line in lines: | |
if '.py' in line: | |
output_lines.append(blue(line)) | |
else: | |
output_lines.append(yellow(line)) | |
for line in output_lines: | |
self.write(str(line)) | |
self.write('\n') | |
i = Interp() | |
i.runsource('asdf') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment