Programming216 git force push local 로 remote 덮어쓰기 master branch에서는 하지 않기를 바란다 대부분 서브 브랜치에서 스쿼시 후에 많이 사용 $ git push -f 2020. 6. 18. time 명령어를 이용한 간단한 처리 시간 측정 time 명령어를 이용한 간단한 시간 측정 $ /usr/bin/time -p python test_1.py real 64.38 # 경과된 시간 user 63.65 # cpu가 커널함수 외 작업에 소비한 시간 sys 0.36 # 커널함수를 수행하는데 소비한 시간 좀 더 자세한 정보는 -lp 옵션을 사용한다 $ /usr/bin/time -lp python test_1.py real 64.20 user 63.71 sys 0.28 7098368 maximum resident set size 0 average shared memory size 0 average unshared data size 0 average unshared stack size 2444 page reclaims 40 page faults 0 s.. 2020. 6. 17. git stash - 작업 임시 저장 git stash 작업 중에 다른 브랜치로 체크아웃하거나 마스터를 리베이스할 경우에 사용하면 좋다 # without message > > > git stash > > > git stash save # git stash save > > > git stash save update tag > > > git stash list > > > stash@{0}: On branch\_name: update tag > > > stash@{1}: WIP on branch\_name: 49bf139 replace parenthesis # 0: git stash save update tag 결과 # 1: git stash # commit 한거, commit 안한거 모두 commit 안한거로 unstash > > > git s.. 2020. 6. 16. 파이썬 정규식(regular expression:regex) 사용 - 일부만 추출 파이썬에서 정규식 사용 정규식으로 찾고 일부만 추출하기 >>> import re >>> _str=" 65 0 0 -50 243 323 Tm\n asdfasdf" # 정규식에서 `()`로 싸여진 곳이 `group` >>> matches = re.finditer(r"^\d+ \d+ \d+ \-\d+ (\d+) \d+ Tm$",b,re.MULTILINE) >>> for match in matches: ... print(match.group()) ... group_num = len(match.groups()) ... print(match.group(group_num)) ... 65 0 0 -50 243 323 Tm 243 2020. 6. 15. python code reformatter black + pycharm python code reformatter black with pycharm $ pip install black $ which black /../pyenv/path/bin/black # 이거 복사 pycharm 실행 > Preference > Tools > External Tools > + 클릭 Name: black Program: /../pyenv/path/bin/black # 위에 복사한 것 Arguments: $FilePath$ Working directory: /../pyenv/path/bin # 복사한 것에서 /black 삭제 Preference > Tools > File Watchers > +버튼 > custom 클릭 Name: black File Type: python Scope: Proje.. 2020. 6. 13. 패키지, 모듈, import 에러 하나의 레포에서 여러 람다 프로젝트 사용하기 . ├── deploy.py ├── requirements-dev.txt ├── requirements.txt ├── lambda-service1 │ ├── __init__.py │ ├── Dockerfile │ ├── serverless.yml │ ├── package-lock.json │ ├── package.json │ └── handler.py ├── lambda-service2 │ ├── __init__.py │ ├── Dockerfile │ ├── serverless.yml │ ├── package-lock.json │ ├── package.json │ └── handler.py ├── tests │ ├── service1 │ │ ├── __init.. 2020. 6. 12. 이전 1 ··· 12 13 14 15 16 17 18 ··· 36 다음