<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>gsf_zero1</author_name>
  <author_url>https://blog.hatena.ne.jp/gsf_zero1/</author_url>
  <blog_title>いろいろ備忘録日記</blog_title>
  <blog_url>https://devlights.hatenablog.com/</blog_url>
  <categories>
    <anon>python</anon>
  </categories>
  <description>スクリプト書いていると、等幅フォント上で全角半角混じった文字列をピシッと 揃えたいときがよくあります。pythonのlen()は文字数を返すので、それでイケルと思ってしまいますが s = 'hello' len(s) 5 # OK s = 'こんにちわ' len(s) 5 # (´・ω・`) max_width = max(len(s) for s in ['hello world', 'こんにちわ世界', 'ABCDE']) print(max_width) 11 for x in ['hello world', 'こんにちわ世界', 'ABCDE']: print(f'{x}{&quot; &quot; * …</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fdevlights.hatenablog.com%2Fentry%2F2017%2F03%2F18%2F180549&quot; title=&quot;Pythonメモ-00 (マルチバイトを考慮した文字幅を取得)(unicodedata, east_asian_width, multibytes, WF) - いろいろ備忘録日記&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url>https://cdn-ak.f.st-hatena.com/images/fotolife/g/gsf_zero1/20170318/20170318180328.png</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2017-03-18 18:05:49</published>
  <title>Pythonメモ-00 (マルチバイトを考慮した文字幅を取得)(unicodedata, east_asian_width, multibytes, WF)</title>
  <type>rich</type>
  <url>https://devlights.hatenablog.com/entry/2017/03/18/180549</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
