I can't type julia code in multiple lines in IJulia.

813 views
Skip to first unread message

Ismael VC

unread,
Jan 13, 2014, 5:07:35 PM1/13/14
to julia...@googlegroups.com


ismaelvc@vm-0:~$ sudo ipython console --profile=julia
Python
2.7.4 (default, Apr 19 2013, 18:28:01)
Type "copyright", "credits" or "license" for more information.
IPython 1.1.0 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.
IPython profile: julia
Starting kernel event loops.

In [1]: for i in 1:10
syntax
: incomplete: premature end of input
at
In[22]:2
 
In [2]:
KeyboardInterrupt
 
In [3]: for i in 1:10                                                                                                                                                                
syntax
: incomplete: premature end of input
at
In[3]:2
 
In [4]: for i = 1:10
syntax
: incomplete: premature end of input
at
In[4]:2
 
In [5]: for i = 1:10 print(i) end                                                                                                                                                    
12345678910
In [6]: function test()
syntax
: incomplete: premature end of input
at
In[6]:2
 
In [7]: function test() println("TEST") end
Out[7]: test (generic function with 1 method)
 
In [8]: test()
TEST

Stefan Karpinski

unread,
Jan 13, 2014, 5:37:13 PM1/13/14
to Julia Users
You should probably file an issue with IJulia:

Ismael VC

unread,
Jan 13, 2014, 10:58:30 PM1/13/14
to julia...@googlegroups.com
Thanks for pointing me in the right direction! I will do that.

Cristóvão Duarte Sousa

unread,
Jan 14, 2014, 3:02:03 AM1/14/14
to julia...@googlegroups.com
I guess IJulia is suppose to work on the notebook (ipython notebook --profile=julia) only.
If one wants Julia in a console, julia REPL is the way to go.

I say this because the issue has already been around from a long time ago.

Ismael VC

unread,
Jan 14, 2014, 9:19:35 AM1/14/14
to julia...@googlegroups.com
I also think that IJulia came to be mostly because of the netbook, and it is where it is most useful, still in the IJulia page:

https://github.com/JuliaLang/IJulia.jl#running-ijulia

They advertise the command I used:

ipython console --profile julia

Along with:

ipython qtconsole --profile julia

ipython notebook --profile julia

Matthias BUSSONNIER

unread,
Jan 14, 2014, 9:39:28 AM1/14/14
to julia...@googlegroups.com

Le 14 janv. 2014 à 00:02, Cristóvão Duarte Sousa a écrit :

> I guess IJulia is suppose to work on the notebook (ipython notebook --profile=julia) only.
> If one wants Julia in a console, julia REPL is the way to go.
>
> I say this because the issue has already been around from a long time ago.

There are many issues here,

First is that `ipython console` is not a lot used, so there is only a few bugs report.
This is mainly due to the fact that of course people use native repl most of the time.

There is the possibility to bind another key-combinaison to "force new line" without executing.
Because right now the console process (python) is lexing input at python and is the one deciding wether
to insert a new line or execute this would only be a temporary workaround until we add the possibility
to ask the kernel to do lexing and decide wether or not an input is done.

Jacob Quinn

unread,
Jan 14, 2014, 10:30:57 AM1/14/14
to julia...@googlegroups.com
Little late on this thread, but thought I'd chip in. While I haven't had a ton of time to polish, I personally use the Sublime-IJulia frontend each day for my own julia work. Handling multiline input like this is pretty trivial and can be accomplished in Sublime by selecting multiple lines and running Cmd/Ctrl + Enter to send to IJulia, or in the repl/console itself, you can press Shift+Enter to enter a newline without evaluating. I do plan on putting some more time into this at some point (hopefully the next few weeks) to fix a few key-binding bugs and get some documentation together, but if anyone is interested in trying out the beta, I'm happy to help get things up and running/troubleshoot. (A side note is that you don't even have to have IPython installed; the only requirement is that you can successfully build/install the IJulia package in julia).

Cheers,

-Jacob
Reply all
Reply to author
Forward
0 new messages