- Working Truee
- Staging Area (Index)
- History
git diff
| import asyncio | |
| loop = asyncio.get_event_loop() | |
| async def hello(): | |
| await asyncio.sleep(3) | |
| print('Hello!') | |
| if __name__ == '__main__': | |
| loop.run_until_complete(hello()) | |
| def outer(out_arg): | |
| def inner(inner_arg): | |
| return inner_arg + outer_arg | |
| return inner | |
| func = outer(10) | |
| func(5) | |
| func.__closure__ |
| import functools | |
| def decorator(func): | |
| @functools.wraps(func) | |
| def new_func(*args, **kwargs): | |
| print('decorator was here') | |
| return func(*args, **kwargs) | |
| return new_func | |
| @decorator |
| """Use coroutines to sum log file data with different log levels. | |
| log file content: | |
| ERROR: 78 | |
| DEBUG: 72 | |
| WARN: 99 | |
| CRITICAL: 97 | |
| FATAL: 40 | |
| FATAL: 33 | |
| CRITICAL: 34 |
| """Use generator to sum log file data on the fly | |
| - Generators make good pipelines | |
| - Useful for workflow problems | |
| - Example parsing of a log file | |
| log file content: | |
| 12 | |
| 34 | |
| 56 | |
| 78 | |
| 90 |
| Python build finished successfully! | |
| The necessary bits to build these optional modules were not found: | |
| _bz2 _curses _curses_panel | |
| _dbm _gdbm _lzma | |
| _sqlite3 _ssl _tkinter | |
| readline zlib _uuid | |
| To find the necessary bits, look in setup.py in detect_modules() for the module's name. | |
| sudo apt install libbz2-dev libncurses5-dev libgdbm-dev liblzma-dev sqlite3 libsqlite3-dev openssl libssl-dev tcl8.6-dev tk8.6-dev libreadline-dev zlib1g-dev uuid-dev |
| [ui] | |
| merge = meld | |
| [extensions] | |
| extdiff = | |
| [merge-tools] | |
| meld.args = $local $base $other --output=$output |
| #!/bin/bash | |
| sudo apt-get install vnc4server ubuntu-desktop | |
| sudo apt-get install gnome-panel gnome-settings-daemon metacity nautilus gnome-terminal |