print - parameters ?

Helmut Jarausch jarausch at
Tue Oct 5 11:02:10 CEST 2004

sorry for this probably very simple question.

How can I build a parameter list for 'print' ?

I'd like to write a function like

def myprint(Msg,*Args) :
   print (Msg,)+Args

when called as


it should be equivalent to

print  MyMsg,x

but, e.g.

class ABC :
	def __str__(self) :
		return "ABC-class"


myprint('this is',x)


('this is', <__main__.ABC instance at 0x4084fc8c>)

instead of

this is ABC-class

What am I missing (what sort of thing is the parameter list of print) ?
Many thanks for a hint,

Helmut Jarausch

Lehrstuhl fuer Numerische Mathematik
RWTH - Aachen University
D 52056 Aachen, Germany

More information about the Python-list mailing list