회원 로그인
|
Python console 컬러 출력
| console 컬러 출력
콘솔(Prompt)에서 텍스트를 컬러로 출력할 때 유용하다.
컬러표
참고)
http://www.burgaud.com/bring-colors-to-the-windows-console-with-python/
콘솔(Prompt)에서 텍스트를 컬러로 출력할 때 유용하다.
import ctypes STD_OUTPUT_HANDLE_ID_ = ctypes.c_ulong(0xfffffff5) ctypes.windll.Kernel32.GetStdHandle.restype = ctypes.c_ulong COLOR_PRINT_ = ctypes.windll.Kernel32.GetStdHandle(STD_OUTPUT_HANDLE_ID_) #출력 ctypes.windll.Kernel32.SetConsoleTextAttribute(COLOR_PRINT_, 5) print 'magenta' ctypes.windll.Kernel32.SetConsoleTextAttribute(COLOR_PRINT_, 11) print 'cyan' ctypes.windll.Kernel32.SetConsoleTextAttribute(COLOR_PRINT_, 7)실행
컬러표
번호 | 색상 | html 코드 |
0 | black | #000000 |
1 | blue | #0000a8 |
2 | dark green | #00a800 |
3 | n/a | #00a8a8 |
4 | red | #a80000 |
5 | magenta | #a800a8 |
6 | brown | #a8a800 |
7 | light grey | #a8a8a8 |
8 | dark grey | #545454 |
9 | n/a | #5454fc |
10 | green | #54fc54 |
11 | cyan | #54fcfc |
12 | n/a | #fc5454 |
13 | n/a | #fc54fc |
14 | yellow | #fcfc54 |
15 | white | #fcfcfc |
참고)
http://www.burgaud.com/bring-colors-to-the-windows-console-with-python/
- consolecolor.py (342B) (0)
댓글 0개
| 엮인글 0개
285개(11/15페이지)
번호 | 제목 | 글쓴이 | 조회 | 날짜 |
---|---|---|---|---|
85 | [C#] 생성자와 상속 base | 푸딩뱃살 | 3722 | 2014.11.21 02:09 |
84 | [C#] 클래스 상속 | 푸딩뱃살 | 3806 | 2014.11.17 23:35 |
83 | [C#] 클래스 예제 | 푸딩뱃살 | 3281 | 2014.11.03 23:03 |
82 | [C#] Main() 메소드 | 푸딩뱃살 | 3196 | 2014.11.02 23:43 |
81 | [C#] 인덱서 | 푸딩뱃살 | 2697 | 2014.11.01 01:09 |
80 | [C#] 속성 | 푸딩뱃살 | 2734 | 2014.11.01 00:41 |
79 | [C#] 생성자 | 푸딩뱃살 | 2845 | 2014.10.27 01:48 |
78 | [C#] public, private | 푸딩뱃살 | 3075 | 2014.10.25 22:32 |
77 | [C#] 오버로드(overload) | 푸딩뱃살 | 2663 | 2014.10.22 23:02 |
76 | [Python] 웹 파싱, 웹 클라이언트 프로그래밍 httplib | 푸딩뱃살 | 3461 | 2014.10.06 00:46 |
75 | [C#] 스코프(scope) | 푸딩뱃살 | 3272 | 2014.10.02 01:17 |
74 | [C#] 메소드 호출 | 푸딩뱃살 | 2714 | 2014.10.02 00:46 |
73 | [C#] 메소드(method) | 푸딩뱃살 | 3248 | 2014.10.02 00:30 |
72 | [C#] 필드(field) | 푸딩뱃살 | 3130 | 2014.10.02 00:06 |
71 | [C#] 객체(object)의 생성 | 푸딩뱃살 | 3604 | 2014.10.01 23:36 |
70 | [C#] 클래스(class)의 개념 | 푸딩뱃살 | 3511 | 2014.10.01 22:29 |
69 | [기본] 용어 - 클래스, 객체, 인스턴스, 메소드, 필드 | 푸딩뱃살 | 3948 | 2014.05.29 11:36 |
68 | [Python] Python 프로세스 리스트 추출 | 푸딩뱃살 | 8615 | 2014.05.20 16:02 |
67 | [Python] Python 환경 변수 설정 | 푸딩뱃살 | 4219 | 2014.05.20 12:46 |
>> | [Python] Python console 컬러 출력 | 푸딩뱃살 | 5191 | 2014.05.14 22:23 |