support python3 by making the print statement to a function

In python2, print is a statement so the following code is valid:
  print what,

But in python3, print is a function rather than a statement, so the code
have to be like the following:
  print(what, end=' ')

This code is invalid in python2, but the __future__ module deals this
well fortunately.