import workspace2
workspace2.a_func()
This works and runs completely fine, however it underlines workspace2
as unresolved and leaves the function un-coloured.
Add
"python.analysis.extraPaths": ["${workspaceFolder}/python"],
in the settings.json file.
You can refer to here for more detail