Rom1-J / python-tio

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

image0 image1 image2

Python Tio SDK

Homemade SDK for tio.run

Developed and used for tuxbot-bot

Installing the pre-requirements

  • The pre-requirements are:
    • Python 3.8 or greater
    • Pip
    • Git

Examples

Some examples:

Sync

>>> from tio.tio import Tio
>>>
>>> tio = Tio()
>>> tio.get_languages().keys()
dict_keys(['05ab1e', '1l-a', '1l-aoi', '2dfuck', '2l', '2sable'...
>>>
>>> print(tio.run("python", "print(42)"))
42

Exit code: 0

Async

>>> from tio.tio import AsyncTio
>>> import asyncio
>>>
>>> async def main():
...    tio = AsyncTio()
...    print((await tio.get_languages()).keys())
...    print(await tio.run("python", "print(42)"))
>>>
>>> asyncio.run(main())
dict_keys(['05ab1e', '1l-a', '1l-aoi', '2dfuck', '2l', '2sable'...
42

Exit code: 0

About

License:GNU Affero General Public License v3.0


Languages

Language:Python 85.7%Language:Makefile 14.3%