Quick Python PrintfThis 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. InstallationBefore 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 useIntroduction 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 Keyboard ShortcutFor Mac user, the Ctrl+Shift+L 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. Ctrl+Shift+O
Ctrl+Shift+T
Ctrl+Shift+/ Comment out or uncomment the print statement in the selected scope or in the python file: Ctrl+Shift+Up Comment out all print statement above the cursor in the python file: Ctrl+Shift+Down Comment out all print statement below the cursor in the python file: Ctrl+Shift+; Insert a print statement that will print 50 Ctrl+Shift+R 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 Extension SettingsThis extension has following settings:
You can go to the Color output textTo color the output text in terminal, you need to do these things:
pypi packageI 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 Known issueThis extension can not handle tensor that cross multiple lines, for example:
You can use LicenseMIT License |