Main( ) in a file in my library?

How to run code from a file in my library without copying it to main()-file?

def add(a,b):
  return a+b
def main():
if __name__ == '__main__':

Hey @beahus, welcome to the forums!

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.



Show hidden files


You should also see the docs on how to configure a Repl:

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

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

1 Like

Welcome to Ask! You can change the file to run as NateDhaliwal suggested or you can import and run other Py files in the same way you would a library.

1 Like