2

So basically I am making a flask application. I have few python print statement to mark checkpoints (debugging). Instead of print those statements in python console . I want it to be in browser console (i.e. console.log)

When I do: print("ok")

It should also print ok in browser log( like javascript console.log). Is there any library for achieving this or any other way of doing this

Raghav Patnecha
  • 716
  • 8
  • 29
  • 2
    No, you can receive the message in javascript and then console.log() in it. – pissall Jun 11 '18 at 09:50
  • This [question and answer](https://stackoverflow.com/questions/31260437/python-print-vs-javascript-console-log) may help you. – Taohidul Islam Jun 11 '18 at 09:53
  • 1
    In some more words, your server (which is where your Python program runs) sends things which render a web page in the browser window. Some of that web page could be a Javascript program which writes to the browser console, but this is probably significantly more complex than you were hoping. Maybe there are JavaScript frameworks which make this reasonably easy actually; but the browesr console is fundamentally controlled by the browser, not by anything on your server. – tripleee Jun 11 '18 at 10:12
  • Possible duplicate of [JavaScript: How do I print a message to the error console?](https://stackoverflow.com/questions/164397/javascript-how-do-i-print-a-message-to-the-error-console) – tripleee Jun 11 '18 at 10:14

0 Answers0