import workplace script in inline skript
I have a script in my workspace:
u/chrsch/useful
def foo():
print('Common logic!')
def main():
foo()
I want to call the function foo() or also main() from my inline Skript:
inline script
from .useful import foo
def main(persdata: str):
foo()
return persdata
I get the error: TypeError: 'module' object is not callable
What do I wrong?
2 Replies
at docs: https://www.windmill.dev/docs/advanced/sharing_common_logic
it should be:
import u.chrsch.useful
Sharing common logic | Windmill
It is common to want to share common logic between your scripts. This can be done easily using relative imports in both Python and TypeScript.
Thank you! This works:
import wmill
import u.chrsch.useful as chrschUseful
def main():
tables= chrschUseful.foo()
return tables