Q:

'raw_input' does nothing, regardless of the input given

I am trying to make a tool that will encode/decode a string according to values in a dictionary however, I am stuck with the following code:
class edt():
    e_dic = {}

    def main(self):
        c = "hcqnxmytwukgirzoeaspdfvlbj"
        a = "abcdefghijklmnopqrstuvwxyz"
        e_dic = {}
        for i in range(len(c)):
            e_dic[a[i]] = c[i]
        e_dic[" "] = " "
        self.e_dic = e_dic
        e = edt()
        user_input = raw_input("1.Encode\n2.Decode\n")
        if user_input == "1":
            e.encode()
        elif user_input == "2":
            e.decode()
        else:
            False

    def encode(self):
        print("test")

    def decode(self):
        print("test")

def run():
    run_main = None
    run_main = edt()
    run_main.main()

I have omitted encode() and decode() as I don't think that they are causing the problem.
The problem is that this happens when I run it:

>>run()
1.Encode
2.Decode
>>
(The script pauses here to wait for the return key to be pressed, but does nothing regardless of the input given)
>>

I am given no error after this completes. Any help would be greatly appreciated

A:

The code looks fine. But shouldn't you be using an object to call the method? like so
class edt():
e_dic = {}

def encode(self):
    print "encoded "

def decode(self):
    print "decoded "

def main(self):
    c = "hcqnxmytwukgirzoeaspdfvlbj"
    a = "abcdefghijklmnopqrstuvwxyz"
    e_dic = {}
    for i in range(len(c)):
        e_dic[a[i]] = c[i]
    e_dic[" "] = " "
    self.e_dic = e_dic
    e = edt()
    user_input = raw_input("1.Encode\n2.Decode\n")
    if user_input == "1":
        e.encode()
    elif user_input == "2":
        e.decode()
    else:
        False

def run():
    run_main = None
    run_main = edt()
    run_main.main()

Output:
>>> run()
1.Encode
2.Decode
1
encoded 

Fiddle here:
http://ideone.com/9eET4T

