November 2017
Beginner
316 pages
6h 40m
English
Using another language inside Julia may not be the best of ideas as far as speed and efficiency is concerned. But, there may be situations when you would be required to do so. Here, we talk about a package named PyCall, which is used to import Python code in Julia.
Here is how PyCall can be downloaded from inside a Julia shell:
julia> Pkg.add("PyCall")
Once it is installed, we can start using Python commands right away. Given here are some code snippets that let you quickly understand how easy it is to invoke and use in Julia right away:
# Invoke PyCall julia> using PyCall # Starting with a simple hello world julia> py""" print 'hello world' """ hello world # Some random operations julia> py"len('julia')" 5 julia> ...Read now
Unlock full access