Is it possible to call a python function from Julia and return its result

I am using Python to scrape data from the web. I want to use that data to run calculations in Julia. Is it possible to call the function in Julia and return its result, or am I better off just exporting to a csv and loading the data in that way?

Absolutely. See PyCall.jl.

julia> using PyCall

julia> @pyimport bs4

julia> @pyimport requests

julia> r = requests.get("https://stackoverflow.com/questions/46638265");

julia> soup = bs4.BeautifulSoup(r[:content]);

julia> soup[:title][:string]
"Is it possible to call a python function from Julia and return its result - Stack Overflow"

0 Comment

NO COMMENTS

LEAVE A REPLY

Captcha image