병신 삽질 4시간??? ㅎㅎ
(1) 이런 방식으로 응용 가능
a = '김'
if a >= '가':
print("a 글자폭은 '가'보다 크거나 같다")
else:
print("a 글자폭은 '가'보다 작다")
(2) import unicodedata 활용
import unicodedata
kkk = unicodedata.east_asian_width('한')
kkk = unicodedata.east_asian_width('A')
kkk = unicodedata.east_asian_width('1')
print(kkk)
등의 출력값 확인하여 응용하면 됨.
(3) wcwidth.wcswidth("김영진")
이용해서 응용하면 될 듯.
이걸로 한글 개수 세고, 등등...
엑셀 열너비.
(1) 이거 사용해도 될 듯 (==> 한글 폭 반영은 안 되어 있으나, factor = 1.1 등등 적절히 조절해서 그냥저냥 쓰면 그냥저냥)
from UliPlot.XLSX import auto_adjust_xlsx_column_width
auto_adjust_xlsx_column_width
https://techoverflow.net/2021/03/05/how-to-auto-fit-pandas-pd-to_excel-xlsx-column-width/
How to auto-fit Pandas pd.to_excel() XLSX column width - TechOverflow
If you export XLSX data using df.to_excel(), the column widths in the spreadsheet are left as default and are not adjusted automatically: # Load example dataset df = pd.read_csv("https://datasets.techoverflow.net/timeseries-example.csv", parse_dates=["Time
techoverflow.net
(2) openpyxl 이용
ws.column_dimensions['A'].width
ws.row_dimensions[1].height
이 함수들 이용해서 직접 열너비 지정하면 됨.
유니코드 참고 : 이 양반들 고수인듯 ㅋ
파이썬 한글 포맷팅(폭/너비 지정 출력) - unicodedata 모듈의 east_asian_width() 활용
본 포스팅에서는 Python의 한글(2바이트) 문자열의 너비를 지정하는 str.format() 메소드 사용 방법을 알...
blog.naver.com
https://fhaktj8-18.tistory.com/entry/str-interval-setting
파이썬 한글과 영어 문자열 간격 예쁘게 맞추기 솔루션
한글과 영어를 명령 프롬프트에서 혼용해서 출력할 때, 한글은 영어와 달리 2byte 문자이기 때문에 글자 사이의 너비가 불균형하게 출력된다. 어떤 프로그램을 만들 때 사용자로부터 입력받은 입
fhaktj8-18.tistory.com
'개발자 놀이 > 병신 삽질 - HTML | CSS | Javascript | PHP |' 카테고리의 다른 글
[TotalCommander] 스마트폰에서 데스크탑 윈도우10 공유 폴더로 접속 (LAN plugin for Total Commander) (0) | 2023.03.17 |
---|---|
php에 js 파일 삽입 에러 - 500 Internal Server Error (0) | 2022.08.10 |