'What Function in swift 5 that ‏ runs/exec an external swift script? [duplicate]

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.



Solution 1:[1]

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

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Amish