<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>inarizuuuushi</author_name>
  <author_url>https://blog.hatena.ne.jp/inarizuuuushi/</author_url>
  <blog_title>Sabrou-mal サブロウ丸</blog_title>
  <blog_url>https://inarizuuuushi.hatenablog.com/</blog_url>
  <categories>
    <anon> python </anon>
  </categories>
  <description>プログラムのループ文の中で計算の途中結果を出力したいけど、 画面につらつらと出力されるのは鬱陶しいなー...という時に便利な、出力を上書きしていく方法です。 サンプルコード from time import sleep for i in range(10): print('\r', i, end='') sleep(1) '\r'は復帰、すなわち行の先頭に戻るという意味の特殊文字(エスケープシーケンス)です。 '\r'で行の先頭に戻ってiを出力します。その時に改行されないようにend=''を指定してやります。 上記のプログラムではiの出力の前に空白ができてしまうので、これがイヤな人は、 pri…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Finarizuuuushi.hatenablog.com%2Fentry%2F2016%2F12%2F29%2F144734&quot; title=&quot;Python 出力の上書き - Sabrou-mal サブロウ丸&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></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2016-12-29 14:47:34</published>
  <title>Python 出力の上書き</title>
  <type>rich</type>
  <url>https://inarizuuuushi.hatenablog.com/entry/2016/12/29/144734</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
