Pythonのお勉強 Part22 at TECH
[2ch|▼Menu]
867:methane
08/01/14 19:27:05
>>866
それはdocutilsの中でeast_asian_width()の結果をどう扱ってるかって話。
日本限定で使う分にはこんな感じで良いと思う。
def char_width(s):
  if type(s) == 'str': s = unicode(s)
  return 2 if east_asian_width(s) in 'WFA' else 1


次ページ
続きを表示
1を表示
最新レス表示
スレッドの検索
類似スレ一覧
話題のニュース
おまかせリスト
▼オプションを表示
暇つぶし2ch

5397日前に更新/217 KB
担当:undef