Closed teknikal-wizard closed 1 year ago
Yes, open
is a keyword in F#. That's why you get that message. Look at line 4, 5 and 6. We cannot use that name so the open function from Python have been named ``open``
. E.g try:
let result = builtins.``open``("test.txt", OpenTextMode.Write)
Another option is to use System.IO.ReadAllText
which is supported by Python
Ah of course! Thank you :)
I am working through converting an ML sample to Fable Python, and I need to open a CSV file.
It seems the proper Python way to do that is to use the csv module. The csv.reader function requires a file which they load with the built in open function.
I found that function in Fable.Python.Builtins.builtins has an
open
function, but it has no intellisense and shows an error when I try to use it.