[Python] Viewing numpy arrays and lists during debugging in an easier to read format

Discussão em 'Python' iniciado por Stack, Fevereiro 8, 2025.

  1. Stack

    Stack Membro Participativo

    I've been making the switch over to VSCode lately, and have had quite a lot of success, I love the format. However, one thing I'm sorely missing is a good variable viewer for arrays and lists. I am aware of the variable viewer that you can look at during debugging, however it's horribly and unnecessarily cluttered for lists and numpy arrays -having 4 sub folders- and you have to click into two of them to view the array laid out in a reasonable fashion. But with arrays wider than 4 you have to constantly scroll. Worse, while stepping through it will often close those subfolders and you have to reopen them again to continue watching!

    Is there any way to view the array in a separate window that updates on its own (Yes I found the "data viewer" but you have to refresh it for it to update to any changes that have occurred to the array) like the way you can in Spyder or MATLAB? Thanks!

    Here's images of what I've found:

    [​IMG]

    This is the variable viewer I've already found, as you can see, it has all that cluttering with multiple folders I was talking about. I only need to see the values under the "0", "1", "2" subfolders because I need to watch them update as I step through my code.

    [​IMG]

    I did find this data viewer, but it doesn't update as I step through the code, it has to be manually refreshed.

    [​IMG]

    Spyder has this variable viewer, which is the sort of thing that I'm looking for. It automatically updates as you step through your code and you can resize the variable slots (like you would adjust the size of a cell row/column in excel) to fit your needs

    Continue reading...

Compartilhe esta Página