Teach robot and extract code?

Hey all, I have a question not sure if it is possible. if I teach a robot how to do operations, could i get that extract to be python code i can use ?