| | Grouping ||
First Header | Second Header | Third Header |
---|---|---|
Content | Long Cell | |
Content | Cell | Cell |
New section | More | Data | And more | With an escaped '|' ||
Some Python tools.
A "context manager" imposes a beginning and end on some process that can cause problems if interrupted midway through. In the case of file I/O, if a file is opened for reading or writing and then not closed properly, it can be left in a locked state. A context manager (initiated by the with
keyword) ensure that the file is closed in any case. Example
with open('questions_and_answers.json', 'r') as f:
General information about the Iron Forger project at Hacker School.
Assignment: Build a tool to compare two text files and generate a diff — a file that concisely specifies the differences between the two other files.
A "diff" file has the following structure:
None
issue in MatPlotLib implementation.shutil
(http://chimera.labs.oreilly.com/books/1230000000393/ch13.html#_problem_218).In [1]: import dis | |
In [2]: def f(): return ["foo" for i in range(10)] | |
In [3]: dis.dis(f) | |
1 0 LOAD_CONST 1 (<code object <listcomp> at 0x1062e14b0, file "<ipython-input-16-3cb1faa7b4d7>", line 1>) | |
3 LOAD_CONST 2 ('f.<locals>.<listcomp>') | |
6 MAKE_FUNCTION 0 | |
9 LOAD_GLOBAL 0 (range) | |
12 LOAD_CONST 3 (10) |