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
linoman_zz (5)

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

https://repl.it/@linoman_zz/coding

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

Commentshotnewtop
mat1 (2513)

You need to add the .py extension for a file to be read as a Python file. Then, you can run it from main.py (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!

linoman_zz (5)

@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

abc3354 (111)

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 : https://repl.it/@timmy_i_chen/multi-files-demo

linoman_zz (5)

@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