Please help. How to programmatically print interactive object to interactive console #19728
Replies: 1 comment
-
This is a duplicate of https://discord.com/channels/702724176489873509/702951042480078948/1012230642219614210 , so locking to centralize the conversation. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi. I've tried every other avenue I can find to get help with this, but in each case it seems I'm doing something wrong... I'd really appreciate some help, either here, or direction to where I should be asking instead.
My question is this:
Running a node.js script in VSCode if I have
console.log(obj)
in my code it prints the object in grey in an interactive fold-down-able form, in the interactive console.Running a python script in VSCode if I have
print(obj)
in my code it prints (where obj is a list, dict, etc.) it prints it in the interactive console as a (potentially really long) string (the same as if I didconsole.log(JSON.stringify(obj))
in node.js).If I pause the script at an appropriate point, and manually type
obj
in the interactive console then it prints it in the grey interactive fold-down-able form there. But I can't seem to find any function or command in my python code that will do this (likeconsole.log(obj)
does in node.js)Is there any way to do this?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions