(* using nimpy ) code :
import nimpy
py = pyBuiltinsModule() discard py.open("file.txt", "w").write("Hello Nim!")
(* File created but its empty)