An extension that adds some key strokes from C and other languages to Python, such as '//' to comment, ++ to increment, and -- to decrement. This extension works by changing this C syntax to equivalent Python syntax after you finish typing.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Welcome to the README for the c_shortcuts_to_python extension. This extension brings some familiar C and other language shortcuts to Python in Visual Studio Code.
Features
This extension provides the following features for Python development:
// to #: Automatically converts // comments to Python-style # comments.
++ to += 1: Converts ++ to Python’s += 1 increment operation.
-- to -= 1: Converts -- to Python’s -= 1 decrement operation.
Examples
Here's a look at how these features work:
Example 1: Comment Conversion
Before:
// This is a comment
After:
# This is a comment
Example 2: Increment Conversion
Before:
count++;
After:
count += 1
Example 3: Decrement Conversion
Before:
count--;
After:
count -= 1
Exemption Feature
To exempt a line from the transformations, add # EXEMPT on the line above:
# EXEMPT
count++;
In this case, count++; will not be converted to count += 1.
Screenshots
You can add screenshots or GIFs to demonstrate the extension's functionality. Place images in the images directory within your project folder and reference them like this:
Requirements
VS Code: This extension requires Visual Studio Code version ^1.90.0 or higher.
Python: Make sure you have Python installed on your machine for running Python scripts.
Extension Settings
This extension does not add any custom settings to the VS Code configuration.
Known Issues
The extension might not work properly with complex or non-standard Python syntax.
Make sure to add # EXEMPT on the line above if you want to prevent transformations.
Release Notes
0.0.1
Initial release of c_shortcuts_to_python.
0.0.2
Added # EXEMPT feature to prevent transformations.