Skip to main content
Mentr
Student Guides

Multi-File Python Online: Folders, Imports, and Zip Projects

Import across folders in a browser Python IDE. Package layout, rename/move, zip import/export, and a classroom demo script.

Mentr Engineering7 min read

Single-file demos teach syntax. Multi-file Python online teaches packages — the skill viva and internships actually need. If you searched for folders, modules, or “import from another file online”, this walkthrough is for you.

The first multi-file program

Create a greetings folder with hello.py, a maths folder with score.py, and a main.py that imports both. In Mentr, Examples → Folders + imports builds that layout for you.

from greetings.hello import hello
from maths.score import average

print(hello("Aarav"))
print("Average", average([18, 20, 16]))

Zip import/export for labs

Export zip downloads the workspace. Import zip rebuilds folders in the browser. That is the pendrive workflow without USB drivers on locked school images.

  • Rename and Move keep imports honest — update paths when you relocate modules.
  • Share sends the whole snapshot, not just main.py.
  • __init__.py files mark packages the way CPython expects.

Teaching tip

Common questions

Can I import from another file in an online Python compiler?
Yes if the IDE mounts multiple files into the runtime. Mentr’s explorer + Run path supports package-style imports across folders.
Do I need __init__.py?
For regular packages in this workspace model, empty __init__.py files are included in the demo layout so imports behave like desktop CPython.