일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | |||||
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
31 |
- Apache
- array
- 파이썬
- gas
- Kotlin
- Redshift
- dataframe
- PySpark
- Python
- Tkinter
- SQL
- Google Excel
- math
- list
- google apps script
- django
- Github
- string
- numpy
- PANDAS
- Java
- Excel
- Google Spreadsheet
- Mac
- matplotlib
- PostgreSQL
- GIT
- hive
- c#
- Today
- Total
목록Python (384)
달나라 노트

Python에서는 굉장히 간단하게 URL을 QR Code로 전환시켜주는 library가 있습니다. 이것을 한번 알아보죠. pip install qrcode 먼저 qrcode library를 설치해줍시다. import qrcode url = 'https://www.google.com' qr_img = qrcode.make(url) qr_img.save(stream='qr_code.png') 위 코드를 실행하면 qr_code.png라는 이미지 파일이 생성되며 그 파일은 아래와 같습니다. QR Code를 카메라로 비추면 www.google.com으로 이동됩니다. 굉장히 간단하죠? pip install pyqrcode 이번에는 pyqrcode라는 library를 이용해봅시다. pip install pypng 이..
Python에서는 변수에 숫자나 글자같은 단순한 값 뿐 아니라 여러 값들을 묶어놓은 묶음(collection)을 할당할 수 있습니다. Python에 있는 묶음 데이터(collection)들은 어떤 것이 있으며 각각의 특성이 무엇인지 알아봅시다. 1. list temp_list = [1, 1, 2, 'a', 'bb', '1a2b3c'] temp_list_2 = ['apple'] 가장 먼저 list입니다. 가장 많이 쓰이는 형태입니다. list는 위처럼 대괄호[]로 묶어서 변수에 할당할 수 있습니다. 대괄호 안에는 각각의 요소들이 콤마의 형태로 구분지어져 있습니다. (요소란 collection 안에 있는 하나하나의 구성품들을 의미합니다.) temp_list_2에서 보이는 것 처럼 list 속 요소는 1개일수..
Python에 있는 phonenumbers library는 입력한 핸드폰 번호의 간단한 정보를 알려줍니다. 바로 코드를 봅시다. import phonenumbers from phonenumbers import carrier, geocoder, timezone mobile_phone_number = '+821012345678' mobile_phone_number = phonenumbers.parse(mobile_phone_number) print('Time zone of the number ->', timezone.time_zones_for_number(mobile_phone_number)) print('Country of the number ->', geocoder.description_for_numbe..

회원가입을 할 때 보면 정보를 다 입력하고 마지막 부분에 이상하게 생긴 문자들을 입력하라고 하는것이 보통입니다. 위 이미지처럼요. 위와같은 것을 주로 Captcha라고 하는데 이번에는 Python으로 위 이미지처럼 특정 문자를 captcha로 만들어보겠습니다. pip install captcha 먼저 captcha library를 설치해줍니다. from captcha.image import ImageCaptcha image = ImageCaptcha(width=160, height=90) txt_captcha = '3ck8Bei' image.generate(txt_captcha) image.write(txt_captcha, 'captcha_result.png') 위 코드를 실행해보면 아래처럼 내가 원하는..