Python

name == main

4 minute read

if name == β€œmain”: To better understand why and how this matters, we need to take a step back to understand how Python initializes scripts and how this inter...

Python GMP

less than 1 minute read

Python GMP

Pytorch IterableDataset

less than 1 minute read

https://inmoonlight.github.io/2021/02/21/PyTorch-IterableDataset/

python concurrent futures

less than 1 minute read

```py import time data = [] start = time.time() from concurrent.futures import ThreadPoolExecutor import concurrent.futures

Python underbar underscore naminig

less than 1 minute read

4-1. 언더바가 μ•žμ— ν•˜λ‚˜ 뢙은 경우 (ex: _variable) 이 κ²½μš°λŠ” λͺ¨λ“ˆ λ‚΄μ—μ„œλ§Œ ν•΄λ‹Ή λ³€μˆ˜/ν•¨μˆ˜λ₯Ό μ‚¬μš©ν•˜κ² λ‹€λŠ” μ˜λ―Έμž…λ‹ˆλ‹€.(private) 특히 ν˜‘μ—…μ„ ν•  λ•Œ λ‹€λ₯Έ νŒ€μ›μ—κ²Œ β€˜μ΄ λ³€μˆ˜/ν•¨μˆ˜λŠ” 이 λͺ¨λ“ˆ λ‚΄λΆ€μ—μ„œλ§Œ μ‚¬μš©ν•  거닀’라고 λͺ…μ‹œμ μœΌλ‘œ 힌트λ₯Ό 쀄 수 μžˆμŠ΅λ‹ˆλ‹€.

urllib parse unquote

less than 1 minute read

urllib.parse.unquote(string, encoding=’utf-8’, errors=’replace’) Replace %xx escapes with their single-character equivalent. The optional encoding and err...

Python Regex

less than 1 minute read

Regex 자주 μ‚¬μš©ν•˜λŠ” 문자 클래슀

Rename files with Python using os.rename

less than 1 minute read

```py import os def changeName(path, cName): i = 1 for filename in os.listdir(path): print(path+filename, β€˜=>’, path+str(cName)+str(i)+’....