Oleksandr Manakov
Oleksandr Manakov
WWindmill
Created by Oleksandr Manakov on 12/11/2023 in #help
Is it possible to import functions from workspace scripts inside Background runnables?
One (probably stupid) question - is it possible to import functions from workspace scripts inside Background runnables? The same import works in other workspace script, but results an error when added to background runnable:
--- PYTHON CODE EXECUTION ---

Traceback (most recent call last):
File "<frozen runpy>", line 189, in _run_module_as_main
File "<frozen runpy>", line 159, in _get_module_details
File "<frozen importlib._bootstrap_external>", line 1074, in get_code
File "<frozen importlib._bootstrap_external>", line 1004, in source_to_code
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "/tmp/windmill/wk-default-ffbdde9c7435-bx28a/018c586c-d693-39e8-0405-93e9507f19b1/wrapper.py", line 8
from u.username.111 import background_runnable_1_fullscreen as inner_script
^^^^
SyntaxError: invalid syntax
--- PYTHON CODE EXECUTION ---

Traceback (most recent call last):
File "<frozen runpy>", line 189, in _run_module_as_main
File "<frozen runpy>", line 159, in _get_module_details
File "<frozen importlib._bootstrap_external>", line 1074, in get_code
File "<frozen importlib._bootstrap_external>", line 1004, in source_to_code
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "/tmp/windmill/wk-default-ffbdde9c7435-bx28a/018c586c-d693-39e8-0405-93e9507f19b1/wrapper.py", line 8
from u.username.111 import background_runnable_1_fullscreen as inner_script
^^^^
SyntaxError: invalid syntax
The import is as simple as: from .temp import main as mmm. Both app and script are within the same user.
7 replies