본문 바로가기

Python3

django bootstrap 적용 django project를 생성한 후에 app을 하나 생성합니다.(저는 project의 이름을 portfolio, app의 이름을 main이라고 지었습니다.) project폴더안에 static이라는 폴더를 생성한 뒤 settings.py의 마지막부분을 다음과 같이 수정합니다. STATIC_URL = '/static/' STATICFILES_DIRS = ( os.path.join(BASE_DIR, 'static'), ) (STATICFILES_DIRS 안에 콤마를 붙이지 않으면 ERRORS: ?: (staticfiles.E001) The STATICFILES_DIRS setting is not a tuple or list. HINT: Perhaps you forgot a trailing comma? 이런.. 2019. 8. 14.
Python Thread python에서 쓰레드를 사용해본적이 없어서 예제를 만들어서 해봤습니다. 각 쓰레드마다 출력과 sleep을 반복하여 쓰레드들이 잘 동작하는지 테스트하는 예제입니다. import threading import time import random class Thread_controll(threading.Thread): def __init__(self, name, finish_n): threading.Thread.__init__(self) self.name = name self.finish_n = finish_n def run(self): for i in range(self.finish_n): print(self.name,' :', i) time.sleep(random.random()) def rand(str_.. 2019. 8. 9.
[androguard]code_item 추출하기 androguard를 이용하여 code_item 을 추출하여 txt파일로 저장 dex, data section, code_item의 구조 from androguard.core.bytecodes.apk import APK from androguard.core.bytecodes.dvm import DalvikVMFormat from androguard.core.bytecodes.dvm import ClassDefItem a = APK("C:/Users/jysrm/OneDrive/바탕 화면/study/test.apk") f = open("new.txt", 'w') d = DalvikVMFormat(a) code_item = d.get_codes_item() code = code_item.show() f.wri.. 2019. 5. 14.