import sys def remove_html_markup(s): tag = False quote = False out = "" for c in s: if c == '<' and not quote: tag = True elif c == '>' and not quote: tag = False elif (c == '"' or c == "'") and tag: quote = not quote elif not tag: out = out + c return out def traceit(frame, event, arg): if event == "line": filename = frame.f_code.co_filename lineno = frame.f_lineno print filename, lineno return traceit sys.settrace(traceit)
void bug(){ int x; assert x == 0; }
resume = True while resume: command = input_command() process(command) command_index = 0 def input_command(): commands = ["open", "save", "quit"] global command_index command = commands[command_index] command_index = command_index + 1 return command saved_commands = [] def input_command(): command = original_input_command() return command def process(command): global resume print repr(command) if command.startswitch('g'): resume = False while resume: command = input_command() process(command)