This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ppt = Presentation('filename.pptx') | |
| title = ppt.slides[0].shapes.title | |
| title.text = title.text.replace("before","after") | |
| ppt.save('filename.pptx') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ppt = Presentation('filename.pptx') # PPT File Load | |
| title = ppt.slides[0].shapes.title # 첫번째 슬라이드의 Title을 title 변수에 획득 | |
| title.text = title.text.replace("before","after") # 특정 텍스트 변경 | |
| title.text_frame.parhagraphs[0].font.name = 'Arial' # 사용할 폰트 이름 지정 | |
| title.text_frame.parhagraphs[0].font.size = Pt(16) # Range가 100부터 40만인가 그렇습니다. | |
| # 하지만 from pptx.util import Pt 를 하신 뒤 Pt를 쓰시면 저렇게 폰트크기 입력이 가능합니다. | |
| # title.text_frame.paragraphs[0].font.size 입력하면 해당 숫자가 나타납니다. | |
| # Pt크기를 보시려면 title.text_frame.paragraphs[0].font.size.Pt 하시면 Pt크기를 볼 수 있습니다. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 우분투 업데이트 | |
| ================= | |
| sudo apt update -y | |
| 도커 공식 홈페이지 저장소 추가 | |
| ============================ | |
| sudo apt-add-repository 'deb https://apt.dockerproject.org/repo ubuntu-xenial main' | |
| 도커 GPG Key 추가 | |
| ================ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo apt-add-repository 'deb https://apt.dockerproject.org/repo ubuntu-xenial main' # Docker Repo 추가 | |
| sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 5811E89F3A912897C070ADBF76221572C52609D # GPG Key 추가 | |
| sudo apt update -y # 저장소 업데이트 및 다운로드 | |
| sudo apt install docker-engine -y # Docker 설치 | |
| sudo docker --version # Docker Version 확인 | |
| sudo systemctl docker status # Docker 상태 확인 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 5811E89F3A912897C070ADBF76221572C52609D |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import glob | |
| import os, random, struct | |
| from Crypto.Cipher import AES | |
| def encrypt_file(key, in_filename, out_filename=None, chunksize=64*1024): | |
| """ Encrypts a file using AES (CBC mode) with the | |
| given key. | |
| key: | |
| The encryption key - a string that must be | |
| either 16, 24 or 32 bytes long. Longer keys |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import glob | |
| import os, random, struct | |
| from Cryptodome.Cipher import AES | |
| def encrypt_file(key, in_filename, out_filename=None, chunksize=64*1024): | |
| if not out_filename: | |
| out_filename = in_filename + '.yankee' # out_filename 인자를 지정안할 경우 기존 파일명을 사용하여 .yank 라는 확장명 추가 | |
| iv = os.urandom(16) # 랜덤한 16자리의 Byte값을 생성 | |
| encryptor = AES.new(key ,AES.MODE_CBC, iv) # cryptodomex 모듈의 AES를 이용해서 암호화 키를 생성 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Form Input tag example | |
| # forms.py | |
| class TestForm(forms.modelsForm): | |
| nametest = forms.Charfield(required=False, widget=forms.TextInput(attrs={ | |
| 'name':'on_change', | |
| 'id':'test', | |
| 'class':'class', | |
| 'type':'radio', | |
| }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # views.py | |
| from django.views.generic.base import TemplateView | |
| class Test(TemplateView): | |
| template_name = 'yankee/result.html' | |
| def get_context_data(self, **kwargs): | |
| context = super().get_context_data(**kwargs) | |
| context['form'] = TestForm |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!-- 아래와 같은 폼 뷰를 사용할 경우 --> | |
| {{ form.nametest }} | |
| <!-- 결과 물 --> | |
| <input type='radio' name='nametest' id='test' class='class'/> |