Why not introducing a « local_print() » function which print out in a separate context that user can see in the web platform. French contest Battledev (based on TOSA contest) works that way and allows better debugging process.
Le 2 avr. 2018 à 08:45, Olaf Doschke <[email protected]> a écrit : >> It's just that it was so frustrating running trivial code without feedback > > I agree, when you normally could use print for displaying info and debug > messages, that's now automatically stdout feedback and the testing_tool is > not displaying the "dialog" between it and your code. > > I added a logfile=open("numguessing.log", "w") and wherever I wanted a look > at input or output used logfile.write() > > I found a better way to "mis"use stderr for such output using this: > from __future__ import print_function > import sys > > def eprint(*args, **kwargs): > print(*args, file=sys.stderr, **kwargs) > > Taken from > https://stackoverflow.com/questions/5574702/how-to-print-to-stderr-in-python > > Now you can print to stdout and eprint() to see such info and debug messages > while the code runs. > > -- > You received this message because you are subscribed to the Google Groups > "Google Code Jam" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/google-code/187b0945-e670-42c9-8c6f-db868ae2748f%40googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "Google Code Jam" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/google-code/EAEB1E6B-C02E-4F13-96BF-DD23CE3575B3%40gmail.com. For more options, visit https://groups.google.com/d/optout.
