본문 바로가기

programming

(11)
Python 패키지 폐쇄망 설치 # 외부 통신되는 망 서버가 있을 경우 1. 사용하는 python 버전의 라이브러리 리스트화 $ python -m pip freeze > reuirements.txt 2. reuirements.txt 리스트에 있는 패키지를 특정 디렉터리에 다운로드 $ mkdir test && cd test $ python -m pip download -r requirements.txt 3. 생성된 파일과 requirements.txt 파일을 폐쇄망 서버로 이동 4. pip 를 통해 오프라인 환경에서 라이브러리 설치 $ python -m pip install --no-index --find-links="./" -r reuirements.txt ## whl 설치
Perl to Python 보호되어 있는 글입니다.
[django] 테이블 삭제 후 재생성 안될 때 울고 싶어도 꾹 참고 아래를 따라한다.. 나의 잘못) (1) models.py 로 수정 반영을 기대하였으나 반영 되지 않았다. (2) db에 직접 들어가 문제가 있는 테이블을 지우고 재생성을 하고자 했다 #sqlite3 db.sqlite3 > drop table [test] (3) models.py 에 재작성 하고 마이그레이션 하였으나 인식되지 않음.. 1. migration 파일 삭제해 보기 - 일반적인 migration 파일의 경로 -> ~/[app]/migrations/0001_initial.py migration의 0001~ 0002~ 숫자로 시작하는 파일을 모두 지운다 (지워도 서비스 이상 없음) # rm -rf blog/migrations/00* 다시 마이그레이션 시도 # python mana..
json load/loads/dump/dumps 함수 함수 사용 예 json.load json 문자열을 python 객체로 변환 파일을 읽을 때 with open('test.json') as json_file: json_data = json.load(json_file) json.loads 문자열을 읽을 때(dict 이 아닌 문자열임 주의) with open('test.json') as json_file: contents = json_file.read() json_data = json.loads(contents) json.dump python 객체를 json 문자열로 변환 파이선 객체 -> 스트림 객체(파일) with open('test.json', 'w') as outfile: json.dump(all_messages, outfile, indent=2, c..
코인 시세 분석하기 - 1. upbit api 연동 1. 업비트 api 키 받키 https://upbit.com/mypage/open_api_management 본인이 받을 정보를 선택하고 카카오 인증을 하면 access key 와 secret key 가 발급된다. 2. 시세 정보를 불러오는 python 스크립트 작성 import hashlib import time from urllib.parse import urlencode import jwt import requests import uuid ACCESS_KEY = ' 입력 ' SECRET_KEY = ' 입력 ' def getTradePrice(market): url = "https://api.upbit.com/v1/candles/days" querystring = {"market": market, "..
파이썬 정규표현식 문자열 추출 https://greeksharifa.github.io/%EC%A0%95%EA%B7%9C%ED%91%9C%ED%98%84%EC%8B%9D(re)/2018/08/05/regex-usage-06-advanced/ Python, Machine & Deep Learning Python, Machine Learning & Deep Learning greeksharifa.github.io
파이썬 비정형 데이터 파싱 wikidocs.net/book/4521
파이썬 독학하기 좋은 위키독스 모음집 위키독스 만세! 점프 투 파이썬 : https://wikidocs.net/book/1위키독스온라인 책을 제작 공유하는 플랫폼 서비스wikidocs.net초보자를 위한 파이썬 예제 300제 : https://wikidocs.net/book/922위키독스온라인 책을 제작 공유하는 플랫폼 서비스wikidocs.net 파이썬으로 배우는 알고리즘 트레이딩 : wikidocs.net/5757 점프 투 장고 : https://wikidocs.net/book/4223위키독스온라인 책을 제작 공유하는 플랫폼 서비스wikidocs.net위키는 아니지만 장고걸즈 튜토리얼 : https://tutorial.djangogirls.org/ko/