Python target is in beta meaning that breaking changes can happen between minor versions.
Python
This section is specific to Python targetting, it will guide you through the process of setting up your project and using Fable with Python.
Run your code.
python3 program.pyWhen targeting Python, you will want to install the
Fable.Pythonpackage. It provides a set of bindings to the Python standard library, and so others common libraries.dotnet add package Fable.PythonChange the content of
Program.fsto the following:open Fable.Python.Builtins let file = builtins.``open``("test.txt", OpenTextMode.Write) file.write("Hello World!") |> ignoreRun Fable in watch mode
dotnet fable watch --lang pythonIf you run your node script again, you should see a new file
test.txtwith the contentHello World.Try changing the content of
Hello Worldto something else and re-run your script.You should see that Fable re-compile your code and the file content changed.