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