Just a small package I made to help game development without any of that await async nonsence
Project description
STTASK python
No more awaiting!
A module with a simple usage designed for game developing.
Usage
import sttask
print("This program will show waht STTASK can do.")
owner = sttask.TaskOwner()
print("Whenever 'owner.update()' is called, all tasks run.")
owner.update()
print("Nothing happened, as we need to add a task to it.")
owner.add("printhello", lambda self,args: print("Hello"))
owner.update()
# Hello
print("We just added a task called 'printhello', and then updated the owner. This made all the tasks run, causing 'Hello' to be printed.")
owner.add("printworld", lambda self,args: print("World"))
owner.update()
# Hello
# World
print("Now we added a task to print world, and updated, so both tasks ran.")
print("Lets remove a task!")
owner.pop_task("printhello")
owner.update()
# World
print("If we want to remove a task from within the same task, all we need to do is return 'sttask.end' from the task!")
def example_task(self,args):
print("This task should delete its self if you input 'delete'")
if input(">>> ")=="delete":
return sttask.end
owner.pop_task("printworld")
owner.add("removeself",example_task)
while "removeself" in owner.task_list():
owner.update()
print("Task is now deleted!")
print(owner.tasks)
# >>> not delete
# >>> dont delete
# >>> delete
# Task is now deleted!
# []
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
sttask-0.1.1.tar.gz
(4.3 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sttask-0.1.1.tar.gz.
File metadata
- Download URL: sttask-0.1.1.tar.gz
- Upload date:
- Size: 4.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
be35963acc105b1b51d214f19735ce8b33816bdfddae8b351e41f42e6bbded98
|
|
| MD5 |
e32403583f7b575cc215185e59d1c82a
|
|
| BLAKE2b-256 |
bd753325910698e2dcfe3c6ac60ab7f12cdbec39e721a1300644ba79411be0e7
|
File details
Details for the file sttask-0.1.1-py3-none-any.whl.
File metadata
- Download URL: sttask-0.1.1-py3-none-any.whl
- Upload date:
- Size: 4.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c0d9d081f8c474b0999da2c6c0030d02d2001efff8b32794ec299d9dff1502bc
|
|
| MD5 |
d98bf1b97b01589d92b96bc293421999
|
|
| BLAKE2b-256 |
864d21545c3ff4cd34aee60aba149cfbe5d2f1556d7415a10665161b8682b09c
|