I currently have a python file that looks like this:
import os
import sys
PROJECT_FOLDER = os.path.realpath(os.path.join(os.path.dirname(__file__), ".."))
os.chdir(PROJECT_FOLDER)
sys.path.insert(0, PROJECT_FOLDER)
from settings import datagenerator as settings
Due to the way the settings and modules are organised in the project, I need to set some common working directory before importing the various files.
Since I am quite lazy, I like to use the 'Organize imports' in VScode. Unfortunately, it moves the line from settings import datagenerator as settings
on top of the block setting the current path.
Even though it is to be expected. I was wonderings if there was a way to tell VSCode to keep those lines together.