based on version 33
- Find interface name(e.g. enp42s0) by
$ ifconfig -a
- Make & edit the interface's config file by
$ sudo nano /etc/sysconfig/network-scripts/ifcfg-enp42s0
- put the informations by the following format:
for j in range(2): | |
try: | |
for i in range(10): | |
print(i) | |
if i == 3: | |
raise StopIteration | |
except: | |
print("raised successfully") | |
continue |
from typing import List, Any, Generator | |
def minmaxpartition(_sum: int, _count: int, _min: int, _max: int | |
) -> Generator[List[Any], None, None]: | |
if _min > _max: | |
yield [] | |
return | |
if _sum < _count * _min: | |
yield [] |
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 |
// 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. |
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) |
"""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") |
{ | |
// 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 os | |
import sys | |
from contextlib import contextmanager | |
@contextmanager | |
def suppress_stdout(): |