[EDIT 00]: I\'ve edited several times the post and now even the title, please read below.
I just learned about the format string method, and its use with dictionarie
Part of your problem - well, the reason its not working - is highlighted in this question.
You can have your function work by passing in globals()
as your second argument, mprint('Hello my name is {name}',globals())
.
Although it may be convenient in Ruby, I would encourage you not to write Ruby in Python if you want to make the most out of the language.