def db(p, addr, len=128, maxWid = 64): if Console.WindowWidth-4 < maxWid: maxWid = Console.WindowWidth-4 words = p.GetVirtualByteLen(addr, len) curr = 0 while curr < len: Misc.WxColor(ConsoleColor.White, ConsoleColor.Black, VIRTUAL_ADDRESS(addr+curr).xStr + " ") while curr < len and Console.CursorLeft < maxWid: Misc.WxColor(ConsoleColor.Green, ConsoleColor.Black, words[curr].ToString("x2") + " ") curr = curr+1 Console.Write(Environment.NewLine);
def ds(p, addr, len=128, maxWid = 72): if Console.WindowWidth-4 < maxWid: maxWid = Console.WindowWidth-4 words = p.GetVirtualLongLen(addr, len) len = len / 8 curr = 0 while curr < len: Misc.WxColor(ConsoleColor.White, ConsoleColor.Black, VIRTUAL_ADDRESS(addr+(curr*8)).xStr + " ") Misc.WxColor(ConsoleColor.Green, ConsoleColor.Black, words[curr].ToString("x16") + " ") Misc.WxColor(ConsoleColor.Cyan, ConsoleColor.Black, "[" + p.GetSymName(words[curr]) + "]") curr = curr+1 Console.Write(Environment.NewLine);
def _print_source_line(self, sp, lines): linecount = len(lines) linecount_fmt = "%%%dd: " % len(str(linecount)) for i in range(sp.start_line, sp.end_line + 1): with CC.Cyan: Console.Write(linecount_fmt % i) line = lines[i - 1] if i <= linecount else "" start = sp.start_col if i == sp.start_line else 1 end = sp.end_col if i == sp.end_line else len(line) + 1 with CC.Gray: Console.Write(line.Substring(0, start - 1)) with CC.Yellow: Console.Write(line.Substring(start - 1, end - start)) Console.Write(line.Substring(end - 1)) if sp.start_line == sp.end_line == i and sp.start_col == sp.end_col: with CC.Yellow: Console.Write(" ^^^") Console.WriteLine()
def db(p, addr, len=128, bytesPerLine=16): words = p.GetVirtualByteLen(addr, len) curr = 0 while curr < len: Misc.WxColor(ConsoleColor.White, ConsoleColor.Black, VIRTUAL_ADDRESS(addr + curr).xStr + " ") for c in range(0, bytesPerLine): Misc.WxColor(ConsoleColor.Green, ConsoleColor.Black, words[curr + c].ToString("x2") + " ") for ch in range(0, bytesPerLine): myChar = Encoding.ASCII.GetString(words, curr + ch, 1)[0] #if Char.IsLetterOrDigit(myChar) == False: # myChar = " " Misc.WxColor(ConsoleColor.Cyan, ConsoleColor.Black, myChar) Console.Write(Environment.NewLine) curr = curr + bytesPerLine
def _input_repl_cmd(self, keyinfo): with CC.Gray: print "\nREPL Console\nPress Ctl-Z to Exit" cmd = "" _locals = {'self': self} while True: Console.Write(">>>" if not cmd else "...") line = Console.ReadLine() if line == None: break if line: cmd = cmd + line + "\n" else: try: if len(cmd) > 0: exec compile(cmd, "<input>", "single") in globals(), _locals except Exception, ex: with CC.Red: print type(ex), ex cmd = ""
print "Enter expressions. Enter blank line to abort input." print "Enter 'exit (the symbol) to exit." print "\n" while True: print prompt, input = Console.ReadLine() if (input == ""): exprstr = "" prompt = ">>> " continue else: exprstr = exprstr + " " + input ## See if we have complete input. try: sympl.parser.ParseExpr(StringReader(exprstr)) except Exception, e: prompt = "... " continue ## We do, so execute. try: res = s.ExecuteExpr(exprstr, feo) exprstr = "" prompt = ">>> " if res is s.MakeSymbol("exit"): break print res except Exception, e: exprstr = "" prompt = ">>> " Console.Write("ERROR: ") Console.WriteLine(e)
def __show(self,left,top,color,content): Console.CursorLeft = left; Console.CursorTop = top; Console.BackgroundColor = color; Console.Write(content) def show_score(self,score): self.__show(3,23,Screen.black,"Score: {0}".format(score))
import clr from System import Console Console.Write("Digite o seu nome: ") v_nome = Console.ReadLine() Console.WriteLine("Ola, " + v_nome + ".")
def printc(text, color=ConsoleColor.Yellow): Console.ForegroundColor = color Console.Write(text) Console.ResetColor()