Package manager인 mamba를 Windows 11의 PowerShell에서 사용할 수 있도록 셋업하기
- conda와 사용방법이 거의 동일
- conda보다 빠르다
- conda는 Python으로 구현되어있으나, mamba는 C++로 구현
- 패키지 다운로드시 여러 파일 동시 다운로드
| LOG_FILENAME = "mylog.log" | |
| LOG_ENCODING = "utf-8" | |
| def main(): | |
| print("Hello world!") | |
| if __name__ == "__main__": | |
| import datetime |
| """http://thesmithfam.org/blog/2012/10/25/temporarily-suppress-console-output-in-python/ | |
| https://stackoverflow.com/questions/36956083/how-can-the-terminal-output-of-executables-run-by-python-functions-be-silenced-i | |
| """ | |
| import os | |
| import sys | |
| from contextlib import contextmanager | |
| @contextmanager | |
| def suppress_stdout(): |
| { | |
| // Snippets for Python | |
| "Private Member Getter": { | |
| "prefix": [ | |
| "pmg", | |
| "ㅔㅡㅎ" | |
| ], | |
| "description": "Create private class member with getter", | |
| "body": [ | |
| "__${1:Name}: ${2:Type}", |
| """http://thesmithfam.org/blog/2012/10/25/temporarily-suppress-console-output-in-python/ | |
| https://stackoverflow.com/questions/36956083/how-can-the-terminal-output-of-executables-run-by-python-functions-be-silenced-i | |
| """ | |
| import sys | |
| import os | |
| import contextlib | |
| print(f"package\t{__name__}\tloaded") |
| def if_bool_value(any_input): | |
| _str = f"For if statement, {any_input} of {type(any_input)} is" | |
| if any_input: | |
| print(_str, True) | |
| else: | |
| print(_str, False) | |
| if_bool_value(1) | |
| if_bool_value(2) |
| // To view the default settings, hold "alt" while clicking on the "Settings" button. | |
| // For documentation on these settings, see: https://aka.ms/terminal-documentation | |
| { | |
| "$schema": "https://aka.ms/terminal-profiles-schema", | |
| "defaultProfile": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}", | |
| // You can add more global application settings here. |
| from typing import Any, Dict, List | |
| def create_write_csv(formatted_list: List[Dict[str, Any]], | |
| fieldnames: List[str], | |
| filepath: str, | |
| encoding: str): | |
| """row 정보를 가진 dictionary의 list를 받아 filepath에 csv로 저장 | |
| Arguments: | |
| formatted_list {List[Dict[str, str]]} -- column head를 key, 값을 value로 하는 dictionary의 list |