Skip to content

Can I share functions across modules? #286

Answered by dlashua
wsw70 asked this question in General
Discussion options

You must be logged in to vote

I use the modules directory for this, and pyscript has some stuff builtin to help.

modules/volets_helpers.py

def volets_partiel(blah, blah):
  @time_trigger("once(09:00)")
  def inner(room=None, partiel=0):
    blah blah

  return inner

scripts/michael.py

from volets_helpers import volets_partiel

triggers = []
triggers.append(volets_partiel(room=michael, partiel=40))

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@wsw70
Comment options

@dlashua
Comment options

@wsw70
Comment options

Answer selected by wsw70
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants