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

Where can I see output of the code executed? #52

Closed
holyjak opened this issue Jun 8, 2015 · 9 comments
Closed

Where can I see output of the code executed? #52

holyjak opened this issue Jun 8, 2015 · 9 comments

Comments

@holyjak
Copy link

holyjak commented Jun 8, 2015

Hello, I am not able to figure out where I can see the output of the code that I execute, f.ex. this JS snippet:

console.log("Hello, Jupyter!");

Where can I see the Hello, Jupyter! output? Or is it impossible?

Thank you!

@willwhitney
Copy link
Collaborator

This is an issue with some kernels which are janky and don't put the output in the right place. Which Javascript kernel are you using?

@rgbkrk
Copy link
Member

rgbkrk commented Jun 8, 2015

It's the IJavascript kernel I assume (I just read n-riesco/ijavascript#31).

@holyjak
Copy link
Author

holyjak commented Jun 8, 2015

Indeed

Forget software. Strive to make an impact, deliver a valuable change.

(Vær så snill og hjelp meg med å forbedre norsken min – skriftlig og
muntlig. Takk!)

Jakub Holy
Solutions Engineer | +47 966 23 666
Iterate AS | www.iterate.no
The Lean Software Development Consultancy

It's the IJavascript kernel I assume (I just read n-riesco/ijavascript#31
n-riesco/ijavascript#31).


Reply to this email directly or view it on GitHub
#52 (comment)
.

@n-riesco
Copy link
Collaborator

n-riesco commented Jun 8, 2015

Hi everyone,

I've tried to reproduce this issue and I've noticed that:

  • if I don't save the document before pressing ctrl-alt-enter, no output is shown (only a looping icon).
  • if I save the document, then I get the result of calling console.log("Hello, Jupyter"), which is undefined, but I don't see the text written to process.stdout.

@n-riesco
Copy link
Collaborator

n-riesco commented Jun 8, 2015

I've quickly skimmed through Hydrogen's code. If I understood correctly this, when a kernel returns a result, Hydrogen doesn't show what was written to stdout.

I'm planning to add a flag to IJavascript to let the user silence undefined results (so that it plays nicely with Hydrogen). Most likely, I will make this the default behaviour.

@holyjak
Copy link
Author

holyjak commented Jun 8, 2015

I like the way Light Table works: returning the result of the statement
(even if being undefined) and having a separate output view where I can go
check for side effects. Though anything is much better than nothing :)

Forget software. Strive to make an impact, deliver a valuable change.

(Vær så snill og hjelp meg med å forbedre norsken min – skriftlig og
muntlig. Takk!)

Jakub Holy
Solutions Engineer | +47 966 23 666
Iterate AS | www.iterate.no
The Lean Software Development Consultancy

I've quickly skimmed through Hydrogen's code. If I understood correctly this
https://github.com/willwhitney/hydrogen/blob/2d2ae6e49e556a45c39231c758dd57afda56202d/lib/result-view.coffee#L78,
when a kernel returns a result, Hydrogen doesn't show what was written to
stdout.

I'm planning to add a flag to IJavascript to let the user silence undefined
results (so that it plays nicely with Hydrogen). Most likely, I will make
this the default behaviour.


Reply to this email directly or view it on GitHub
#52 (comment).

@willwhitney
Copy link
Collaborator

@n-riesco That's not where that logic is, but you're basically right. My reading is that kernels are supposed to put their stdout in the io stream: http://ipython.org/ipython-doc/stable/development/messaging.html#streams-stdout-stderr-etc

I'll look into the issue with not getting results until the file is saved.

@jakubholynet I agree in principle with separating those concerns, but due to kernel variability this is not feasible. Some kernels put all their results in the io stream, some put them into an execute_reply, etc. Right now my strategy is to just copy Jupyter's behavior of showing all the results.

@n-riesco
Copy link
Collaborator

n-riesco commented Jun 8, 2015

@willwhitney IJavascript does send stdout to the IOSocket (as IPython and IJulia do). The difference is that whereas IJavascript returns undefined results, IPython drops Nones and IJulia drops nothings.

@n-riesco
Copy link
Collaborator

n-riesco commented Jun 8, 2015

@jakubholynet This is issue is solved in IJavascript v5.0.3 (now available from npm)

@willwhitney This issue turned out to be solved by the PR you sent me last time. Unfortunately, I hadn't made it available on npm.

I'm sorry for all the inconvenience.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants