Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python run #7628

Merged
merged 13 commits into from
Oct 21, 2024
Merged

Python run #7628

merged 13 commits into from
Oct 21, 2024

Conversation

cwebster-99
Copy link
Member

@cwebster-99 cwebster-99 commented Sep 24, 2024

Adding a Run Python Code docs page to outline various ways users can execute Python code either in a REPL or Python file.

Unsure if we want this to be labeled "Run Python Code" or "Execute Python Code"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I love this idea of showing of usage of native REPL. We could also show off how to trigger from right clicking into "Run Python" too.

Also may be beneficial to import one of the standard libraries and show we are getting intellisense from Pylance for library methods. This might attract more people to be interested.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want to hold off on showing the routing from the context menu and Shift+Enter until we roll it out fully. But I do love the idea of showing using a std lib. Will work on updating that


The VS Code Native REPL for Python builds upon the classic Python REPL and provides additional features such as Intellisense and syntax highlighting to make your Python development experience more efficient. However, this REPL still adheres to principles present in the REPL built-in to Python itself, in that historical execution order and its content are immutable.

You can open the Native REPL via the Command Palette (`kb(workbench.action.showCommands)`) by searching for **Python: Start Native REPL**. Furthermore, you can send code to the Native REPL via Smart Send (`kbstyle(Shift+Enter)`) and **Run Selection/Line** by setting `"python.REPL.sendToNativeREPL": true` in your `settings.json` file. You can opt to continue to use the REPL built-in to Python located in the terminal ( `>>>` ) by setting `"python.REPL.sendToNativeREPL": false` in your `settings.json`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar to how Run Selection/Line in Python Terminal is put for Terminal REPL. We could change Run Selection/Line into Run Selection/Line in Python REPL


4. Place your cursor on a line of code and press `kbstyle(Shift+Enter)` to activate Smart Send.

### Smart Send
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding this section for smart send - many folks wanted additional space that explains smart send.
For the beginners, it would also be really helpful to add two small video that runs Python code (say a dictionary) with & without smart send. This is in case they have trouble understanding how we describe smart send.

docs/python/run.md Outdated Show resolved Hide resolved
@cwebster-99 cwebster-99 marked this pull request as ready for review September 30, 2024 19:59
@vs-code-engineering vs-code-engineering bot added this to the October 2024 milestone Sep 30, 2024
docs/python/run.md Outdated Show resolved Hide resolved
docs/python/run.md Outdated Show resolved Hide resolved
docs/python/run.md Outdated Show resolved Hide resolved
docs/python/run.md Outdated Show resolved Hide resolved
docs/python/run.md Outdated Show resolved Hide resolved
docs/python/run.md Outdated Show resolved Hide resolved
docs/python/run.md Outdated Show resolved Hide resolved
docs/python/run.md Outdated Show resolved Hide resolved
@luabud
Copy link
Member

luabud commented Oct 11, 2024

Could we add a "See also" section at the end? Maybe exactly like the one for testing: https://github.com/microsoft/vscode-docs/blob/f9ff9b54a75f7bdb7c9e2610c68ca840d64d6ef6/docs/python/testing.md#see-also

cwebster-99 and others added 2 commits October 11, 2024 09:33
Co-authored-by: Luciana Abud <45497113+luabud@users.noreply.github.com>
@cwebster-99
Copy link
Member Author

Could we add a "See also" section at the end? Maybe exactly like the one for testing: https://github.com/microsoft/vscode-docs/blob/f9ff9b54a75f7bdb7c9e2610c68ca840d64d6ef6/docs/python/testing.md#see-also

@luabud Love this idea! Just added a section and linked testing and debugging. Curious if you think we should move this page after editing? Currently it is set to be 3 on the ToC

@luabud
Copy link
Member

luabud commented Oct 19, 2024

@cwebster-99 I don't have a strong preference, I could make an argument for either options :p

@cwebster-99 cwebster-99 merged commit 07d6b12 into main Oct 21, 2024
@cwebster-99 cwebster-99 deleted the python-run branch October 21, 2024 14:32
@cwebster-99 cwebster-99 restored the python-run branch October 21, 2024 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants