transpiling to swift and running from python
import os newfile = open("foo.swift", "w") newfile.write("var f = 8\nf += 4\nprint(f)") newfile.close() os.system("swiftc foo.swift") print(os.system("./foo")) #12