๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ


Python/Basic

(27)
[Python] ๋ฐฐ์—ด(๋ฆฌ์ŠคํŠธ) ๋งˆ์ง€๋ง‰ ์›์†Œ ์ฐพ๊ธฐ -1 ์ธ๋ฑ์Šค ์ด์šฉ
[Python] List - List ๋นผ๊ธฐ a = [1,2,3] b = [1,2] [x for x in a if x not in b] [3] https://zetawiki.com/wiki/Python_%EB%A6%AC%EC%8A%A4%ED%8A%B8_%ED%95%A9%EC%A7%91%ED%95%A9,_%EA%B5%90%EC%A7%91%ED%95%A9,_%EC%B0%A8%EC%A7%91%ED%95%A9,_%EB%8C%80%EC%B9%AD%EC%B0%A8 Python ๋ฆฌ์ŠคํŠธ ํ•ฉ์ง‘ํ•ฉ, ๊ต์ง‘ํ•ฉ, ์ฐจ์ง‘ํ•ฉ, ๋Œ€์นญ์ฐจ - ์ œํƒ€์œ„ํ‚ค ๋‹ค์Œ ๋ฌธ์ž์—ด ํฌํ•จ... zetawiki.com
[Python] psycopg2 ์„ค์น˜ ์˜ค๋ฅ˜ flask, postgresql ์—ฐ๋™ ํ•˜๊ธฐ ์œ„ํ•ด์„œ psycopg2๋ฅผ ์„ค์น˜ ํ•˜๋ ค๊ณ  ํ–ˆ๋‹ค. $ pip3 install flask-sqlacodegen $ pip3 install psycopg2 ์˜ค๋ฅ˜ ๋ฐœ์ƒ ใ… ใ…  * libpq-dev ํŒจํ‚ค์ง€ ์„ค์น˜ ํ•„์š” zoomadmin.com/HowToInstall/UbuntuPackage/libpq-dev How to install libpq-dev ubuntu package on Ubuntu 18.04/Ubuntu 19.04/Ubuntu 16.04 How To Install "libpq-dev" Package on Ubuntu Quick Install Instructions of libpq-dev on Ubuntu Server. It’s Super Easy! simply c..
[Python] ๋‘ ๋ฌธ์ž์—ด ์ผ์น˜์œจ ๊ณ„์‚ฐ from difflib import SequenceMatcher a_str = 'abcd' b_str = 'bcd' SequenceMatcher(None, a_str, b_str).ratio() 0.8571428571428571 match_rate = f'{SequenceMatcher(None, a_str, b_str).ratio()*100:.1f}%' match_rate '85.7%' https://hoze.tistory.com/1741 ๋‘ ๋ฌธ์ž์—ด์„ ๋น„๊ตํ•˜์—ฌ ์ผ์น˜์œจ ๊ตฌํ•˜๊ธฐ ํ”„๋ž‘์Šค์–ด ๋ฒˆ์—ญ๋ณธ์˜ ์ƒ๋‹น ๋ถ€๋ถ„์ด ๊ตฌ๊ธ€์˜ ๋ฒˆ์—ญ๊ณผ ๊ณ ์Šค๋ž€ํžˆ ์ผ์น˜ํ•œ๋‹ค. ๋ฒˆ์—ญ์‚ฌ๊ฐ€ ์ œ๋Œ€๋กœ ์ผํ•œ ๊ฒƒ์ผ๊นŒ ์˜๊ตฌ์‹ฌ์ด ๋“ค ๋งŒํ•˜๋‹ค. ๋‹ค๋ฅธ ๋ฒˆ์—ญ์‚ฌ์—๊ฒŒ ๊ต์—ด์„ ๋งก๊ฒผ๋Š”๋ฐ ๋ณ„ ๋ฌธ์ œ๊ฐ€ ์—†๋‹ค๋Š” ๋‹ต๋ณ€์ด ๋Œ์•„์™”๋‹ค๊ณ  hoze.tistory.com https://cod..
[Python] ์˜ˆ์™ธ ๋ฐœ์ƒ ์‹œํ‚ค๊ธฐ, ๋ฉ”์„ธ์ง€ ์ถœ๋ ฅ try: a = 1/0 except: raise Exception('์˜ค๋ฅ˜ ๋ฐœ์ƒ')
[Python] cx_Oracle ํ•œ๊ธ€ ๊นจ์ง import cx_Oracle import os os.environ['NLS_LANG'] = '.UTF8' os.environ['NLS_LANG'] = '.UTF8' ์ถ”๊ฐ€
[Oauth] Google, email ์ •๋ณด ์–ป๊ธฐ serviceName='oauth2', version='v2' ์„œ๋น„์Šค๋ช…, ๋ฒ„์ „ ๋ญ˜๋กœ ํ•ด์•ผํ• ์ง€ ๋ชฐ๋ผ์„œ email ์ •๋ณด ์–ป๊ธฐ ํ•œ์ฐธ ํ—ค๋งด ใ…  ใ…  ์„œ๋น„์Šค๋ช… ์ •๋ณด ์žˆ๋Š” ๊ณณ ์•„์‹œ๋Š” ๋ถ„ ์•Œ๋ ค์ฃผ์„ธ์šง! import googleapiclient.discovery def get_user_info(credentials): """Send a request to the UserInfo API to retrieve the user's information. Args: credentials: oauth2client.client.OAuth2Credentials instance to authorize the request. Returns: User information as a dict. """ user_info_service = go..
[Python] python-docx - word ์ฝ๊ธฐ/ํŽธ์ง‘ ํ•˜๊ธฐ Demo.docx ํŒŒ์ผ์„ ์—ด์–ด์„œ ํŽธ์ง‘ํ•ด๋ณด๊ธฐ from docx import Document from docx.enum.table import WD_ALIGN_VERTICAL from docx.enum.text import WD_ALIGN_PARAGRAPH document = Document('Demo.docx') # ๋ฌธ์„œ๋‚ด์˜ ํ…Œ์ด๋ธ”๋“ค tables = document.tables # 1๋ฒˆ์งธ ํ…Œ์ด๋ธ” 0, 0 ์…€ - 2๋ฒˆ์งธ paragraphs์— ์ž…๋ ฅ tables[0].cell(0, 0).paragraphs[1].text = 'paragraphs[1]' # 2๋ฒˆ์งธ ํ…Œ์ด๋ธ” 0, 0 ์…€์— ์ž…๋ ฅ tables[1].cell(0, 0).text = 'table[1] (0,0)' out_file = 'New.docx' do..