in python3 print is function. to redirect the the output to something else, instead to stdout use
also it's good idea not to use builtin functions as variable names (file is builtin function in python2)
file
argumentalso it's good idea not to use builtin functions as variable names (file is builtin function in python2)