fable-compiler / Fable.Python

Python bindings for Fable
https://fable.io/docs/
MIT License
135 stars 10 forks source link

Scripting support .fsx #33

Closed jkone27 closed 2 years ago

jkone27 commented 2 years ago

can this work with simple .fsx files as well?

i tried


#r "nuget: Fable.Python"
#r "nuget: Fable.Core.Experimental, 4.0.0-alpha-020"

open Fable.Core.Experimental
open Fable.Python.Json

let object = {| A=10; B=20; C="hello" |}

let result = json.dumps object

// dotnet tool install --global fable-py --version 4.0.0-alpha-020

image

dbrattli commented 2 years ago

Sorry, nuget's in fsx scripts is afaik not supported by Fable. You will need to use a project file for now.

jkone27 commented 2 years ago

maybe some community contributor could help add support for this? i think code would be more "python" like in a script, rather than in a project, also for pp coming from python that might look easier to adopt

dbrattli commented 2 years ago

This is supported. See https://github.com/fable-compiler/Fable/blob/snake_island/src/quicktest-py/quicktest.fsx