일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- nav2 tutorial
- ros2 튜토리얼 환경설정
- nav2 getting started
- ros2 튜토리얼
- CODEUP 6073
- foxy nav2
- ros2 환경설정
- humble development guides
- first-time robot setup guide
- Foxy tutorial
- ros2 development guides
- docker foxy
- CodeUp
- setting up transformations
- humble 환경설정
- ros2 remapping
- ros2 foxy tutorial
- nav2 dev contatiner
- ros2 transformations 개념
- Python
- nav2 first-time robot setup guide
- ros2 foxy docker
- error
- ros2 configuring environment
- nav2 튜토리얼
- ROS FOXY 튜토리얼
- nav2 설치
- nav2 development guides
- Nav2 document
- 코드업
Archives
- Today
- Total
BAN2ARU
[Python] Vars( ) 함수 본문
반응형
Vars([object])란?
python의 기본 내장함수로서 모듈, 클래스, 클래스 인스턴스 객체(__dict__속성을 가지는 객체)에 대해 __dict__ (dictionary 형태)로 return해 주는 함수임.
만약 [object]를 선언하지 않으면 locals()처럼 동작되어 현재 지역 변수에 대해 __dict__(dictionary 형태)로 return함.
Vars 함수 예제
class SellList:
snack = 1000
ice_cream = 700
coke = 1200
candy = 1500
print(vars(SellList))
# 출력 화면
{'__module__': '__main__', 'snack': 1000, 'ice_cream': 700, 'coke': 1200, 'candy': 1500, '__dict__': <attribute '__dict__' of 'SellList' objects>, '__weakref__': <attribute '__weakref__' of 'SellList' objects>, '__doc__': None}
728x90
'Language > Python' 카테고리의 다른 글
Comments