No stdout from jupyter.runStartupCommands
See original GitHub issueEnvironment data
- VS Code version: 1.60.0
- Jupyter Extension version: v2021.8.2031190714
- Python Extension version: v2021.9.1191016588
- OS: Windows 10
- Python and/or Anaconda version: python 3.6.6 64-bit
- Type of virtual environment used: Winpython
- Jupyter server running: N/A
Expected behaviour (usecase 1)
put “print(‘startup’)” into the jupyter.runStartupCommands section of settings.json -> ‘startup’ should appear in the interactive window on generation of interactive window or on kernel restart.
Actual behaviour (usecase 1)
no output visible
Expected behaviour (usecase 2)
run the following script via jupyter.runStartupCommands in settings.json:
import asyncio
loop = asyncio.get_event_loop()
async def myTask():
for i in range(10):
print(f'{i} hello')
await asyncio.sleep(1)
loop.create_task(myTask())
Should print to the interactive window every second, as it happens if the script is manually executed.
Actual behaviour (usecase 2)
No output visible at first. After the first input to the interactive window is executed, output appears. So I assume that some initialization of the stdout needs to take place.
Notes
Might be related to #5379
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
How do you suppress output in Jupyter running IPython?
stdout = open(os.devnull, 'w') both fail (end up printing an extra blank line). This should be the accepted answer. – Luke ...
Read more >Jupyter Notebook stdout and stderr not showing up in the ...
Hi! I am using comet.ml on jupyter notebook to log my experiment results. # initialization cell from comet_ml import Experiment experiment ...
Read more >Capturing Output With %%capture
IPython has a cell magic, %%capture , which captures the stdout/stderr of a cell. With this magic you ... This is a simple...
Read more >Switching Data Analytics Activities From Jupyter to Vscode
I have been using VSCode almost for all activities related to software development. The last activity I preferred to do using an external ......
Read more >JupyterLab no longer allows ouput to be redirected to stdout?
In the past when working in a Jupyter notebook, I could redirect output ... However, in a recent update of JupyterLab, this no...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@lfriedri This was actually intentional on our side. The startup commands were intended to run silent at the start for any pre-configuration that was needed. However this might be work re-discussing. We’ll take about this at triage. Thanks for filing the issue.
Since your code is running async the output is just coming in on stdout from the python kernel. It only shows up when a cell exists in the UI to put the output into, which is why you see the behavior that you do. It’s a bit funky but I don’t think that it’s behavior that we will be changing now.