Python debug

Is there a way to debug python plugin code with VSCode (or Visual Studio), or is the only way writing log(…) messages?

Log or you can write it to a text file.

ok, thats hard. And another question (sry i really serached the forum for hours now, but i dont find an answer)
I am using VSCode. But VSCode mention :
from phBot import *
Import phBot could not be resolved.
So all phBot function are unknown, and i got many “not defined” errors, which makes the code “unreadable” because so many lines are reported.
I want to add “python.analysis.extraPaths”: but where can i find phbot.py (for pylance)?
I found one here : https://replit.com/@JellyBitz/phBot-plugin-tester but there must be an official source somewhere, i think?

No he’s just basically copied the returns from the API and put them in a python file so they can be imported, you’ll be able to do the same if you really want…

The bot will output any python errors to the log automatically so not sure why you can’t use that

Sure, i can use that, i just asked for an “official” phbot.py because i really love VSCode with intellisense (pylance).
Atm. develop feels a little bit like back in previous century… no debug, no intellisence/symbols, no auto correct/auto fill… all this stuff
And python error message are really not a big helpat all: Example i got this:
Python Error: byte must be in range(0, 256)
but he did not tell me the line of the code. so i had to iterate step by step and coming nearer and nearer… until i finally found the error… its.yeah like 1994 :slight_smile:
From my point of view it would be “better” to use c++ dll plugins where development is 1000 times faster, safer and easier. I think the bot bot is written in c++, dunno why using this !"§$%&/(&%$ python.
Ok its better than nothing (like sbot)

Theres no offical phbot.py just the API site.

Python is perfect for this. Hardly anyone knows how to build a C++ project so the barrier to entry is way lower. Not to mention the security risk of people creating malicious DLLs and people loading them then all their data gets stolen. Python plugins are just text files so anyone can look at them.

You can read the documentation which tells you what each function does. If you want to test your code you can make sure the basics work with just a Python interpreter.