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許可證獲得許可的。有關詳細信息,請參見許可證。