how to run a specific file if you have multiple files
So I have my mian code on main.py and then when I create another file lets say main2.py and I try to run code in it--> it will run initial main.py instead
Ofcourse I can create new replit but I want to run and test snippets in the same tab
This is actually quite easy.
Create a file named
.replit. Then, type the following into your code:
language = "python" is not needed, as it is already defined as the Repl language, so that part is unnecessary.
That's all, and hope you can mark it as answered!
You can run the file you want by using
.replit file. Create a file with no name and extension .replit and use the following code.
It will execute the file you want, specified in file="".