Menu
CoddyTech

Run Python Without main

Lesson 1 of 48 in Coddy's Python for C Developers course.

Bring your C experience with variables, loops, functions, structs, and pointers. Python manages objects and executes statements without a C main function or a compilation step in this editor. Start by running the supplied print call. Every task uses multiple files: open main.py for this first run; the locked driver.py is the entry file and loads the learner code. Later lessons explain imports and put one class in each module. No prior Python course is required.

challenge icon

Challenge

Beginner

Run the ready-made Python code once; no editing or input is required. The single output line is Python is ready.

C starts at main; this Python program runs statements in its entry file.

Your code goes in main.py. The locked driver.py is the entry file, supplies execution and checks, and cannot be edited.

Try it yourself

# Starts the program in main.py. Edit main.py to solve the challenge.
from runpy import run_module

run_module("main", run_name="__main__")

All lessons in Python for C Developers

Practice on your own: Online Python compiler