<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>sucrose</author_name>
  <author_url>https://blog.hatena.ne.jp/sucrose/</author_url>
  <blog_title>唯物是真 @Scaled_Wurm</blog_title>
  <blog_url>https://sucrose.hatenablog.com/</blog_url>
  <categories>
    <anon>python</anon>
  </categories>
  <description>以下のように'-i'を指定するだけでできるみたいです。 こんな簡単なのを知らなかったとは……やはりドキュメントはちゃんと読まないといけませんね。 python -i ファイル名あるいは対話モードの時にexecfile関数を実行すれば同様のことができるみたいです。最後ではなく、スクリプトの途中で対話的に実行したい場合にはcodeモジュールを使えば以下のように書けるみたいです。 インタプリタはCtrl+ZとかCtrl+Dとか(OSによる？)の対話的なインタプリタを通常止めるときのキーを打てば止まります。 exit()をするとあとの処理をせずに終了してしまいますので注意。 import code 何…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fsucrose.hatenablog.com%2Fentry%2F2013%2F05%2F12%2F171105&quot; title=&quot;Pythonスクリプト実行後に対話的に操作したい - 唯物是真 @Scaled_Wurm&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>2013-05-12 17:11:05</published>
  <title>Pythonスクリプト実行後に対話的に操作したい</title>
  <type>rich</type>
  <url>https://sucrose.hatenablog.com/entry/2013/05/12/171105</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
