To execute arbitrary julia code it is "eval" just like python, call returns 
a void pointer to the result.

examples:

import julia
julia = julia.Julia()
julia.eval("1 +1")
julia.sqrt(2.0)
julia.help("sqrt") # get the help for julia's sqrt function

from julia import Pkg # or any user installed package on your system
Pkg.installed()
Pkg.#ipython tab expansion should work for any package 

from julia import randn as r # should be able to import just as you would 
in python
r(100)

etc...

etc...

On Monday, September 1, 2014 5:02:37 PM UTC-4, Hans W Borchers wrote:
>
> Thanks a lot for this prompt reaction.
> I can now import 'julia' into Python, but I don't seem to get the right 
> results:
>
>     >>> from julia import Julia
>     >>> j = Julia()
>
>     >>> j.eval('PyObject((1,2,3))')     # works fine!
>     (1, 2, 3)
>
>     >>> j.call('1+1')                   # what is this ...
>     23296656
>
>     >>> j.call('sqrt(2.0)')             # ... and this?
>     173117264
>
>     >>> j.run('1+1')                    # shouldn't this work?
>     Traceback (most recent call last):
>       File "<stdin>", line 1, in <module>
>     RuntimeError: Julia exception: MethodError(run,("1+1",))
>
> I am sorry I bother everybody here. Maybe my installation is too 'kaputt' 
> by now.
>
>
> On Monday, September 1, 2014 10:08:16 PM UTC+2, Steven G. Johnson wrote:
>>
>>
>>
>> On Monday, September 1, 2014 2:47:18 PM UTC-4, Hans W Borchers wrote:
>>>
>>> Jake, which muster do you mean -- what would I need to reinstall?
>>>
>>
>> He means pyjulia master (do a 'git pull origin master' in the pyjulia 
>> directory). 
>>
>

Reply via email to