how do i change .txt files to a .py file

I have code saved as .txt files and need to convert them to a .py file