How about using format:
>>> a = {'x': 'test'}
>>> print("this is a {0[x]}".format(a))
this is a test
How to use format:
{field!convertflag:formatspec}
formatspec:
[[fill]align][sign][#][0][width][.precision][typecode]
I'll give you some example:
>>> import sys
>>> print("I'm using python {0.version}".format(sys))
I'm using python 2.7.9 (default, Mar 31 2015, 09:35:58)
[GCC 4.8.1]
>>> print("Hello, {name}".format(name="lord63"))
Hello, lord63
>>> print("{0}, {1}, {0}".format("one", "two"))
one, two, one
>>> print("The fifth: {0[4]}".format(range(1,6)))
5
>>> print("I'm {0[name]}".format(dict(name="lord63", age=20)))
I'm lord63