2020/10 8

python local repository 구성

1. 필요한 것들 설치 yum install pip pip install pypiserver pip install passlib 2. server용 계정 설정 및 추가 cd /home/python-local-repo htpasswd -sc htpasswd.txt local-repo 3. 서버 시작 pypi-server -p {PORT} -P htpasswd.txt /home/python-local-repo & 4. pypi관련 설정 추가 vim ~/.pypirc [distutils] index-servers = local [local] repository: http://127.0.0.1:PORT/ username: local-repo password: local-repo 6. 원격 서버에서 확인 pip ..

yum local repository

yum local repository 생성 1. repo 설치 및 설정 생성 및 설정을 위한 패키지 설치 yum install createrepo yum-utils패키지 정보를 저장할 디렉토리 생성 mkdir -p /home/www/html/repos/{base, centosplus, extras, updates, python35}local repository 와 centos yum repository 동기화 reposync -g -l -d -m --repoid=base --newest-only --download-metadata --download_path=/home/www/html/repos reposync -g -l -d -m --repoid=centosplus --newest-only --down..

dictionary

1딕셔너리에서 원하지 않는 값을 안전하게 지워보자 순회문 도중에 pop 남발하기 pop은 정확하게는 지우는 것이 아니라, 지정한 key의 value만(!) 던져주고 딕셔너리에서는 지워버립니다. test_dict_01 = dict() test_dict_01['a'] = 1 test_dict_01['b'] = '' test_dict_01['c'] = None for k, v in test_dict.items(): if v == None: test_dict.pop(k) 위와 같이 순회문 도중에 pop으로 지우면 갑분 에러를 만나게 됩니다. Traceback (most recent call last): File "test.py", line 6, in for k, v in test_dict.items(): Run..