This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ ipython profile create | |
| $ vi ~/.ipython/profile_default/ipython_config.py | |
| c.InteractiveShellApp.extensions = [] to c.InteractiveShellApp.extensions = ['autoreload'] | |
| c.InteractiveShellApp.exec_lines = [] to c.InteractiveShellApp.exec_lines = ['%load_ext autoreload', '%autoreload 2'] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # if e is immutable | |
| [e] * n | |
| # [e] is mutable | |
| list_of_list = [[e] for _ in range(n)] | |
| # if you do [e] * n, you will get n references to the same [e] | |
| foo = [[]] *4 | |
| foo[0].append('x') | |
| [['x'], ['x'], ['x'], ['x']] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| cat new.txt | xargs -I{} sh -c 'printf {}; curl -s -o /dev/null -w " %{http_code}\n" {};' | grep -v 200 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import click | |
| all_colors = 'black', 'red', 'green', 'yellow', 'blue', 'magenta', \ | |
| 'cyan', 'white', 'bright_black', 'bright_red', \ | |
| 'bright_green', 'bright_yellow', 'bright_blue', \ | |
| 'bright_magenta', 'bright_cyan', 'bright_white' | |
| @click.command() |
OlderNewer