도피 시퀀스에서 문자 형식 변경
의 목적
컬러 출력에는 특수 문자
\033[93m
가 사용됩니다.그걸 다 외우기가 어려워서 통일된 코드를 썼어요.
저자는
alias colors='...'
와 .bash_profile
에 추기를 하면 불러낼 수 있다.컨디션
python
$ python
Python 3.6.4 |Anaconda custom (64-bit)| (default, Jan 16 2018, 12:04:33)
[GCC 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>
코드
color.py
#!/usr/bin/env python
for i in range(110):
print(f'\033[{i}m' + '{0:3d}'.format(i) + '\033[0m', end = ' ')
if str(i)[-1] == '9':
print('\n')
실행
종결어.
Reference
이 문제에 관하여(도피 시퀀스에서 문자 형식 변경), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/Scstechr/items/83b6e1998fc338252b18텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념 (Collection and Share based on the CC Protocol.)