Skip to content

Instantly share code, notes, and snippets.

@sturdysturge
Created January 22, 2021 17:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sturdysturge/9e11b222b8b11c3370e47f52686efcfb to your computer and use it in GitHub Desktop.
Save sturdysturge/9e11b222b8b11c3370e47f52686efcfb to your computer and use it in GitHub Desktop.
import SwiftUI
import PythonKit
struct ContentView: View {
let myPythonScript = PythonObject(contentsOfFile: "MyPythonScript")
var helloWorld: String {
return myPythonScript.hello().description
}
func multiplyString(string: String, number: Int) -> String {
return myPythonScript.multiplyString(string, number).description
}
var body: some View {
VStack {
Text(helloWorld)
Text(multiplyString(string: "Multiplied ", number: 3))
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment