impauto
Impauto
Vous faciliter la vie avec les entrées automatisées
pip install impautoLa façon de base d'utiliser ce module
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 ))Vous pouvez également masquer les messages d'entrée du terminal
from impauto import Automated
# Each argument passed will be enter as a str to the input function.
Automated ( 1 , 2 , 3 , show_message = False )Par défaut, il augmentera une exception s'il y a plus d'entrée que de valeur donnée. Pour faire des répétitions d'entrée indéfiniment, vous pouvez utiliser ce code
from impauto import Automated
# Each argument passed will be enter as a str to the input function.
Automated ( "a" , "b" , forever = True )© 2020 Copyright Edhyjox
Ce référentiel est concédé sous licence MIT. Voir la licence pour plus de détails.