0

I’m a former Python programmer, and I’m new to Swift

I want to know: is there a function that can exec/run another Swift file or external Swift script?

Just as an example. In Python I was using to exec another Python script:

exec("print('Hello world')") 

and the result:

Hello world

That's it.

1
  • Show some python code, then I believe you are former and not current Python programmer. Commented Feb 15, 2022 at 16:08

2 Answers 2

1

In fact, there is a library that can run external codes in swift Similar like your python Example, you can download the Library by github:

https://github.com/samuelmeuli/swift-exec

Sign up to request clarification or add additional context in comments.

Comments

0

I don't know much about this but I think so this article could maybe help you for what you are looking for.

Link: https://www.raywenderlich.com/25816315-using-swift-scripts-with-xcode

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.