I import a .py file like so:
import sys
sys.path.append('/foo/bar/boo/far/')
# import foobar.py from target folder
import foobar
This line (simplified for sharing) works when the code is typed directly in the action editor window instead of importing the external script:
ft = lyr.getFeature([% $id %])
But when I use the same line in the external script, a syntax error is being thrown:
ft = lyr.getFeature([% $id %])
^
SyntaxError: invalid syntax
I continued with direct coding inside the action editor, which is possible of course, but working with an external script would significantly save time!
Any thoughts?