- Install
ptvsd
using the same Python interpreter Qgis uses. E.g. on Windows:
C:\OSGeo4W64\apps\Python37\python.exe -m pip install ptvsd==4.3.2
- Add a debug configuration to
launch.json
:
{
"name": "Python: Remote Attach",
ptvsd
using the same Python interpreter Qgis uses.
E.g. on Windows:C:\OSGeo4W64\apps\Python37\python.exe -m pip install ptvsd==4.3.2
launch.json
:{
"name": "Python: Remote Attach",
In QGIS install the plugin debugvs
.
The debugvs
plugin needs the python module ptvsd
to function. This module is not installed by default.
In principle you just pip install ptvsd
in the python interpreter used by QGIS.
import asyncio | |
import threading | |
import random | |
def thr(i): | |
# we need to create a new loop for the thread, and set it as the 'default' | |
# loop that will be returned by calls to asyncio.get_event_loop() from this | |
# thread. | |
loop = asyncio.new_event_loop() |
# This program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or | |
# (at your option) any later version. | |
# | |
# This program is distributed in the hope that it will be useful, | |
# but WITHOUT ANY WARRANTY; without even the implied warranty of | |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
# GNU General Public License for more details. | |
# |