Skip to content
← Back to Community
main.py
Profile icon
DennisAnaniev

Hi!
Who knows why python execute all only in main.py
I created folder chapter 1 and one file inside this called strings.py.
But after click Run it doesn't work
Screenshot 2020-07-15 at 18.53.18

Voters
Profile icon
DennisAnaniev
Comments
hotnewtop
Profile icon
Coder100

Hello. Repl.it runs main.py by default.
You can configure that:
create a .replit file:

run="python Chapter1/strings.py"

Alternatively, you can just import it:

import Chapter1.strings
Profile icon
RobertCodeGit

@Coder100 same problem for me. If I understood correctly, I have to add an "import" line for every subfile I write, right?
Thanks

Profile icon
Bookie0

i think you have to import those files.
just do from file_name import * and replace the file name with the actual file name. the * means all.

happy coding and hope this helps! =)