User:Simon/Trim4/tools/Python read file

From XPUB & Lens-Based wiki
< User:Simon‎ | Trim4/tools
Revision as of 14:41, 20 June 2020 by Simon (talk | contribs) (→‎Reading files)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Reading files

For Python to read a file:

with open('README.md', 'r') as txt:
    txt_content = txt.read() 
print(txt_content)