impauto
Impauto
通过自动输入使您的生活更轻松
pip install impauto使用此模块的基本方法
from impauto import Automated
# Each argument passed will be enter as a str to the input function.
Automated ( 154 )
# use your script as normal
def syracuse ( x ):
step = 0
while x != 1 :
x = ( 3 * x + 1 ) if x % 2 else ( x // 2 )
step += 1
return step
n = int ( input ( "Enter a number: " ))
print ( syracuse ( n ))您也可以隐藏终端输入消息
from impauto import Automated
# Each argument passed will be enter as a str to the input function.
Automated ( 1 , 2 , 3 , show_message = False )默认情况下,如果输入多于给出的值,它将引起异常。要无限期重复输入,您可以使用此代码
from impauto import Automated
# Each argument passed will be enter as a str to the input function.
Automated ( "a" , "b" , forever = True )©2020版权Edhyjox
该存储库是根据MIT许可证获得许可的。有关详细信息,请参见许可证。