9
我想使用IRB來運行腳本,然後給我一個交互式提示。我在Python中使用python -i xy.py
執行此操作,但在執行後退出irb xy.rb
。Python的IRB模擬-i
> python --help
-i When a script is passed as first argument or the -c option is
used, enter interactive mode after executing the script or the
command
請記住,使用'-r'或'require`不會讓您訪問腳本的局部變量,即使它們是在頂層執行環境中定義的。 – Kelvin 2013-01-29 16:44:57