-
Notifications
You must be signed in to change notification settings - Fork 4
Home
Kepoor Hampond edited this page Mar 19, 2017
·
7 revisions
You can easily install it with pip
:
$ pip install draftlog
There's not a whole lot to go over, so it'll all be covered here.
First off, how to actually use it. So here's the simplest possible example of it actually doing something:
# First, you'll want to import it
from draftlog.draft import Draft
# Then initialize the object
d = Draft()
# Create a text interval object (we'll get to what that is later)
d.add_text("*programming pun*")
# And run it!
d.start()
Now, if we wanted to stop here, then it would run, but let's add some complexity to the text interval object:
# This time we'll assign a variable to `d.add_text`, which returns an id for finding our object.
# Also, with status as `False`, it means it won't timeout immediately
id = d.add_text("*programming pun*", status=False)
# Then with the id, we can edit the text interval object:
d.id_interval(id).update("text", "haha what a funny joke...").update("status", True).after(5)
d.start()
Now, if this was done correctly, it should