Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Python debugger anyone ?

New Here ,
Nov 11, 2024 Nov 11, 2024

Hi guys.

Does anybody have a reliable recipe for attaching the Visual Code debugger to a Painter Python plugin? I've tried a couple of ways, but I've had no luck so far. 

TOPICS
Discussion , Scripting
212
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 14, 2025 Feb 14, 2025
LATEST

I have it working using debugpy and visual studio code, so should be possible to use VS to attach.

# debugpy errors out if you don't set os.__file__:
import os
import inspect
os.__file__ = inspect.getfile(lambda: None)
import debugpy

# The python exe must be the same python version that Painter uses:
debugpy.configure(python="path/to/standalone/python.exe")
debugpy.listen(<portnumber>)

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines