在交互式python中,有一个'continuation variable',下划线.
>>> import netlib
>>> netdev = netlib.netface('eth1')
>>> if netdev.getIP():
... print _
...
10.80.22.100
>>>
Run Code Online (Sandbox Code Playgroud)
但是在脚本中使用它,它是未定义的,因此失败:
if netdev.getIP(): SetValue('ipaddress', _)
Run Code Online (Sandbox Code Playgroud)
是否有类似的东西或方法为脚本启用此功能?