It would be great if you can edit the readme and add some examples and other information you find, and submit as a pull request. The pyjulia package has not been used by many people so far, so any chance contributions will help. On Sep 9, 2014 8:25 AM, "Uwe Fechner" <uwe.fechner....@gmail.com> wrote:
> Ok, by reading the source code of pyjulia I found the answer myself: > > j.call is for calling julia functions only, not for getting results back. > > If you need the result, use j.eval: > > In [6]: j.eval("2+2") > Out[6]: 4 > > I think the main problem is, that pyjulia has no documentation yet. > I might open a pyjulia issue for this. > > Regards: > > Uwe > > > On Tuesday, September 9, 2014 2:18:49 PM UTC+2, Uwe Fechner wrote: >> >> Ok, no exeption any more if I use j.call instead of j.run. >> >> But the result is wrong: >> >> import julia >> j=julia.Julia() >> In [3]: j.call("2+2") >> Out[3]: 49655584 >> >> Any idea? >> >> Uwe >> >> >> On Tuesday, September 9, 2014 1:49:55 PM UTC+2, Isaiah wrote: >>> >>> I think you need `julia.call` instead of `julia.run`. >>> >>> On Tue, Sep 9, 2014 at 7:16 AM, Uwe Fechner <uwe.fec...@gmail.com> >>> wrote: >>> >>>> Hello, >>>> >>>> I have a function, that is running much faster in Julia then in Python. >>>> >>>> Now I want to call it from my (large) Python program. >>>> >>>> I tried to do this, using pyjulia from >>>> https://github.com/JuliaLang/pyjulia . >>>> >>>> I am using Ubuntu 12.04, 64 bits and Julia 0.3 and tried to install >>>> pyjulia in the following way: >>>> >>>> cd ~ >>>> mkdir 00Software >>>> cd 00Software >>>> git clone https://github.com/JuliaLang/pyjulia.git >>>> cd pyjulia >>>> sudo python setup.py install >>>> >>>> Then I started ipython and tried the following code: >>>> >>>> import julia >>>> j=julia.Julia() >>>> j.run("2+2") >>>> >>>> I get the following error message: >>>> >>>> In [3]: j.run("2+2") >>>> ------------------------------------------------------------ >>>> --------------- >>>> RuntimeError Traceback (most recent call >>>> last) >>>> <ipython-input-3-4f45159364ef> in <module>() >>>> ----> 1 j.run("2+2") >>>> >>>> RuntimeError: Julia exception: MethodError(run,("2+2",)) >>>> >>>> In [4]: >>>> >>>> Any idea what is going wrong? >>>> >>>> Best regards: >>>> >>>> Uwe Fechner >>>> >>> >>>