
[1] ๋ฌธ์ ์ด๋ฐ ์คํฌ๋ฆฝํธ๋ฅผ ๋ง๋ค๊ณ tuple list๋ string list๋ฅผ ๋ณต์ฌํด์ ๊ตฌ๊ธ์ํธ์ ๋ถ์ฌ๋ฃ์ผ๋ฉด ํ์ด ๋๋ ์ ธ์ ๋ค์ด๊ฐ๋ ์ต์ ์ด ์์ ์ค ์์๋๋ฐ ์๋ ๊ฒ ๊ฐ์ใ ใ ์ด๋ ๊ฒ ํ ํ์ ๋ค ๋ค์ด๊ฐ,,, [2] ํด๊ฒฐ๋ฒ > Google Sheets API Sheets for Developers > Sheets API ๋ฅผ ์ฌ์ฉํด์ ํ๋จ์๋ก ๋ฃ์ด์ค ์ ์๋ค. (์ฐธ๊ณ : https://stackoverflow.com/questions/46274040/append-a-list-in-google-sheet-from-python) ๊ทผ๋ฐ ์ด ๋ฐฉ๋ฒ์ ์ค์นํด์ผํ๋ ํจํค์ง๋ ๋ง๊ณ .. ๊ฐ๋จํ์ง ์์์ ์ํ๊ธฐ๋ก ํจ [3] ํด๊ฒฐ๋ฒ > CSV 1. CSV ํ์ผ์ ๋ง๋ค๊ณ 2. ๊ตฌ๊ธ์ํธ์์ CSV ํ์ผ ์ด๊ธฐ (์ฐธ๊ณ : How to ..

๋ก์ปฌ์์ chromedriver๋ฅผ ์ธ ๋๋ ํฌ๋กฌ๋๋ผ์ด๋ฒ๋ฅผ ๋ค์ด๋ฐ์ ํ, ํด๋์ ๋ฃ๊ณ local path๋ฅผ ์ด์ฉํด์ chromedriver๋ฅผ ์คํ์์ผ์ฃผ์์ต๋๋ค. from selenium import webdriver import os BASE_DIR = Path(__file__).resolve().parent chrome_driver_path = os.path.join(BASE_DIR, 'chromedriver') chrome_options = webdriver.ChromeOptions() chrome_options.add_argument("--headless") chrome_options.add_argument("--disable-gpu") driver = webdriver.Chrome(chrome_dr..
Python sort๋ฌธ์ (ํ์ด์ฌ 3.8๋ฒ์ ) ๋ฅผ ๋ณด๋ฉด์ Sort๋ฅผ ์ดํด๋ณด๊ฒ ์ต๋๋ค. [1] list.sort() vs sorted() ์ฐ์ ํ์ด์ฌ ๋ฆฌ์คํธ๋ ๋๊ฐ์ง์ built-in function์ด ์๋๋ฐ list.sort() ์ sorted() ์ ๋๋ค. 1) list.sort() ์ค์ง list์์๋ง ์ฌ์ฉํ ์ ์๋ function. list๋ฅผ ์ ์๋ฆฌ(in-place)์์ sort ํฉ๋๋ค. ์ฆ original list๋ฅผ ์์ ํฉ๋๋ค. 2) sorted() iterable ๊ฐ์ฒด (list, tuple, ๋์ ๋๋ฆฌ ๋ฑ๋ฑ)์ ๋ชจ๋ ์ฌ์ฉํ ์ ์๋ function. list์ sorted๋ฅผ ํด์ฃผ๋ฉด, ์๋ก์ด list๋ฅผ ๋ง๋ค์ด์ ๋ฐํํด์ค๋๋ค. => ' list.sort() ๋ sorted() ๋ณด๋ค ๋ ํธํ์ง๋ง, ๋ง์ฝ ..

Python์ Built-in Function ์ค any๋ฅผ ์ดํด๋ณด๊ฒ ์ต๋๋ค. ์ฒจ๋ถํ ์ฌ์ง์ 3.8๋ฒ์ ๋ฌธ์์ด์ง๋ง ํ์ด์ฌ 2~~ ๋ฒ์ ๋ ์ ๊ณตํ๋ fuction์ ๋๋ค. any๋ iterable ๊ฐ์ฒด๋ฅผ ๋ฐ์ผ๋ฉฐ iterable์ element ์ค ํ๋๋ผ๋ true ๋ผ๋ฉด true๋ฅผ ๋ฐํํฉ๋๋ค. true๊ฐ ํ๋๋ ์๋ค๋ฉด false๋ฅผ ๋ฐํํฉ๋๋ค. ๋ง์ฝ iterable์ด empty์ฌ๋ false๋ฅผ ๋ฐํํฉ๋๋ค. (์ฐธ๊ณ ๋ก iterable์ ์๋ฏธ๋ element๋ฅผ ํ๋์ฉ ์ฐจ๋ก๋ก ๋ฐํ ๊ฐ๋ฅํ object๋ฅผ ๋งํ๋ฉฐ list, tuple, dictionary ๋ฑ์ด ์์ต๋๋ค.) [ ๊ฐ๋จ ์์ ] ๊ฐ๋จํ ์์ ๋ฅผ ์ดํด๋ณด๊ฒ ์ต๋๋ค. (์ถ์ฒ: www.w3schools.com/python/ref_func_any.asp) # List list ..

collections - Container datatypes ์์ ๋์ ๋๋ฆฌ ์๋ธํด๋์ค 3๊ฐ๋ฅผ ์ดํด๋ณด๊ฒ ์ต๋๋ค. ์ผ๋ฐ์ ์ธ ๋์ ๋๋ฆฌ๋ ๋ค๋ฅด๊ฒ ์กฐ๊ธ ํน๋ณํ ์ ์ด ์์ต๋๋ค. [1] defaultdict ๋์ ๋๋ฆฌ์์ ์กด์ฌํ์ง ์๋ ํค๋ฅผ ์กฐํํ ๊ฒฝ์ฐ KeyError exception์ด ๋ฉ๋๋ค. ํ์ง๋ง defaultdict์ ์กด์ฌํ์ง ์๋ ํค๋ฅผ ์กฐํํ๋ฉด ์๋ฌ๊ฐ ๋๋ ๊ฒ์ด ์๋๋ผ ์ค์ ํ ๋ํดํธ ๊ฐ์ ๊ธฐ์ค์ผ๋ก ํด๋น ํค์ ๋ํ ์์ดํ ์ ๋์ ๋๋ฆฌ์ ์ถ๊ฐํด์ค๋๋ค. defaultdict์ first argument๋ก default_factory ๋ฅผ ์ ๊ณตํด์ฃผ๋ฉด ๋ฉ๋๋ค. ๋ํดํธ๊ฐ์ 10์ด๋ผ๊ณ ํด์ค๊ฒ์! '๋ผ์ด์ธ' ์ด๋ผ๋ ํค๊ฐ์ด ์กด์ฌํ์ง ์์ง๋ง KeyError๋ ์๋๊ณ ๋ํดํธ ๊ฐ์ ๊ธฐ์ค์ผ๋ก ์์ดํ ์ ๋์ ๋๋ฆฌ์ ์ถ๊ฐํด์ฃผ๋ ๊ฒ์ ๋ณผ ์ ..
ํ์ด์ฌ์ string formatting์ ๋ค์ํ ๋ฐฉ์์ผ๋ก ์ง์ํด์์ต๋๋ค. 1) %-formatting name = 'Fred' age = 50 introduce = 'My name is %s, my age next year is %s' % (name, age+1) print(introduce) // ๊ฒฐ๊ณผ My name is Fred, my age next year is 51 2) str.format name = 'Fred' age = 50 introduce = 'My name is {}, my age next year is {}'.format(name, age+1) print(introduce) // ๊ฒฐ๊ณผ My name is Fred, my age next year is 51 3) string.Temp..
[1] List Comprehension PEP 202 - List Comprehensions PEP 202 -- List Comprehensions The official home of the Python Programming Language www.python.org List Comprehension์ ๊ธฐ์กด ๋ฆฌ์คํธ๋ฅผ ๊ธฐ๋ฐ์ผ๋ก ์๋ก์ด ๋ฆฌ์คํธ๋ฅผ ๋ง๋ค์ด๋ด๋ ๊ตฌ๋ฌธ์ ๋๋ค. ์๋ฅผ๋ค์ด leading and trailing whitespaces๋ฅผ ์ง์์ฃผ๋ strip์ ๋ฆฌ์คํธ์ ๋ชจ๋ ์์ดํ ์ ์ ์ฉํ๊ณ ์ถ๋ค๋ฉด ์ด๋ ๊ฒ ๋ฆฌ์คํธ ์ปดํ๋ฆฌํจ์ ์ ์ด์ฉํ ์ ์์ต๋๋ค. list = ["์ฃ ๋ฅด๋ ", " ๋ผ์ด์ธ "] new_list = [item.strip() for item in list] print(new_list) // ๊ฒฐ๊ณผ [..

[ ๋ชฉํ ] ์๋ก์ด ํ๋ก์ ํธ๋ฅผ ์์ํ๊ณ (๋ก์ปฌ ํ๋ก์ ํธ๋ฅผ ๋ง๋ค๊ณ ) ๊นํ์ ์ฌ๋ฆด ๋, 1. gitignore ํ์ผ์ ๋ง๋ค๊ธฐ 2. Adding an existing project to GitHub using the command line ๋ฌธ์๋ฐ๋ผ ๋ช ๋ น์ด ์ ๋ ฅํ๊ธฐ ํ๋๋ฐ ์ข ๊ท์ฐฎ์์ ์คํฌ๋ฆฝํธ๋ฅผ ๋ง๋ค์ด๋ด ๋๋ค. ์คํฌ๋ฆฝํธ๋ ๊นํ ์ฐ๋ํ ํ๋ก์ ํธ๊ฐ ์๋ ๋๋ ํ ๋ฆฌ๋ก ์ด๋ ํ & remote_url๊ณผ gitignore_url๋ฅผ ์ค์ ํด์ฃผ๊ณ & ์ด๊ฑธ๊ฐ์ง๊ณ gitignoreํ์ผ์ ๋ง๋ค๊ณ ๊นํ๊ด๋ จ ๋ช ๋ น์ด๋ค์ ์คํํด์ฃผ๋ ์์์ ๋๋ค. [1] move_to_local_project import os def move_to_local_project(): directory = input('ํ๋ก์ ํธ ๋๋ ํ ๋ฆฌ๋ฅผ ์ ๋ ฅํด์ฃผ์ธ์\n') os.ch..

[1] ๊ฐ๋ - ์ง์ค์ฝ๋ฉ (Geocoding) ์ฃผ์ (ex. '1600 Amphitheatre Parkway, Mountain View, CA') ๋ฅผ ์ง๋ฆฌ์ ์ขํ (์๋ 37.423021, ๊ฒฝ๋ -122.083739) ๋ก ๋ณํํ๋ ๊ฒ์ ๋งํฉ๋๋ค. - ์ญ์ง์ค์ฝ๋ฉ (Reverse geocoding) ์ง๋ฆฌ์ ์ขํ (์๋ 37.423021, ๊ฒฝ๋ -122.083739) ๋ฅผ ์ฌ๋์ด ์ฝ์ ์ ์๋ ์ฃผ์ (ex. '1600 Amphitheatre Parkway, Mountain View, CA') ๋ก ๋ณํํ๋ ๊ฒ์ ๋งํฉ๋๋ค. ์ ๋ reverse geocoding์ ํ ์คํธํด๋ณด๊ณ ์ถ์ด์ ๊ตฌ๊ธ๋งต api๋ฅผ ์ฌ์ฉํด๋ณด๊ฒ ์ต๋๋ค. [2] ๋ฌธ์๋ณด๊ธฐ ๊นํ์ ๋ค์ด๊ฐ์ ์ฌ์ฉ๋ฒ์ ๋ด์ค๋๋ค. github.com/googlemaps/googl..
ํ์ด์ฌ 3.5๋ถํฐ ํจ์ ํ๋ผ๋ฏธํฐ, ๋ฐํ๊ฐ์ ๋ํ ํ์ ์ ํ์ํ ์ ์๋ Type Hints๊ฐ ๋ค์ด๊ฐ์ต๋๋ค. (์ฐธ๊ณ : PEP 484 ) def get(name: str) -> str: return name print(get("jinny")) // ์ถ๋ ฅ jinny ๊ทธ๋ฆฌ๊ณ ํ์ด์ฌ 3.6์๋ ๋ณ์์ ๋ํด์๋ ํ์ ์ ํ์ํ ์ ์๊ฒ ๋์์ต๋๋ค. (์ฐธ๊ณ : PEP 526 ) name: str = "jinny" print(name) // ์ถ๋ ฅ jinny ํ์ง๋ง ์ฃผ์ํ ์ ์ Type Hint๋ ๋ง๊ทธ๋๋ ํ์ ํํธ์ด์ง ํ์ ๊ฐ์ ๊ฐ ์๋๋๋ค. ๊ทธ๋์ stringํ์ ์ int๊ฐ์ ๋ฃ์ด๋ ์๋ฌ๊ฐ ์๋๊ณ ์ ์คํ์ด ๋๋ ๊ฒ์ ๋ณผ ์ ์์ต๋๋ค. def get(name: str) -> str: return name print(get..
- Total
- 867,868
- Today
- 438
- Yesterday
- 1,696
- Flutter ๋ก๋ฉ
- github actions
- Sketch ๋๋ผ
- Flutter getter setter
- flutter deep link
- Watch App for iOS App vs Watch App
- ์ฅ๊ณ URL querystring
- Flutter Text Gradient
- flutter build mode
- ipad multitasking
- PencilKit
- ํ๋ฌํฐ ์ผ๋ฟ
- METAL
- ์ฅ๊ณ Custom Management Command
- ๊ตฌ๊ธ Geocoding API
- Python Type Hint
- Django Firebase Cloud Messaging
- Dart Factory
- cocoapod
- flutter dynamic link
- ribs
- flutter ์ฑ ์ถ์
- DRF APIException
- drf custom error
- Flutter Spacer
- Flutter Clipboard
- SerializerMethodField
- Django FCM
- ํ๋ฌํฐ ์ฑ๊ธํค
- Django Heroku Scheduler