일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- humble 환경설정
- nav2 dev contatiner
- CodeUp
- Python
- ros2 configuring environment
- setting up transformations
- nav2 tutorial
- foxy nav2
- Foxy tutorial
- ros2 remapping
- nav2 first-time robot setup guide
- ROS FOXY 튜토리얼
- Nav2 document
- nav2 getting started
- ros2 환경설정
- ros2 foxy docker
- 코드업
- humble development guides
- nav2 튜토리얼
- nav2 development guides
- ros2 foxy tutorial
- ros2 튜토리얼 환경설정
- ros2 development guides
- error
- nav2 설치
- first-time robot setup guide
- ros2 튜토리얼
- ros2 transformations 개념
- CODEUP 6073
- docker foxy
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