print is not part of the io library and so does not know about io.output. You can redefine print to use the io library: function print(...) local a=table.pack(...) local t="" for i=1,a.n do io.write(t,tostring(a[i])) t="\t" end io.write("\n") end