title: python print statement with timestamp
body: <p>My requirement is to have a function that works exactly like print but adds a timestamp at top.  Currently I use something like:</p>
  
  <pre><code>def tprint(var):
      print(str(datetime.now().strftime('%Y-%m-%d %H:%M:%S'))+" :: "+str(var))
  </code></pre>
  
  <p>Though it gives me all required output for a specific set – e.g.,</p>
  
  <pre><code>tprint("dummy"+" print")
  2017-11-09 19:38:42 :: dummy print
  </code></pre>
  
  <p>I am not able to completely morph it for print statement.  For example, <code>tprint("hi","hello")</code> and <code>tprint("a =", a, sep='0', end='')</code> fail.</p>
  
  <p>My requirement is not to ideally make these two statements work. But to write an alternative function for print that works for all print arguments but gives an additional timestamp along with it. I am sure this may not be a straight forward solution. But do not want to miss if someone has already figured out any similar approach.</p>