Console is not giving output of the edited code

when i edit some code (hello world) on main.py file the code runs smoothly and the console is showing the output, but when i create a new file and i edit some code in this new file and tries to run the console it is giving the output of the previous file (main.py) eventually it is showing only the output of main.py file. Im a beginner and im just getting start with replit. https://replit.com/@PriyeshSingh7/First-code

Current behavior:

Desired behavior

Repl link:

code snippet

Hi @PriyeshSingh7 , welcome to the forums!
Only code in the main.py file will run. If you want to run other files, enter import <filename> in the main.py file. Note that you’ll have to change <filename> to the name of your file.
Hope this helps!
@PriyeshSingh7 E.g. import newprog

2 Likes

However, there is a way to change which file to run.

image


Change entrypoint = "main.py" to entrypoint = "<filename>.py". Note that you’ll have to change ‘’ to the name of your file.
Hope this helps!

1 Like

thanx for the reply pal, but im still not getting it, can you send me a video or tutorial or somethin like that in which i can actually see what to do exactly. As i told you im new here so can you plz coperate a lil bit more further.

i hope you understand.

You can take a look at this video I made:
https://www.canva.com/design/DAFptTqJQ1I/bYaf5qTGOpx_AhqiiqV__w/watch?utm_content=DAFptTqJQ1I&utm_campaign=designshare&utm_medium=link&utm_source=publishsharelink
Just click on it to watch it.

1 Like

@PriyeshSingh7 Do you understand it? If you need further help, feel free to ask.

@PriyeshSingh7 Can you try doing this:
import week-1/second?

all right leme try this

Well, You can rename the folder to week_1 then do:

from week_1 import second
1 Like

@PriyeshSingh7

import sys
sys.path.append("week 1")
import second
3 Likes

@PriyeshSingh7 I moved your topic from Code Help to Python

got it buddy, thank you vey much. Replit got an amazing helping peer group. :grinning:

1 Like

Well i dont have any idea about topics , i just posted the query anyhow.

1 Like

You can mark the post that helped you most as the Solution.

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