파이썬은모듈을불러올때.pyc라는확장자를가지는바이트컴파일된파일을가져와모듈을불러온다 추가import 모듈 from 모듈import 변수나함수 ex) import math 모듈 예제 이동 project -- test +-- sub1 -- __init__.py -- aa.py -- bb.py +-- sub2 -- __init__.py -- cc.py -- dd.py -- ee.py -- ff.py -- __init__.py -- gg.py ee.py에서 다른 모듈 참조(하위 폴더 내 파일, 동일 폴더 내 파일 참조)# aa.py를 참조할 경우 from sub1 import aa # ff.py를 참조할 경우 import ff # 또는 from . import ff # from . 은 동일폴더라는 의미를 나타냄. ..
Date & Time 모듈 import time,calendar 시간 time time.time() # 1970년 1월 1일 0시 0분 0초를 기준으로 지난 시간을 초 단위로 리턴 >>>1531787593.243607 time.localtime() >>>time.struct_time(tm_year=2018, tm_mon=7, tm_mday=17, tm_hour=9, tm_min=33, tm_sec=26, tm_wday=1, tm_yday=198, tm_isdst=0) time.strftime('%H - %M', time.localtime(time.time())) # time.strftime('출력할 형식 포맷', time.localtime(time.time())) >>>'09 - 36' strftime의..
파이썬에는 사전 (Dictionary)라는 특이한 자료형이 있다. 간단히 하면 키과 값으로 이루어진 list이다. (JAVA의 Map 같은?) {Key1:Value1, Key2:Value2, Key3:Value3 ...} 예를들어 smalldic = {'dictionary' : 'reference', 'python' : 'snake'} # python의 key 값에 들어있는 value 확인 >>> smalldic['python'] || smalldic.get('python') 'snake' # python의 key가 있는지 확인 'python' in smalldic True # True False로 나온다 #원소삭제 del smalldic['python'] # value로 key값 찾기 >for ke, ..
파이썬은 설명(Documentation) 문자열(String) 이라고 불리우는, 짧게 줄여서 DocStrings라 불리우는 편리한 기능을 가지고 있습니다. DocString은 만든 프로그램을 알아보기 쉽게 해 주고, 또 후에 프로그램에 대한 설명서를 작성할 때 유용하게 사용될 수 있다. 아래 예제와 같이, DocString은 프로그램이 실행중일 때도 읽어올 수 있다. def print_max(x, y): '''Prints the maximum of two numbers. The two values must be integers. ''' # convert to integers, if possible x = int(x) y = int(y) if x > y: print (x, 'is maximum') else..
mac % linux는 기본 파이썬 2.7이 설치되있지만 공홈에서 설치가능 맥 OSX에서 Python 3.5 이상 버전 설치 후 IDLE 실행하면, tcl/tk 오류 해결 방법 WARNING: The version of Tcl/Tk (8.5.9) in use may be unstable. Visit http://www.python.org/download/mac/tcltk/ for current information. => Archinve 페이지에서 8.5.18 버전을 다운로드 받아 설치하시면 문제가 해결 됩니다. 파이썬이 설치되면 IDLE로 파이썬 실행가능 추가 vscode에서 사용시 E1101:125:get_user_tags: Class 'Tag' has no 'objects' member 이러한 li..
- Total
- Today
- Yesterday
- Angular
- https://www.tistory.com/auth/logout/
- Router
- localStorage
- python3
- mobx
- 페이스북 로그인
- JPA
- Java
- 파이썬
- data component
- facebook login
- jQuery
- MySQL
- data gird component
- 파이썬3
- angular router
- Spring
- Spring Boot
- JavaScript
- CSS
- data component module
- react
- data table component
- React-router
- Python
- Redux
- data grid component
- JSON
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 | 31 |