pycall

How to mount google drive when using IJulia in google colab?

假装没事ソ 提交于 2021-02-10 04:54:45
问题 I am trying to get Julia working in colab. I want to mount gdrive to colab just like in IPython when using IJulia. In ipython I can do it as follows: from google.colab import drive drive.mount('/content/gdrive') I tried following: using PyCall clb = pyimport("google") clb.colab.drive.mount("/content/gdrive") ------------------------------------------------------------------------------------ Warning: Password input may be echoed. Go to this URL in a browser: https://accounts.google.com/o

I have a high-performant function written in Julia, how can I use it from Python?

让人想犯罪 __ 提交于 2021-02-07 04:45:10
问题 I have a found a Julia function that nicely does the job I need. How can I quickly integrate it to be able to call it from Python? Suppose the function is f(x,y) = 2x.+y What is the best and most elegent way to use it from Python? 回答1: Assuming your Python and Julia are installed you need to take the following steps. Run Julia and install PyCall using Pkg pkg"add PyCall" Put your code into a Julia package using Pkg Pkg.generate("MyPackage") In the folder src you will find MyPackage.jl , edit