Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Compile and RunNew to Visual Studio Code? Get it now.
Compile and Run

Compile and Run

KAsdRon

|
1,194 installs
| (0) | Free
Compile and run C++ and Python files
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Compile and Run

This extension adds a command to Visual Studio Code that allows you to compile and run C++ and Python files with a single click.

Features

  • Compile C++ files using the g++ compiler and run the resulting executable.
  • Run Python files using the python interpreter.
  • Supports both Windows and Unix-based systems (macOS, Linux).
  • Displays compilation and execution output in the Visual Studio Code terminal.

Requirements

  • For C++:
    • g++ compiler installed and available in the system's PATH.
  • For Python:
    • Python interpreter installed and available in the system's PATH.

Usage

  1. Open a C++ (.cpp) or Python (.py) file in Visual Studio Code.
  2. Press Ctrl+Shift+P (Windows/Linux) or Cmd+Shift+P (macOS) to open the command palette.
  3. Search for Compile and Run and select the command.

The extension will automatically detect the file type and perform the appropriate action:

  • For C++ files, it will compile the file using g++ and run the resulting executable.
  • For Python files, it will run the file using the python interpreter.

The output from the compilation or execution will be displayed in the Visual Studio Code terminal.

Extension Settings

This extension does not currently have any configurable settings.

Known Issues

  • The extension assumes that the g++ compiler and python interpreter are available in the system's PATH. If they are not, you may need to configure the PATH or modify the extension code to specify the correct paths.

Release Notes

1.0.0

Initial release of the Compile and Run extension.

Contributing

If you find any issues or have suggestions for improvements, please feel free to open an issue or submit a pull request on the GitHub repository.

License

This extension is licensed under the MIT License.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft