Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- centOS7
- pagination
- php
- laravel
- ubuntu
- NGINX
- vue
- docker-compose
- ruby
- working directory
- Git
- Ruby On Rails
- imagemagick
- staging area
- MySQL
- Wordpress
- react
- javascript
- cron
- docker
- codeigniter4
- controller
- Python
- props
- AWS
- ec2
- Selenium
- linux
- SQL
- dockerfile
Archives
- Today
- Total
목록getattr (1)
내가 한 노력들
[ Python ] 변수에 따른 함수를 실행시키고 싶은 경우 (getattr)
getattr( object, attribute name ) class Graph: @staticmethod def barGraph(x, y): print('x축의 값이 {}이고 y축의 값이 {}인 bar 그래프.'.format(x, y)) @staticmethod def pieGraph(x, y): print('x축의 값이 {}이고 y축의 값이 {}인 pie 그래프.'.format(x, y)) @staticmethod def scatterGraph(x, y): print('x축의 값이 {}이고 y축의 값이 {}인 scatter 그래프.'.format(x, y)) arr = ['bar', 'pie', 'scatter'] for graph in arr : getattr(Graph, graph + 'Grap..
IT 공부/python
2022. 2. 28. 15:45