This Visual Studio Code extension allows you to easily run Python scripts directly from the editor or the file explorer.
- Run the active Python file from the editor.
- Run a Python file from the context menu in the file explorer.
- Adds a convenient button to the status bar to run the active Python file.
- Open Visual Studio Code.
- Go to the Extensions view by clicking on the Extensions icon in the Activity Bar on the side of the window or by pressing
Ctrl+Shift+X. - Search for
Run Python Fileand click Install.
- Open a Python file in the editor.
- Click on the
$(play)button in the status bar to run the active Python file. - Alternatively, you can right-click in the editor and select
Run Python Filefrom the context menu.
- Right-click on a Python file in the file explorer.
- Select
Run Python Filefrom the context menu.
-extension.runPythonFile: Runs the active Python file or the selected Python file from the file explorer.
If you want to contribute or modify this extension, follow these steps:
- Clone the repository.
- Open the repository folder in Visual Studio Code.
- Run
npm installto install the necessary dependencies. - Press
F5to open a new VS Code window with the extension loaded.
To add a new command, follow these steps:
- Open
src/extension.ts. - Register your command using
vscode.commands.registerCommand. - Implement the functionality for your command.
To publish the extension to the Visual Studio Code Marketplace:
- Install
vsceif you haven't already:npm install -g vsce. - Run
vsce packageto create a.vsixfile. - Run
vsce publishto publish the extension (you will need a Personal Access Token from the Visual Studio Code Marketplace).
- Initial release of the Run Python File extension.
If you have any issues or feature requests, please open an issue on the GitHub repository.
-Ahsan Saeed - GitHub Profile
-Email - muhammadahsen83@gmail.com