Ask coding questions

← Back to all posts
Code is not running
Avangunite

Hello, I have a file called solver.py that is not executing any code when run. The main.py however works. Any help would be appreciated.

Voters
aQwilyas
Avangunite
Comments
hotnewtop
Coder100

Three ways

1. Manually executing the other file

Hit ctrl+shift+s, then put:

2. Importing the other file

Inside main, add:

3. Adding a .replit file

Create a .replit file, and put:

GABELACANLALE

Hi, you can just import it.

Then the code should run

RYANTADIPARTHI

Run

There are two things. Either make a replit file, or a makefile and you can just do:

Or you can just import it from there, and use it. But these are alternatives.
That should work

PattanAhmed

@Avangunite Hi,
The Repl.it automatically runs the main.py file first.
If you want to execute the second file then, there are some different ways.
The easiest way just goes like this:-

  1. Create a .replit file
  2. Add:-

Make sure that it will not anywhere except on Repl.it platforms.

That's it
Thanks!

Hope this helps!

Wumi4

Hi!

You can use the os library to execute it, like this:

Or run it independently on the Terminal (Use Ctrl+Shift+S):