Replies: 1 comment 1 reply
-
There are two ways you can run a mojo file. One is through the # cli.mojo
import sys
fn main():
let args = sys.argv()
for idx in range(1, len(args)):
print(args[idx]) Now you can run it through the mojo command without building an executable ❯ : mojo cli.mojo hello world
hello
world
# You can also do `mojo run`
❯ : mojo run cli.mojo hello world
hello
world Or you can build a native executable ~/Projects/anting
❯ : mojo build cli.mojo
~/Projects/anting
❯ : ./cli hello world
hello
world |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I've installed mojo and now can use it in the REPL. But I can't run mojo files. I've read that I should add the following lines to your configuration file (.bash_profile, .bashrc, or .zshrc) but I don't understand how to do it. Can anyone help me with that ?
I'm using Mac OS(Intel)
Beta Was this translation helpful? Give feedback.
All reactions