Last active
January 17, 2024 07:02
-
-
Save anonhostpi/acc624d66e4f0f8797bc4655cdbeb85a to your computer and use it in GitHub Desktop.
Execute Julia code in PowerShell
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using namespace Python.Runtime | |
# winget install julia -s msstore # Julia engine | |
# pip install julia # PyJulia | |
# Import-Module Import-Package | |
Import-Package pythonnet | |
# Initialize the engine and lock CPython | |
[PythonEngine]::BeginAllowThreads() | |
[PythonEngine]::Initialize() | |
$gil = [Py]::GIL() # Lock | |
$julia = [Py]::Import("Julia") | |
# $julia.install() # needs to be run the first time you run PyJulia | |
[py]::import("julia.Base") | |
$julia.Base.print('Hello World!') | |
# Hello World! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment