A brief example on how to use npx to run gist based scripts.
Read the article here https://neutrondev.com/npm-vs-npx-whats-the-difference/
A brief example on how to use npx to run gist based scripts.
Read the article here https://neutrondev.com/npm-vs-npx-whats-the-difference/
| { | |
| // Use IntelliSense to learn about possible attributes. | |
| // Hover to view descriptions of existing attributes. | |
| // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | |
| "version": "0.2.0", | |
| "configurations": [ | |
| { | |
| "name": "Python: Current File", | |
| "type": "python", | |
| "request": "launch", |
| 0 = Success | |
| 1 = Operation not permitted | |
| 2 = No such file or directory | |
| 3 = No such process | |
| 4 = Interrupted system call | |
| 5 = Input/output error | |
| 6 = No such device or address | |
| 7 = Argument list too long | |
| 8 = Exec format error | |
| 9 = Bad file descriptor |
| function bycache() { | |
| find . | grep -E "(__pycache__|\.pyc|\.pyo$)" | xargs rm -rf | |
| } |
project
│ README.md
│ file001.txt
│
└───folder1
│ │ file011.txt
│ │ file012.txt
│ │
│ └───subfolder1
| print('__file__={0:<35} | __name__={1:<20} | __package__={2:<20}'.format( | |
| __file__, __name__, str(__package__))) |
| @blueprint.record_once | |
| def record_params(state): | |
| """Store app.config in blueprint when blueprint is registered on app.""" | |
| app = state.app | |
| blueprint.config = {key: value for key, value in app.config.iteritems()} |
| import json | |
| import uuid | |
| from IPython.display import display_javascript, display_html, display | |
| class RenderJSON(object): | |
| def __init__(self, json_data): | |
| if isinstance(json_data, dict) or isinstance(json_data, list): | |
| self.json_str = json.dumps(json_data) | |
| else: | |
| self.json_str = json_data |
| { | |
| // Use IntelliSense to learn about possible attributes. | |
| // Hover to view descriptions of existing attributes. | |
| // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | |
| "version": "0.2.0", | |
| "configurations": [ | |
| { | |
| "name": "Python: Current File", | |
| "type": "python", | |
| "request": "launch", |
| def print_exceptions_tree(exception_class, level=0): | |
| if level > 1: | |
| print(" |" * (level - 1), end="") | |
| if level > 0: | |
| print(" +---", end="") | |
| print(exception_class.__name__) | |
| for subclass in exception_class.__subclasses__(): | |
| print_exceptions_tree(subclass, level + 1) |