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

Add Data Wrangler to flat Python file #299

Open
BrazilForever11 opened this issue Sep 28, 2024 · 5 comments
Open

Add Data Wrangler to flat Python file #299

BrazilForever11 opened this issue Sep 28, 2024 · 5 comments
Labels
external Issue belongs to another repository feature Feature request

Comments

@BrazilForever11
Copy link

This is not a bug. This is feature request.

It would be great to add Data Wrangler to flat Python file (not just Jupyter notebook).

Here is justification for working with flat files vs notebooks:

  • I often need to execute just a single line of code. I do not need to run whole cell. Creating a cell for each separate line eats up screen space.
  • Individual cell's output again eats up a lot of screen space. I would rather have all my output in the terminal.

P.S.
A bit off topic, but in the long term it would be great to be able to create markdown cell on demand, rather than having all code in Jupyter cells.

@pwang347
Copy link
Member

pwang347 commented Oct 2, 2024

Hi @BrazilForever11, thanks for opening this issue! We do support launching from the Python debugger for .py files, you can access this through the following menu:
image

If you want to do this line-by-line, have you tried using the following command (first run ctrl+shift+P to open command palette), and then type the following:
image

Does this work for you, or were you perhaps looking for something else (e.g., some special Python code to launch a new window when executed, but not debugging)?

@BrazilForever11
Copy link
Author

Thank you so much!

Using debugger is an interesting idea. I will think more about it.

But originally I was thinking of something similar to R-studio, where I can run code (flat file) line by line and as I run lines variables show up in Variable Explorer where I can view them. This is how R-Studio normally operate (it does not involve debugger)

@pwang347
Copy link
Member

pwang347 commented Oct 4, 2024

No problem! I think line-by-line execution in a .py file could be an interesting idea. Though if implemented as you described, it would likely need to be done from the Jupyter extension since they own the variable panel UI (which Data Wrangler taps into via a public data viewer API). They also have a similar command in Jupyter notebooks, which I'm guessing depends on IPython:

image

@BrazilForever11
Copy link
Author

I think it is already possible to execute .py file line-by-line in VS Code. Shift + Enter executes a line and results stay in memory. I think it is only matter of reading it from memory and displaying it with Data Wrangler (variable explorer)

@pwang347
Copy link
Member

pwang347 commented Oct 8, 2024

Makes sense. Note that this isn't something we can build solely from our extension without a dependency on the Python extension. Seems like what you are looking for is actually something like this (variable explorer in general, with integration to DW): microsoft/vscode-python#17183

I see that it is being considered as part of a recent plan here, so this may be an issue to subscribe to for any developments: microsoft/vscode-python#21707

Will keep this issue open here as well since we will likely need to integrate with the new proposed variables panel once/if it releases. Thanks!

@pwang347 pwang347 added feature Feature request external Issue belongs to another repository and removed info needed labels Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
external Issue belongs to another repository feature Feature request
Projects
None yet
Development

No branches or pull requests

2 participants