Tokenizer and parser - Python : i want to make a tokenizer, and then a parser in python.

The idea of the tokenizer is to convert a string in a list of words.

if my string is  “(define x 5) ( + (* 2 x) 7)” 

the tokenizer should output

[´(´, ´define´, ´x´, ´5´, ´)´ , ´(´, ´+´ , ´(´, ´*´ , ´2´, ´x´, ´)´ , ´7´, ´)´ ]


then the parser should conver that list in

[ ( ´define´, ´x´, 5 ) , ( ´+´ , ( ´*´, 2 , ´x´) , 7 ) ]

im a bit lost and have no idea on how to start.

all i have is

def tokenizer(a):

final=[]


return final