IO Functions

A IO Function is a reusable function designed to perform a specific task or operation related to IO.

1. Data Input

input_async(prompt: str)

Enables asynchronous input collection from the user.

Parameters:

  • prompt (str): An optional message to display to the user, describing the type of input expected.

Returns:

  • A str representing the user’s input.

Example


user_input = await input_async("Enter your name: ")
print(f"Your name is {user_input}")
Run

2. Notification

notification(message: str)

Show a notification to the user.

Parameters:

  • message (str): The notification text to display.

Example


user_input = await input_async("Enter your name: ")
notification(f"Your name is {user_input}")
Run

3. Progress Bar

progress(value: str)

Show a progress bar.

Parameters:

  • value (str): A string number between "0" and "1", or None for indeterminate progress. "" to close bar.

Example


import asyncio

for i in range(1,100):
  progress(str(i/100))
  await asyncio.sleep(0.05)
progress("")
Run