https://github.com/JuliaPy/PyCall.jl
방법 1. pyimport로 파이썬 패키지를 줄리아에 가져와서 사용하기
using PyCallmath = pyimport("math")math.sin(math.pi / 4)
plt = pyimport("matplotlib.pyplot")x = range(0;stop=2*pi,length=1000); y = sin.(3*x + 4*cos.(2*x));plt.plot(x, y, color="red", linewidth=2.0, linestyle="--")plt.show()
방법2. 파이썬코드를 줄리아에서 실행하기
py"""import numpy as npdef sinpi(x): return np.sin(np.pi * x)"""py"sinpi"(1)
라이브러리를 가져오는게 아니라 기존에 있는 파이썬으로 실행하는거라 설치된 모든 패키지를 이런식으로 사용할 수 있다
근데 파이썬은 0-indexed고 줄리아는 1-indexed니까 그냥 파이썬 쓰자...
방법 1. pyimport로 파이썬 패키지를 줄리아에 가져와서 사용하기
using PyCallmath = pyimport("math")math.sin(math.pi / 4)
plt = pyimport("matplotlib.pyplot")x = range(0;stop=2*pi,length=1000); y = sin.(3*x + 4*cos.(2*x));plt.plot(x, y, color="red", linewidth=2.0, linestyle="--")plt.show()
방법2. 파이썬코드를 줄리아에서 실행하기
py"""import numpy as npdef sinpi(x): return np.sin(np.pi * x)"""py"sinpi"(1)
라이브러리를 가져오는게 아니라 기존에 있는 파이썬으로 실행하는거라 설치된 모든 패키지를 이런식으로 사용할 수 있다
근데 파이썬은 0-indexed고 줄리아는 1-indexed니까 그냥 파이썬 쓰자...
코드복붙 다 깨졌는데 비번까먹었다 망했다 ㅠㅠ
https://github.com/JuliaPy/PyCall.jl
주작아님 내가추천함 - dc App