Calling Python Scripts from Swift by PythonKit.

#example.pydef hello():
print("Hello PythonKit")
override func viewDidLoad() {super.viewDidLoad()let sys = Python.import("sys")sys.path.append("/Users/mlboy/PythonTest/") // path to your Python file's directory.let example = Python.import("example") // import your Python file.example.hello() // call your Python function.}

--

--

--

Freelance iOS developer. You can ask me for a job from any country. rockyshikoku@gmail.com https://github.com/john-rocky https://twitter.com/JackdeS11

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Apple Store Review Guidelines: the most common problems

Create Simple, Custom UINavigationController Transitions

Type Safety for Interface Controller Identifiers in WatchKit

What to do if the ARCoachingOverlayView is not displayed

You can now try 1Password’s customizable redesign on your iPhone and iPad : Gadget Game News

Tokopedia iOS: Hello 2021, Rewind 2020

Scroll to Different Positions in a ScrollView With ScrollViewReader in SwiftUI 2

Tokopedia iOS: Hello 2021, Rewind 2020

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
MLBoy

MLBoy

Freelance iOS developer. You can ask me for a job from any country. rockyshikoku@gmail.com https://github.com/john-rocky https://twitter.com/JackdeS11

More from Medium

Thirty Days of Metal — Day 21: Point Lights

An attempt to run Server-Side Swift on Raspberry Pi

Provide type safe NSCopying/NSMutableCopying API with Swift Generics?

Classifying Sounds with the SoundAnalysis framework and custom CoreML models in Swift