Skip to content

Documentation

BossBoss2011 edited this page Apr 4, 2024 · 3 revisions

Documentation

This is the official documentation for Tonpy.

START

START is used to mark the beginning of the code (optional). If you have a START, you will also need a STOP, otherwise returns a No_STOP_Error.

Display()

Works just like print(), but not with as many arguments. Aliases: display(), show().

display(*text, sep: str | None = " ", End="\n") -> None

Read()

Works just like input(). Aliases: read, read_from_keyboard, keyboard

read(prompt: str = "") -> str

Aread()

Is basically read() but attempts to convert the input into an int. If it fails, it will return a string. Aliases: A_read(), auto_read(), read_auto()

Aread(prompt: str = "") -> str | int | bool

sleep()

Aliases: sleep(), wait()

sleep(seconds: float | int, /) -> None

Waits seconds seconds.

wait_until()

Aliases: wait_until(), waituntil()

wait_until(expression: str = 'False', is_bool: bool = True, timeout: float = 0.50) -> None

It will wait timeout seconds constantly until the expression has the same value as is_bool (by using eval()).

clear_screen()

Clears the screen. (seems pretty self-explenatory). Aliases: clear_screen(), clear(), cls().

main_loop()

Stops the program from closing by constantly waiting 60 seconds (can not be changed). Using this will keep the program running even after the code finished running until the X button is pressed. Aliases: main_loop(), loop(), mainloop(), main(), m_loop().

STOP

Marks the stop of the code. Any code past it will not be ran. Needs to be paired with a START, otherwise returns an error.

Other aliases

int: nr, number, integer str: text, txt, string bool: maybe, boolean None: null True: mhm, true False: hmh, false

Clone this wiki locally