influxdb time format(rfc3339) to datetime
print (in_time) # 2019-09-27T01:57:07.679779126Z in_time = in_time.replace('Z','') in_time = in_time.split(".") microsec = in_time[1][0:6] in_time = in_time[0] + '.' + microsec in_date = datetime.strptime(in_time, "%Y-%m-%dT%H:%M:%S.%f") print (in_date) # 2019-09-27 01:57:07.679779influxdb time 값을 불러오다 보면 위와 같은 time값을 받는 경우가 많다. datetime.strptime 에서 microsecond (%f) 는 6자리..
Programming/Python
2019. 9. 27. 19:27
Python 인자값(Arguments Value) 예외처리하기
운영체제 : Ubuntu 18.04 개발 도구 : vscode 사용 언어 : Python 3.7 실행 예시 sample.py -hotpix [숫자] try: if sys.argv[1] == '-hotpix': cnt = 100 #핫픽셀 분석모드 try: cnt = int(sys.argv[2]) hotpix(cnt) except IndexError: hotpix(cnt) else: print('함수 인자 에러.') except IndexError: #셀 분석 cellcnt_start()
Programming/Python
2019. 9. 23. 16:47
Notice
Recently Posted
TAG
- Peverse Proxy
- Python
- autossh
- FlightAware
- rfc3339
- Raspberry Pi
- nginx
- 인자값
- vue.js
- datetime
- influxdb
- 예외처리
- ADS-B
- letsencrypt
Posts by Date