Question

Basically, after getting Sublime text 2 and sumblimeREPL up and running, I am having issues when I send code. For instance, in the below screenshot, I enter the code on the left line by line (ctrl+,l), or by block/selection but nothing shows up except the output. In[3]-In[6] I was attempting to run the x and y lines only. Is this the intended behavior? I would have assumed yes, except that all the output is being displayed on the input lines. The only other language I have tried so far is R, and it does not have this issues. Also it is the same issue in both python and ipython. Any ideas?

enter image description here

Was it helpful?

Solution

First off, I'd strongly suggest upgrading to IPython 1.1.0, as while the issue likely isn't related to the older version, it's well worth the upgrade, especially if you use it a lot.

If you open Preferences -> Package Settings -> SublimeREPL -> Settings - Default, you'll notice that the last line is "show_transferred_text": false. I'm on OS X, but when I have this set to false, I see the same behavior you do - the result of the expression printed on an In [#] line, with another blank line following it, ready for the next expression. However, if I set this variable to true (by copying the entire contents of the file, opening Preferences -> Package Settings -> SublimeREPL -> Settings - User, pasting everything in there, then changing settings and saving), then I see different behavior when transferring a line: The expression is printed on the In [#] line, and the result is printed below.

The reason you didn't see any results when evaluating the assignments to x and y is because nothing is returned, by default.

By way of explanation as to why the Python/IPython REPLs work this way, while the R one doesn't, is because SublimeREPL is very modular, and for the most part is just a thin wrapper surrounding native code. Therefore, the exact mechanism of transferring and displaying data may differ from Python to Ruby to R to Clojure, for example, and you may see slightly different behaviors.

OTHER TIPS

I wanted something more interactive. I wanted both the In[#] with text followed by an Out[#] with the output. I also did not want to switch from my source code to REPL just to get a damn Out[#].

Like this, for example... enter image description here The solution I came up with is a lot more complicated than the post above but you get that interactive feel that one gets when using R with Sublime Text. You can find my solution here: https://stackoverflow.com/a/27562036/3987905

Be sure to keep "show_transferred_text": false. Enabling it appears to mess up the plug-in. Hope it helps.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top