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 ดูใบอนุญาตสำหรับรายละเอียด