Ask coding questions

← Back to all posts
How to delete main.py or change the default execution file?
TeamAthena (4)

How to delete main.py or change the default execution file?

Comments
hotnewtop
RAYYANCYCLEGAR (6)

Hey, I know this was asked a while ago, but for any people who visit this question in the future, you can use

import os
os.rename('/home/runner/[Your project name]/main.py', 'yourfilename.py')
elHuracan101 (0)

import os
os.remove('main.py')

Highwayman (1482)

Oh also, if you want to just change the file of execution, then use a .replit file (https://docs.repl.it/repls/dot-replit)
repl.it has a handy executable called run-project that you might want to take a look at for that..

Highwayman (1482)

Actually... maybe you can.. if you go on share and click hot, code100’s empty repl should still be there. Just fork it, go in the console and type touch main_filename. where main_filename is the file you want to be your file. Then just put your stuff in the file created That might work

Highwayman (1482)

@Highwayman actually, no you can’t fork his repl. But you probably can still make an empty repl the way he shows you and then put in a .replit and all that.

ash15khng (721)

Sadly you can't do that on repl.it