.replit run not updating

I have a .replit file.
Updated the run command from
run = "python3 main.py"

to
run = "python3 main.py input.md"

And trying to run

filename = sys.argv
print(filename)

Running the command manually in the shell gives the expected output:
['main.py', 'input.md']

But hitting the run button still outputs:
['main.py']

How do you get .replit to update the run command?

SOLUTION:

Per the comment above the run command, I commented out the interpreter field a few lines below the run command. And after the shell reloaded the run command worked as expected.

Leaving this here for posterity.

1 Like

You need to change the entrypoint in the .replit file, as the comment on line one states.

Please mark this post as the solution so the thread can close.

1 Like

The .replit configuration works:

# The command that runs the program. If the interpreter field is set, it will have priority and this run command will do nothing
run = ["python3", "main.py", "input.md"]

# The primary language of the repl. There can be others, though!
language = "python3"
entrypoint = "main.py"

How will changing the entrypoint be an improvement over the current change from this…

run = "python3 main.py"

to this?

run = ["python3", "main.py", "input.md"]

What exactly is the alternate entrypoint solution you propose?
And why is it better?

Thanks.

2 Likes

Changing the entrypoint means that you do not have to comment out the interpreter lines, and it will still run the specified file.

2 Likes

they want to pass the argument input.md to main.py (like, python main.py input.md in Shell), not ‘run’ input.md. So their own post is the solution.

3 Likes

Thanks for highlighting @UMARismyname - I’ve updated the solution.

2 Likes

So are you suggesting changing the entrypoint to

entrypoint = ["main.py", "input.md"]

?

If so, do you comment out the run command or change it in some way?

What’s the benefit of not commenting out the interpreter?
Why is that a better solution?

I’m open to alternate ideas if:

  1. I can see a code sample (so I can test it)
  2. I understand why the tradeoffs are more favorable than another solution.

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