![]() |
>>> import umpypkg as pkg
# if first time
>>> pkg.create()
>>> pkg.vscode()
There should now be a new directory '.vscode' under %AppData%\Umetrics\SIMCA\16.0\envs\default containing a settings.json and a launch.json
>>> pkg.install('ptvsd')
>>>pkg.env_dir
3. In VS Code click the cogwheel at the bottom left and select 'Command Palette...'. Start typing 'python: Run Selection/Line in Python terminal' and execute the command when selectable.
4. Open the debug view (Ctrl+Shift+D) and select Python: Attach in the drop down at the top.
5. Click the cog-wheel next to it to open launch.json.
You should see the values "port": 5678 and "host": "127.0.0.1" under the 'Python: Attach' section
Open the debug target file in VS Code and add a breakpoint by clicking the margin next to the line number. A red dot will appear, as by magic.
For example open "createproject.py" located in SIMCAs installation folder.
In the SIMCA Python Console run
>>> import ptvsd
>>>ptvsd.enable_attach()
#SIMCA will wait on the last expression until VS Code has attached
>>> ptvsd.wait_for_attach(30)
In VS Code click the green play-icon next to 'Python: Attach'
Start Debugging
Run in SIMCA the same file as you opened in step 1 in VS Code, either by clicking the favorite
or importing and calling it in the console. The breakpoint will be highlighted in VS Code.
Copyright© Sartorius Stedim Data Analytics AB |
SIMCA, part of the Umetrics® Suite of Data Analytics Solutions |
SIMCA® Multivariate Data Analytics Solution |