How to change main.py file from run

Question:

currently when I click on run it only runs main.py file not another one. how do I change the default file from main.py to something else.

Screenshots, links, or other helpful context:

code snippet

Hey @harishmantri1!

Just click the next to “Files” then click “Show hidden files”. Next click on the .replit file and finally you can change the entrypoint to whatever file you want to run.

Images

Dots

Show hidden files

edited

You should also see the docs on how to configure a Repl: https://docs.replit.com/programming-ide/configuring-repl

And if you want to run the last edited file, take a look at this post:

If this answers your question, you can mark this post as a Solution.

3 Likes

Hi, where is the

I can’t find it. Is it possibl that the explanation works only for some older version?

On desktop, it’s on the top right in the sidebar.
If you’re on mobile, please edit the tags on your topic to reflect that. There, I think it’d be on the top right of whatever panel you access the file tree from.

1 Like

@HatidzaSerdare1 isn’t OP

2 Likes

This is how it looks for me. Could you please circle it?

Click the button in the upper-left corner of the Repl, that’ll reveal the sidebar.

Also, you cannot have spaces in variable names, so that code will not run.

2 Likes

I appreciate the remark about the space, it is a part of the course where they give you a ‘broken code’ and you have to fix it, in this case the mistake was the space.

I have finally found the sidebar and managed to run the program. Is this (changing the entrypoint in the .replit) the only way to switch from one file running to the other? Because it seems rather impractical. I wish there was a way to keep two programes together and be able to switch between them just by clicking which one you want to run, without having to edit the .replit code… :smiling_face_with_tear:

It has already been proposed to add such a feature, but a similar function has not been added.

1 Like

If that’s what you want, you could do this:

1 Like

I greatly appreciate both of your replies
I guess I’ll just open a new file next time hahaha

wait what do you mean

1 Like

Instead of
image

I’ll open entire new document haha

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.