"OIM3640: GitHub settings"
Topics covered:
Time: ~40 minutes
One cheat sheet allowed (one page, both sides).
with open('jekyll.txt') as f: for line in f: # line by line print(line.strip()) with open('jekyll.txt') as f: text = f.read() # entire file as string
with closes the file automatically when done.
with
with open('results.txt', 'w') as f: for word, count in top[:10]: f.write(f'{word}: {count}\n')
File modes: 'r' read (default), 'w' write, 'a' append
'r'
'w'
'a'
'w' creates a new file or overwrites an existing one!
PROPOSAL.md
with open(...)
Use only built-in Python first - no external libraries yet!
logs/wk09.md
Next session: APIs and JSON
global styles