Code Monkey home page Code Monkey logo

taskel's Introduction

Taskel

The python library for all types of tasks

Installation:

pip install taskel

Quick Start:

from taskel import Tasks
import time
tm = Tasks()
def myfunc():
  print("hello world")

t = tm.create(target=myfunc,daemon=False)
t.loop(sec=5)
time.sleep(14)
print("all_tasks: " + str(tm.tasklist))
t.stop()

Usage

(not an example)

from taskel import Tasks
tm = Tasks()
def myfunc(hi,bye):
  print("hello world")
def myfunctwo(hi):
  print(f"ran me only once {hi}")
t = tm.create(target=myfunc,args=["hi","bye"],daemon=False)
t.loop(sec=20)
print("you can go about your buisness/program")
print("with slightly beautiful aesthetic interruptions")
print("interruptions like hello world every 20 seconds")
print("however this is not all...")
print("you can just start tasks normally too")
ttwo = tm.create(target=myfunctwo,args=["well hello there"])
ttwo.start()
print("yet with all these interuptions, wouldn't you want to name your tasks?")
x = tm.create(target=myfunctwo,args=["i'm named yay :)"],name="X")
all_tasks = tm.tasklist
print(all_tasks)
print("while you can do: `t.stop()`")
print("to remove it from the tasklist:")
tm.end(x)
print("check if a task is running?")
t.running
print("normal stop ends the task after the round is complete if it is in the middle of one")
print("to force stop a task:")
tm.end(ttwo,force=True)
print("or `ttwo.force('stop')`")
print("for daemon, change the value to true")
print("eg:")
print('t = tm.create(target=myfunc,args=["hi","bye"],daemon=True)')
print("use daemon for background tasks as it will NOT have a visible output eg through print")
print("daemon is enabled to true by default for loop")
print("daemon is enabled to false by default for start")
print("arguments will be [] by default")
print("time to end the loop task now")

t.stop()

Development:

Install buildproj:

pip install buildproj

build

In case of the binary not working:

python buildbinary.py

All processes are automated except for the sign in for pip, please be sure to also change the version and name in `setup.py

Tests:

Install buildproj:

pip install buildproj

build test

In case of the binary not working:

python buildbinary.py test

taskel's People

Contributors

wynwxst avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.