파이썬 모듈 사용방법1 [확고의 쓱~ 훑어보는 기록] Python - 모듈 예제(2) (다른 패키지에 있는 모듈 import 방법 / math 모듈 / datetime 모듈) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 #-*- coding:utf-8 ''' Created on 2022. 4. 6. @author: hwakgo ''' # myPkg 이름의 패키지 안에 Ex01.py 모듈에서 작업(myPkg\Ex01.py) def hap(a,b): return a+b def sub(a,b): return a-b Colored by Color Scripter cs 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 #-*- coding:utf-8 ''' Created on 2022. 4. 6. @author: hwakgo ''' #Ex03.py 모듈에서 작업 print(sum([10,20,30])) #sum(10,2.. 2022. 8. 1. 이전 1 다음 728x90 반응형