Question: There is a huge matrix whose elements are numbers in the range of 1 to 15. I want to transform the matrix to the one whose elements be letters such that 1 becomes "a", 2 becomes "b", and so on. As a simple example:

```
import pandas as pd
import numpy as np, numpy.random
numpy.random.seed(1)
A = pd.DataFrame (np.random.randint(1,16,10).reshape(2,5)) 
# A     0   1   2   3   4
#   0   6   12  13  9   10
#   1   12  6   1   1   2

```

The expected output is

```
# B     0   1   2   3   4
#   0   f   l   m   i   j
#   1   l   f   a   a   b

```

I can do it with a loop but for a huge matrix, it doesn't seem logical. There should be a more pythonic way to do it. In `R`, `chartr` is the function for such a replacement. For the numbers between 1 to 9, it works like this: `chartr("123456789", "ABCDEFGHI", A)`. What is the equivalent in Python?

Answer: 
You use a class because the class instance and it's variables remain after tkinter exits.<https://www.tutorialspoint.com/python/python_classes_objects.htm> And you may want to reexamine some of your documentation requirements, i.e. when the statement is
"root.title('Title of the window')", adding the explanation "#title of the window" is just a waste of your time..

```
""" A simplified example
"""

import sys
if 3 == sys.version_info[0]:  ## 3.X is default if dual system
    import tkinter as tk     ## Python 3.x
else:
    import Tkinter as tk     ## Python 2.x

class GetEntry():
    def __init__(self, master):
        self.master=master
        self.entry_contents=None
        self.e = tk.Entry(master)
        self.e.grid(row=0, column=0)
        self.e.focus_set()

        tk.Button(master, text="get", width=10, bg="yellow",
               command=self.callback).grid(row=10, column=0)

    def callback(self):
        """ get the contents of the Entry and exit
        """
        self.entry_contents=self.e.get()
        self.master.quit()

master = tk.Tk()
GE=GetEntry(master)
master.mainloop()

print("\n***** after tkinter exits, entered =", GE.entry_contents)

```
So, I have taken Curly Joe's example and made a function with the his sketch

The final result, for anyone wanting to use this as a template for a input dialog box:

```
def input_dlg():
 import tkinter as tk
 from tkinter import ttk

class GetEntry():

    def __init__(self, master):

        self.master=master
        self.master.title('Input Dialog Box')
        self.entry_contents=None

        ## Set point entries

        # First point
        self.point1 = ttk.Entry(master)
        self.point1.grid(row=0, column=1)
        self.point1.focus_set()

        # Second point
        self.point2 = ttk.Entry(master)
        self.point2.grid(row=1, column=1)
        self.point2.focus_set()

        # labels
        ttk.Label(text='First Point').grid(row=0, column=0)
        ttk.Label(text='Second Point').grid(row=1, column=0)
        ttk.Button(master, text="Done", width=10,command=self.callback).grid(row=5, column=2)

    def callback(self):
        """ get the contents of the Entries and exit the prompt"""
        self.entry_contents=[self.point1.get(),self.point2.get()]
        self.master.destroy()

master = tk.Tk()
GetPoints=GetEntry(master)
master.mainloop()

Points=GetPoints.entry_contents

return list(Points)

```