How to print the codes in python? -



How to print the codes in python? -

this question has reply here:

print out code in python script 1 reply

how 1 print lines of code?

suppose have here 2 variables.

var1 = 2*8 msg = "answer is: "

what statement should add together here programme print source code?

the easiest way print lines of codes through utilize of built-in functions.

print open(__file__).read()

or write code in string mode , print them. won't executable codes anymore 1 time written in quotation marks.

python

Comments

Popular posts from this blog

xslt - DocBook 5 to PDF transform failing with error: "fo:flow" is missing child elements. Required content model: marker* -

mediawiki - How do I insert tables inside infoboxes on Wikia pages? -

Local Service User Logged into Windows -