Skip to content
How do I change which file to run?
Profile icon
STEPHENYOON1057

When I tried to run my files after renaming them, it just said "No such file: main.py
repl process died unexpectedly: exit status 2?"
How do I change this so that it runs the renamed files?

You are viewing a single comment. View All
Profile icon
Bookie0

What do we have to input to get that error? Also to run your file, you have to do:

from file_name import * # imports everything from that file # or from file_name import module_name # you can imports variables, functions, etc.

Is this what you wanted? Not quite sure.. :)

Profile icon
STEPHENYOON1057

@Bookie0

So the default name of the file is main.py, right? I changed it to main1.py, and it shows an error that there's "no such file: main.py." How do I fix this issue, so that it would run even if the file name's not main.py?

Profile icon
Bookie0

@STEPHENYOON1057
yep, default is main.py. And iirc you can't change the main.py file to something else. Also why do you need to run a file that isn't main,py?