Python: How to use it in Rename Dialog?

Have you seen this thread?