전체 글
-
-
-
효과적인 파이썬식 코딩 3) Class와 InterfaceAI/중고급 파이썬 2021. 10. 22. 22:20
** 먼저 / class에서 그냥 정의된 변수는 class 변수 , class에서 self가 붙은채로 정의된 변수는 인스턴스 변수 https://wikidocs.net/1744 파이썬에서 메서드는 크게 인스턴스 메서드(instance method), 정적 메서드(static method), 클래스 메서드(class method) 1) 가장 많이 쓰이는 인스턴스 메서드는 메소드의 첫번째 파라미터에 항상 객체 자신을 의미하는 self 사용 2) 정적 메서드는 self 파라미터를 갖지 않고, 인스턴스에 접근할 수도 없다 3) class method는 정적 메서드와 유사하지만 self 대신에 cls라는 클래스를 의미하는 파라미터를 전달받아 cls 파라미터를 통해 클래스 변수 등에 엑세스할 수 있게 된다 -> 정..
-
효과적인 파이썬식 코딩 2) comprehension과 generator카테고리 없음 2021. 10. 22. 22:19
Comprehension이란 iterable한 오브젝트를 생성하기 위한 방법중 하나로 파이썬에서 사용할 수 있는 유용한 기능중 하나이다. 파이썬에는 다음과 같은 크게 네 가지 종류의 Comprehension이 있다. List Comprehension (LC) Set Comprehension (SC) Dict Comprehension (DC) Generator Expression (GE) Generator의 경우 comprehension과 형태는 동일하지만 특별히 expression이라고 부른다. 1) List Comprehension 2) Set Comprehension 3) Dict Comprehension 4) Generator Expression Generator expression은 특별한 형태의..
-
-
시스템 프로그래밍 실습 9주차 : System V IPCSystem Programming/Ubuntu Linux 2021. 10. 22. 20:44
시스템 프로그래밍 실습 9주차 : System V IPC [목차] - System V IPC interface - Message Queue - Shared Memory System V IPC interface 시스템 V IPC - 시스템 V 계열 유닉스에서 개발해 제공하는 프로세스 간 통신방법 - 메시지 큐, 공유 메모리, 세마포어 공통 요소 - 시스템 V IPC를 사용하기 위해서는 IPC 객체를 생성해야 함 - IPC 객체를 생성하기 위해 공통적으로 사용하는 기본 요소는 키와 식별자 => IPC 객체를 생성하면 다음과 같은 IPC 공통 구조체가 정의된다 - ftok() : 키 생성 함수! #include #include key_t ftok(const char *pathname, int proj_id);..
-
효과적인 파이썬식 코딩 공부 방향 및 참고할 사이트AI/중고급 파이썬 2021. 10. 22. 20:21
참고할 목차! 파이썬 코딩의 기술 https://hcnoh.github.io/2018-09-09-effective-python-way01 [Effective Python] WAY 1. 사용중인 파이썬의 버전을 알자 앞으로 스터디에서 다를 예제들의 파이썬 버전은 파이썬 3.4가 될 것이다. 또한 파이썬 2.7과의 비교를 위한 예제들 역시 제공될 것이다. hcnoh.github.io https://dojang.io/mod/page/view.php?id=2359 파이썬 코딩 도장: 32.1 람다 표현식으로 함수 만들기 Unit 32. 람다 표현식 사용하기 지금까지 def로 함수를 정의해서 사용했습니다. 이번에는 람다 표현식으로 익명 함수를 만드는 방법을 알아보겠습니다. 람다 표현식은 식 형태로 되어 있다고 해..