Quick Python Printf
This extension is inspired by "Quick Python Print".
The only differnece is this extension uses
"Quick Quick Print" can quickly print out variables on the console by using shortcut
If you find bug or have feature request, you can check out the ChangeLog to see if this bug or feature had been fixed or added in latest version, if not, please issue it in this extension's github repo.
Before installation, make sure your vscode version ≥ 1.57.0. This extension is available in the Visual Studio Code Extension Marketplace, you can search "Quick-Python-Printf" and install it.
How to use
Introduction video: Bilibili | Youtube (When I made this video, it was version 0.1.1, and there have been many changes in the current version).
This extension only activates within
For Mac user, the
Select the variable, then press
You can also just put the cursor at the target line, then the extension will automatically recognize the variable before
If you didn't select variable or the extension can't recognize variable, it will just insert simply print() and move the cursor inside it. If selected variable is new defined for the first time, insert code at current line :
If the extension recognize variable wrongly, you can manually select the variable, or report this issue in github repo.
Comment out or uncomment the print statement in the selected scope or in the python file:
Comment out all print statement above the cursor in the python file:
Comment out all print statement below the cursor in the python file:
Insert a print statement that will print 50
Delete all the print statement(include those commented) in the python file or in the selected scope:
Compatibility with different framework
Many deep learning framework all have
If any of these shortcuts conflicts with existing shortcut, you may change it in the
This extension has following settings:
You can go to the
Color output text
To color the output text in terminal, you need to do these things:
I also make a pypi package : printensor to uppack tensors inside list, tuple, dict, generator, then print their tensor shape. After installing and import, you can replace
This extension can not handle tensor that cross multiple lines, for example:
You can use