Ask coding questions

← Back to all posts
how does repl-it organize the files and folders - i am not able to run code in subfolder

hello dear all - new to repl-it. love it as it seems ot be a great approach to a online-ide.

one question though:

cannot run code that i have added to a folder.. .see the image

see here the account - and the folders that i have created

question is: how to run the code that is in adress_book2

it does not work - i cannot run this code .

did i miss something.. plz lemme know and set me straight

thanks in advance


You need to add the .py extension for a file to be read as a Python file. Then, you can run it from (or other) by doing import adress_book2 (Don't include the .py when using import).
Also, you can import files from a folder by doing import corey_schafer.tutorial
Please mark my comment as the answer if it helped you. Thanks!


@mat1 many thanks der Mat1 - great to hear from you_

i follow your advice and will add the py-ending. sure thing - it is obvious that we need that. i will try out all your recommendations - great to hear from you.

have a great day


@mat1 it didn't work on my code


Hi !
If your files are two differents programms, the best thing to do is to create two repls

If you want to keep these files in the same repl, you can use right click on the editor > open command palette > open shell but you need some experience with a shell (basically how to move in the file system / how to run a python script from the shell)

There is an other way :


@abc3354 hello many many thanks for the quick reply - i will try out all your recommendations - great to hear from you.

BTW - the things with the shell - guess that i can do all that things - besides the ideas of running the chrome-exteinson for replit.

sure thing - iguess that the shell things are a different story

Again - i wil try out all the things you reccomend

have a great day