The easiest way to print the lines of codes is through the use of the built-in functions.
print open(__file__).read()
Or you could just write the code in string mode and simply print them. However that obviously won’t be executable codes anymore once written in quotation marks.
solved How to print the codes in python? [duplicate]