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

Run entire file in ipython interpreter #3782

Closed
johnml1135 opened this issue Nov 15, 2018 · 14 comments
Closed

Run entire file in ipython interpreter #3782

johnml1135 opened this issue Nov 15, 2018 · 14 comments
Assignees

Comments

@johnml1135
Copy link

Can there be a button and and key press to run the current file in the ipython interpreter (data-science)? In terms of workflow, it would be very helpful.

@ronglums
Copy link
Contributor

@johnml1135 , Are you suggesting running the whole file when there're no cells defined?

@johnml1135
Copy link
Author

Honestly, it probably should be marked as a duplicate of #1444. It's just another element of the data science experience.

@jrwrigh
Copy link

jrwrigh commented Nov 21, 2018

Have you checked out IPython for VSCode? That's what I use and it works well. I personally map the run file command to Ctrl+Enter

@jamescasbon
Copy link

This works without an extension...

// Python launch arguments to use when executing a file in the terminal.
"python.terminal.launchArgs": ["-m", "IPython"]

Personally, I would like the ability to add multiple launchers...

"python.terminal.launchArgs": {
    "python": [],
    "ipython": ["-m", "IPython"],
    "ipdb": ["-m", "IPython", "--pdb"],

@jrwrigh
Copy link

jrwrigh commented Nov 26, 2018

@jamescasbon It looks like your solution will launch an interpreter session every time you want to test the code (which can be desirable in some situations*), whereas the IPython for VSCode extension will use the same IPython console.

Biggest thing it does is speed up the time it takes to run the script drastically since it A) doesn't have to launch a new IPython console and B) doesn't have to import the packages over again.

*Major issue with using the same interpreter session is if you do some incomplete refactoring, but I'll take the speed and deal with the mistakes. I normally like to restart the IPython console every dozen REPL iterations or so anyways.

@greazer
Copy link
Member

greazer commented Jan 3, 2019

Consider at least adding a command to run a whole file in the interactive window.

@rchiodo rchiodo self-assigned this Jan 9, 2019
@rchiodo
Copy link
Contributor

rchiodo commented Jan 9, 2019

I updated our 'Run All Cells' command to be 'Run Entire File in Python Interactive Window' so that it works without having to defined cells.

@rchiodo
Copy link
Contributor

rchiodo commented Jan 9, 2019

This will ship in our next release or you can try it out with our insiders build

@mcdevitts
Copy link

@rchiodo I just installed the insiders build and tried this new feature, and it doesn't work when jupyter is installed in a virtualenv. It works when I install jupyter in the base environment.

@rchiodo
Copy link
Contributor

rchiodo commented Jan 17, 2019

Funny you should say that. I just fixed virtualenv problems (#3537) . Wait like half an hour and try reinstalling the insiders build.

@rchiodo
Copy link
Contributor

rchiodo commented Jan 17, 2019

Not sure if you can see this or not:
https://vscode-python.visualstudio.com/vscode-python/_build?definitionId=18

But that's our rolling build that generates the insider's drop. When the last build I just submitted finished, it should update the insiders build with support for virtualenv.

@rchiodo
Copy link
Contributor

rchiodo commented Jan 17, 2019

Our contributing page also shows the current status:
https://github.com/Microsoft/vscode-python/blob/master/CONTRIBUTING.md

@mcdevitts
Copy link

Awesome. Thanks!

@johnml1135
Copy link
Author

This appears to be related to #3542 and microsoft/vscode-python#4893

@rchiodo rchiodo closed this as completed Apr 24, 2019
@lock lock bot locked as resolved and limited conversation to collaborators May 22, 2019
@microsoft microsoft unlocked this conversation Nov 14, 2020
@DonJayamanne DonJayamanne transferred this issue from microsoft/vscode-python Nov 14, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants