View Problem

Write a string to a file

DiskEdit
python
open('test.txt', 'wt').write('Hello World!')
ExpandDiskEdit
clojure
(with-out-writer "output.txt" (println "Hello file!"))
ExpandDiskEdit
fsharp
let stream = new StreamWriter("test.txt", false)
stream.WriteLine("This line overwrites file contents!")
ExpandDiskEdit
fantom
File(`out.txt`).out.writeChars("some text").flush
DiskEdit
csharp
System.IO.File.WriteAllText("filename.txt", "Some text to write to the file");
DiskEdit
haskell
writeFile "filename" "stringe"

Submit a new solution for python, clojure, fsharp, fantom ...
There are 13 other solutions in additional languages (cpp, erlang, groovy, java ...)