I want to write the julia code in the .py file, and when running the py file, the julia code can also pass normally, is this possible? I am using text editor VScode, python3.10 and julia1.7.2.
Actually, I know it's a bit whimsical, but today I saw python code running successfully in julia. So I wonder if it can be reversed.
module MyModule
using PyCall
function __init__()
py"""
import numpy as np
def one(x):
return np.sin(x) ** 2 + np.cos(x) ** 2
"""
end
two(x) = py"one"(x) + py"one"(x)
end
MyModule.two(2)