0Pricing
Mojo Academy · Ders

mojo run ile Çalıştırma

Bir programı komut satırından çalıştırın.

mojo run ile Çalıştırma, CoddyKit'te ücretsiz bir Mojo Academy dersidir. Bu, 4 dersinin 3. dersidir. Aşağıdan dersin tamamını ücretsiz okuyabilir, sonra tarayıcıda yerleşik kod editörü ve 7/24 yapay zeka koçu ile uygulamalı olarak pratik yapabilirsin. Bu, Mojo Academy öğrenme yolunun bir parçasıdır ve ilerlemeniz web ve CoddyKit uygulaması arasında senkronize olur. Mojo Academy kursu toplamda 4 dersten oluşur.

Bu dersin bazı bölümleri henüz çevrilmemiş olup İngilizce olarak gösterilmektedir.

From File to Running Program

You have a saved hello.mojo file. To see it work, you launch it from your terminal with the mojo command. 🖥️

The mojo run Command

The simplest way to execute a file is mojo run followed by the file name. Mojo compiles and runs it in one step.

mojo run hello.mojo

Run from the Right Folder

Open your terminal in the folder that holds the file, or give the full path. Otherwise Mojo cannot find hello.mojo to run.

cd my_project
mojo run hello.mojo

See Your Output

After you press enter, Mojo prints the program's output right in the terminal. Your greeting appears on the next line.

Hello, world!

The Shorter Form

You can often drop the word run and just pass the file: mojo hello.mojo does the same thing as mojo run.

mojo hello.mojo

Edit, Save, Run Again

Change the code, save, and run the command again to see new output. This quick loop is how you learn fast in Mojo.

Reading an Error Message

If you have a typo, Mojo stops and prints an error with the line number. Read it, fix that line, and run once more.

Run Just Checks for main

mojo run expects your file to have a main function. Without one, it has nothing to start, and you get a clear error.

Building an Executable

For a faster standalone program, mojo build creates an executable file you can run directly, without compiling each time.

mojo build hello.mojo

run vs build

Use run while learning and iterating, since it is one quick step. Reach for build when you want a finished binary to ship or reuse.

Your Workflow Is Set

Write code, save the file, type mojo run, read the output. That short cycle is the core habit of every Mojo session.

Quick Check

You want to compile and execute hello.mojo in a single terminal step. Which command does that?

Recap

Use mojo run from the file's folder to compile and execute in one step, read the output, then edit and run again. 🎯

Sıkça Sorulan Sorular

“mojo run ile Çalıştırma” dersi ücretsiz mi?

Evet — “mojo run ile Çalıştırma” dersin tüm metni burada web'de ücretsiz olarak okunabilir. Etkileşimli olarak pratik yapmak (yerleşik kod editörü ve 7/24 yapay zeka koçu) ve Mojo Academy kursunun geri kalanını açmak için CoddyKit PRO'ya yükselt. Mojo Academy kursu toplamda 4 dersten oluşur.

“mojo run ile Çalıştırma” dersinde ne öğreneceğim?

Bir programı komut satırından çalıştırın. Mojo Academy ile uygulamalı kodu tarayıcıda doğrudan çalıştırarak pratik yaparsın ve 7/24 yapay zeka koçu dersi çalışırken sorularını yanıtlar.

Mojo Academy öğrenmeye başlamak için deneyim gerekli mi?

Önceden deneyim gerekmez. CoddyKit'te Mojo Academy, başlangıçtan ileri seviyeye kadar yapılandırıldığı için buradan başlayabilir veya başından başlayıp kendi hızında ilerleme yapabilirsin. Bu, 4 dersinin 3. dersidir.

“mojo run ile Çalıştırma” dersi ne kadar sürer?

Çoğu CoddyKit dersi yaklaşık 5–10 dakika sürer. Her biri kısa ve etkileşimli olduğu için sabit ilerleme yaparsın ve web ile uygulama arasında tam olarak bıraktığın yerden devam edebilirsin.

Bu Mojo Academy dersinde kod yazıp çalıştırabilir miyim?

Evet. Her Mojo Academy dersi yerleşik bir kod editörü içerir, bu sayede tarayıcıda gerçek kod yazıp çalıştırabilir ve anlık yapay zeka geri bildirimi alırsın — yerel kurulum gerekli değildir.

Bu kursun tüm dersleri

  1. İlk .mojo Dosyanız
  2. main Giriş Noktası
  3. mojo run ile Çalıştırma
  4. Mojo REPL'de Keşif
← Mojo Academy Sayfasına Dön