Calling Python from Julia
Python is a popular general-purpose programming language. From a Julia programmer's point of view, the main advantage of Python is having a large set of available libraries that can be seamlessly called and used within Julia.
In this recipe, we will use Python'sscrapy
package for parsing XML data.
Getting ready
In order to use Python from Julia, you should install and configure thePyCall.jl
package.PyCall
can be configured in one of two modes:
Using Python Anaconda, which is automatically installed within Julia
Using an external Python installation (for example, a separately installed Python Anaconda)
In this recipe, we use the second option (that is, using external Python), but we also provide comments for the built-in Julia Anaconda. Using a version of Anaconda that is separate from Julia makes it possible to use several Anaconda installations (though just one at a time) with a single Julia installation.
We assume that you have installed and configured Python Anaconda...