๐Ÿ”  Language/Python

pyenv ์—์„œ ์„ค์น˜ํ•˜๋ ค๊ณ  ํ•˜๋‹ˆ๊นŒ ์ž๊พธ ์—๋Ÿฌ๊ฐ€ ๋‚ฌ๋‹ค. dlopen ์–ด์ฉŒ๊ตฌ๊ฐ€ ์ž„ํฌํŠธ ์—๋Ÿฌ๋‚˜๊ณ  airflow --version ๋ช…๋ น์–ด ์น˜๋‹ˆ๊นŒ ๋‹ค๋ฅธ ๊ฐ€์ƒํ™˜๊ฒฝ์— ์„ค์น˜ ๋˜์–ด์žˆ๋‹คํ•˜๊ณ  ๊ทธ ๊ฐ€์ƒํ™˜๊ฒฝ์—์„œ ์‹คํ–‰ํ•ด๋ณด๋‹ˆ๊นŒ ์ด๋Ÿฐ์—๋Ÿฌ ๋ฐœ์ƒ. Library not loaded: '@rpath/libffi.8.dylib' ์—ฌ๊ธฐ์„œ ์ฐพ์•„๋ดค๋Š”๋ฐ ์—†๋‹ค๋Š๋‹ˆ ๊ทธ๋ž˜๊ฐ€์ง€๊ณ  ๊ณฐ๊ณฐํžˆ ์ƒ๊ฐํ•ด๋ณด๋‹ˆ๊นŒ ๊ฒฝ๋กœ ์—๋Ÿฌ ๊ฐ™์•˜๋‹ค. https://stackoverflow.com/questions/56463930/interpreters-installed-via-pyenv-are-not-added-to-path Interpreters installed via pyenv are not added to $PATH I can't figure out why pyenv (inst..
Code: 516. DB::Exception: default: Authentication failed: password is incorrect or there is no user with such name. (AUTHENTICATION_FAILED) (version 22.2.2.1) ๋‹ค ๋งž๋Š”๋ฐ ๋จธ์„  ์—๋Ÿฌ์ธ๊ณ  ํ•˜๋‹ˆ sqlalchemy-clickhouse ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ์ž์ฒด ์—๋Ÿฌ๋ผ๊ณ  ํ•œ๋‹ค ๊ทธ๋ž˜์„œ ๊นƒํ—™์— ๋“ค์–ด๊ฐ€์„œ ํ•ด๋‹น ์—๋Ÿฌ๋กœ ์†”๋ฃจ์…˜ ์ œ๊ณตํ•œ๊ฑฐ ๋ณด๋‹ˆ๊นŒ ์ €๊ฑฐ ๋ง๊ณ  clickhouse-sqlalchemy ์“ฐ๋ผ๊ณ  ์จ์žˆ๋‹คใ…‹ใ…‹ใ…‹ pip uninstall sqlalchemy-clickhouse ํ•˜๊ณ  pip install clickhouse-sqlalchemy ํ•˜๋‹ˆ๊นŒ ๊น”๋”ํ•˜๊ฒŒ ํ•ด๊ฒฐ! ๊ฐ€๋”์€ ์Šคํƒ์˜ค๋ฒ„ ํ”Œ๋กœ์šฐ ๋ณด๋‹จ ๊ฐœ๋ฐœํ•œ ๊นƒํ—™์—์„œ ..
์š”์ฆ˜ ๋“ฃ๋Š” ์ˆ˜์—…์—์„œ ๊ณผ์ œํ•˜๋‹ค๊ฐ€ ์žฌ๋ฐŒ์–ด์„œ ํ•œ๋ฒˆ ๋‚จ๊ฒจ๋ณธ๋‹ค inputs = "cat32dog16cow5" def find_string(inputs): result = [] word = "" for index,target in enumerate(inputs): if target.isdigit(): if word != "": result.append(word) word = "" else: word += inputs[index] return result string_list = find_string(inputs) print(string_list) word ์—๋‹ค๊ฐ€ ์ž ๊น string ์ €์žฅํ•ด๋‘๊ณ  number์ผ๋•Œ append ํ•˜๊ณ  word ์ดˆ๊ธฐํ™”, ๊ทธ๋ฆฌ๊ณ  word๊ฐ€ ๋นˆ ๋ฌธ์ž์—ด์ด ์•„๋‹ ๋•Œ๋งŒ appendํ•˜๋Š” ์กฐ๊ฑด ์ถ”๊ฐ€ ๊ฐ„๋‹จํ•œ..
๋‚ด๊ฐ€ ๋ณด๋ ค๊ณ  ๋งŒ๋“œ๋Š” windows ํ™˜๊ฒฝ์—์„œ jupyter notebook promt ๋ช…๋ น์–ด ์ •๋ฆฌ 1. ๊ฐ€์ƒํ™˜๊ฒฝ ๊น”๋ฆฐ ๋ฆฌ์ŠคํŠธ ( ์ด๋ฆ„ ์ฐพ๊ธฐ ) 2. 1๋ฒˆ์—์„œ ์ฐพ์•„์„œ ๋‚˜์˜จ ํ›„ activate "๊ฐ€์ƒํ™˜๊ฒฝ ์ด๋ฆ„" 3. D ๋“œ๋ผ์ด๋ธŒ ๊ฒฝ๋กœ ์‹คํ–‰
selenium.common.exceptions.webdriverexception: message: unknown error: cannot find chrome binary ์žฅ์žฅ ํ•œ 5์‹œ๊ฐ„์„ ํ—ค๋ฉ˜ ๊ฒƒ ๊ฐ™๋‹ค..ใ…Ž.. ์—๋Ÿฌ ์›์ธ์€ chrome ๊ณผ chrome driver๊ฐ€ ๊ฐ™์€ ๊ฒฝ๋กœ์— ์žˆ์–ด์•ผํ•˜๋Š”๋ฐ wsl์„ ์‚ฌ์šฉํ•˜๊ณ , ๋ ˆ๊ฑฐ์‹œ crawler๋ฅผ ๊ตฌ๋™ํ•ด๋ณด๋ ค๋Š” ์™€์ค‘์— ( ๋ ˆ๊ฑฐ์‹œ ํ™˜๊ฒฝ์€ ํŠธ๋ฃจ linux๋‹ค ) ์ƒ๊ธด ๋ฌธ์ œ.. ๊ทธ๋ฅด๋‹ˆ๊น ํฌ๋กฌ์€ ์œˆ๋„์šฐ ํ™˜๊ฒฝ์—์„œ ๊น”๊ณ , ์ฐพ๋Š”๊ฑด linux ๋ฒ„์ „์—์„œ ์ฐพ์œผ๋ ค๋‹ˆ๊น ์ด๊ฒŒ ๊ฒฝ๋กœ๊ฐ€ ์•ˆ ์ฝํžˆ๋Š” ๊ฒƒ ๊ฐ™๋‹ค ์ค‘๊ฐ„์— ๊ฑ ์•„..์œˆ๋„์šฐ ๋ฒ„๋ฆด๊นŒ?ใ…Ž ์‹ถ์—ˆ๋‹ค ใ…Žใ…Ž...; ์•”ํŠผ๊ฐ„์—~~ 1. chrome driver path์—๋‹ค๊ฐ€ chrome ์„ ๋˜ ์„ค์น˜ํ•ด์ค€๋‹ค wget https://dl.google.com/l..
๋‚ด๊ฐ€ ๋ณด๋ ค๊ณ  ๋งŒ๋“œ๋Š” ๊ฐ€์ƒํ™˜๊ฒฝ ์„ค์ • ์„ธํŒ… ๊ณผ์ • pyenv๋Š” nvm rvm์ฒ˜๋Ÿผ ์ธํ„ฐํ”„๋ฆฌํ„ฐ ์ž์ฒด์˜ ๋ฒ„์ „๊นŒ์ง€ ๊ด€๋ฆฌํ•ด์ฃผ๋Š” ํฐ ๊ฐœ๋…์ด๊ณ , virtualenv๋Š” ๊ทธ์•ˆ์˜ ์„ธ์„ธํ•œ ๊ฐ€์ƒํ™˜๊ฒฝ ๊ตฌ์„ฑ์„ ๋‚˜๋ˆ ์ฃผ๋Š” ์—ญํ• ์ด๋‹ค. ์ฆ‰, pyenv + virtualenv ๋ฅผ ์“ฐ๋ฉด ๊ฐ๊ฐ์˜ ํ…Œ์ŠคํŠธํ•  ํ™˜๊ฒฝ์„ ์ธํ„ฐํ”„๋ฆฌํ„ฐ ๋ฒ„์ „๊นŒ์ง€ ํŽธํ•˜๊ฒŒ ๋ฐ”๊ฟ”๊ฐ€๋ฉด์„œ ๊ด€๋ฆฌํ•  ์ˆ˜ ์žˆ๋‹ค๋Š” ๊ฒƒ ์•„์ง๊นŒ์ง„ ํ•„์š” ์—†๊ฒ ์ง€๋งŒ ์“ฐ๋Š” ๊น€์— ์จ๋ณด๋Š” ๋„ˆ๋‚Œ์“ฐ ์ผ๋‹จ os ํ™˜๊ฒฝ์€ 16.04 ์šฐ๋ถ„ํˆฌ ๋ฆฌ๋ˆ…์Šค pyenv ์‚ฌ์šฉํ•˜๊ธฐ 1. pyenv ์„ค์น˜ git clone https://github.com/pyenv/pyenv.git ~/.pyenv 2. bash ์„ค์ • # vi ~/.bashrc export PYENV_ROOT="$HOME/.pyenv export PATH="$PYENV_ROOT/bin..
์ ํ”„ ํˆฌ ํŒŒ์ด์ฌ์—์„œ๋Š” ํŒŒ์ด์ฐธ์„ ๊ถŒ์žฅํ•˜์ง€๋งŒ vscode๋งŒ ์จ์™”๋˜ ๋‚˜๋Š” ํŒŒ์ด์ฐธ์€ ๋ฌ˜ํ•˜๊ฒŒ ์ดํด๋ฆฝ์Šค ๊ฐ™์•„์„œ ์‹ซ๋‹ค ใ…‹ใ…‹ ๊ทธ๋ž˜์„œ vscode์—์„œ ๋งŒ๋“ค์–ด ๋†“์€ ๊ฐ€์ƒ ํ™˜๊ฒฝ์˜ ์ธํ„ฐํ”„๋ฆฌํ„ฐ๋ฅผ ์—ฐ๊ฒฐํ•˜๋Š” ๋ฐฉ๋ฒ•์„ ํฌ์ŠคํŒ…ํ•˜๋„๋ก ํ•˜๊ฒ ๋‹ค. 1. F1์„ ๋ˆ„๋ฅด๊ณ  select interpreter ์—์„œ interpreter path ์ฆ‰, ๊ฒฝ๋กœ์ฐพ๊ธฐ๋ฅผ ํ•œ๋‹ค ์šฐ๋ฆฌ๊ฐ€ ์•ž์ „์— ๋งŒ๋“ค์–ด ๋†“์€ venv/flask_sample_pjt ํ•˜์œ„์˜ Scripts ๋””๋ ‰ํ† ๋ฆฌ ์•ˆ์— python.exe ํŒŒ์ผ์ด ์žˆ์„ ๊ฒƒ์ด๋‹ค ์š”๊ฒƒ์ด ์šฐ๋ฆฌ๊ฐ€ ์—ฌ๊ธฐ์„œ ์ฐพ๊ณ ์ž ํ•˜๋Š” ํŒŒ์ด์ฌ ์ธํ„ฐํ”„๋ฆฌํ„ฐ์ด๋‹ค. ํŒŒ์ด์ฌ์ด ์ธํ„ฐํ”„๋ฆฌํ„ฐ์ธ ๊ฑธ ๋ชจ๋ฅด๋Š” ์‚ฌ๋žŒ์€ ์—†๊ฒ ์ง•? 2. ctrl + ` ๋กœ cmd ์ฐฝ์„ ์—ด์–ด๋ณธ๋‹ค ( ๋ถ€์ œ. ์—๋Ÿฌ ์žก๊ธฐ) 1๋ฒˆ์˜ ์ž‘์—…์œผ๋กœ ์—ฐ๊ฒฐ๊นŒ์ง€๋Š” ์™„๋ฃŒ ๋œ๊ฑด๋ฐ, ์—ด์—ˆ์„ ๋•Œ ๋ฐ”๋กœ ๊ฐ€์ƒํ™˜๊ฒฝ์œผ๋กœ ์ ‘์†์ด..
https://wikidocs.net/book/4542 ์ ํ”„ ํˆฌ ํ”Œ๋ผ์Šคํฌ **์ ํ”„ ํˆฌ ํ”Œ๋ผ์Šคํฌ ์˜คํ”„๋ผ์ธ ์ฑ… ์ถœ๊ฐ„ !! (2020.11)** * [์ฑ… ๊ตฌ์ž… ์•ˆ๋‚ด](https://wikidocs.net/102760) wikidocs.net ์šฐ์„  ์ด ๋งํฌ๋ฅผ ์—ด์‹ฌํžˆ ๋”ฐ๋ผํ–ˆ๋‹ค๋Š” ์  ์•Œ๋ฆฌ๊ณ  ์‹œ์ž‘ํ•œ๋‹ค..! ์ฃผํ”ผํ„ฐ ๋…ธํŠธ๋ถ์„ ์‚ฌ์šฉํ–ˆ์„ ๋•Œ ์•„๋‚˜์ฝ˜๋‹ค๋กœ ๊ฐ€์ƒ ํ™˜๊ฒฝ์„ ์„ค์ •ํ–ˆ๋˜ ๊ฑฐ์ฒ˜๋Ÿผ ๋กœ์ปฌ์—์„œ ์ž‘์—…ํ•  ๋•Œ ํ”„๋กœ์ ํŠธ๋งˆ๋‹ค ํ™˜๊ฒฝ ์„ค์ • ๊ตฌ์„ฑ์ด ๋‹ค๋ฅผ ์ˆ˜ ์žˆ์œผ๋‹ˆ, ๊ฐ€์ƒ ํ™˜๊ฒฝ์„ ๋จผ์ € ์„ค์ • ํ•ด์ฃผ๊ธฐ๋กœ ํ•œ๋‹ค. ์ผ๋‹จ ๋‚˜๋Š” ์ € ๋งํฌ์— ๋‚˜์™€ ์žˆ๋Š” ๊ฒƒ์ฒ˜๋Ÿผ ์œˆ๋„์šฐ os ์œ ์ €๋ผ์„œ ๊ฑ ๋””๋ ‰ํ† ๋ฆฌ๋งŒ ๋‚ด ๋ง˜๋Œ€๋กœ ์„ค์ •ํ•˜๋ฉด์„œ ์ž˜ ๋”ฐ๋ผํ•ด๋ดค๋‹ค ๋ฃจํŠธ ๋””๋ ‰ํ† ๋ฆฌ๋Š” sample_pjt๋กœ ์ •ํ•˜๊ณ  ์ž‘์—… ๋””๋ ‰ํ† ๋ฆฌ๋Š” flask_sample_pjt๋กœ ์ •ํ–ˆ๋‹ค. venvs๋Š” ๊ฐ€์ƒํ™˜๊ฒฝ ๋ชจ์Œ ๋””..
์•ˆ๋…•ํ•˜์„ธ์š” ์—ฌ๋Ÿฌ๋ถ„ ์ €๋Š” ์ข€๋” ๋„“์€ ์„ธ์ƒ์„ ์ฐพ์•„ ํ‡ด์‚ฌ๋ฅผ ํ•˜์˜€์Šต๋‹ˆ๋‹ค ์—ฌํŠผ ๋Œ€๊ฐ์ง‘ ๋จธ์Šด์„ ํ•˜๊ธฐ ์œ„ํ•ด ์ฝ”ํ…Œ ์ค€๋น„๋ฅผ ์‹œ์ž‘ํ•˜์˜€์Šต๋‹ˆ๋‹ค. ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค ๊ณ ๋“์  kit level1 ์ •๋ ฌ ๋ฌธ์ œ def solution(array, commands): answer = [] for i in commands: answer.append(sorted(array[i[0]-1:i[1]])[i[2]-1]) return answer 1. sort()๋Š” ๋ฆฌํ„ด ๊ฐ’์ด none์ด๊ธฐ ๋•Œ๋ฌธ์— ๋‚ด์žฅ ํ•จ์ˆ˜์ธ sorted๋กœ ์จ์ค˜์•ผํ•œ๋‹ค ๋ฅผ ๋ฐฐ์› ์Šต๋‹ˆ๋‹ค. ๊ทผ๋ฐ ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค ๋‹ต ์ œ์ถœํ•˜๊ณ  ๋ณด๋‹ˆ ๋‹ค๋ฅธ ์‚ฌ๋žŒ๋“ค์€ ๋žŒ๋‹ค๋กœ๋„ ์ผ๋”๋ผ๊ณ ์š”? ๋žŒ๋‹ค๋Š” ์•„์ง ์ €์˜ ์˜์—ญ์ด ์•„๋‹Œ๊ฑฐ ๊ฐ™์•„..์ผ๋‹จ..ํŒจ์ˆ˜..
๋ถ„๋ช…ํžˆ ์—‘์…€์‹œํŠธ ์ €์žฅํ• ๋•Œ utf-8๋กœ ์ €์žฅํ–ˆ๋Š”๋ฐ ์•ˆ๋จนํžŒ ๊ฒƒ ๊ฐ™๋‹ค ์ฒจ์—” ์ด๋Ÿฐ์‹์œผ๋กœ ๋‚˜์™€์„œ ํ›„๊ธฐ ์ฐพ์•„๋ณด๊ณ  'utf-8' codec can't decode byte 0xb0 in position 0: invalid start byte utf-16์ธ๊ฐ€? ์‹ถ์–ด์„œ ๋ณ€๊ฒฝํ•ด๋ดค๋”๋‹ˆ ๋˜ ์—๋Ÿฌ๋ฅผ ๋ฑ‰๊ธธ๋ž˜ ์•„, ์ด๊ฑฐ ์—‘์…€์ด ์ œ๋Œ€๋กœ ์ €์žฅ ์•ˆํ•ด์คฌ๊ตฌ๋‚˜ ์‹ถ์–ด์„œ ์ธ์ฝ”๋”ฉ euc-kr ๋กœ ๋ฐ”๊ฟ”์คฌ๋”๋‹ˆ ์•„์ฃผ ์ž˜๋จ!^^ ์˜ค๋Š˜๋„ ํ‰ํ™”๋กœ์šด ์ฝ”๋”ฉ์ƒํ™œ์ด๋‹ค.
ํ‚จ์ง€ (Kinzie)
'๐Ÿ”  Language/Python' ์นดํ…Œ๊ณ ๋ฆฌ์˜ ๊ธ€ ๋ชฉ๋ก