I want to write something to a file like this: print >>filehandle, "....%d...%s..."%(num,string) but it raise error Can someone tell me how can I print it above to a file just like we print to the stdout(print "....%d...%s..."(num,string)). Or is there some funtion as we use in C/C++( fprint etc) thanks