[Errorno 2] No such file or directory

(insert file path to python3): cant open file (insert file to main.py instead) [Errno 2] No such file or directory

my file was made in python and im using web browser and im on mobile. just thought that might help.

also if there was a topic about this and it has been solved or something please tell me how i can find it.

def func(string, p_t):
  try:
    string + 'str'
    for l in string:
      if l == str(p_t):
        return True
      else:
        return False
  except:
    print('func: First input is not a string')

func('test-', '-')

ive shown my code of the file because it doesnt happen on my other repl’s

Could you please link to your Repl? It seems like you might have renamed the main.py file, causing this issue.

1 Like

okay then
link: https://replit.com/@andwazern/repl-5#file.py

Replit will always run main.py, by default.
To change this, click three dots and Show hidden files, then open .replit, and change entrypoint to the file you want to run.
(Alternatively, you can rename your file back to main.py .)

2 Likes

thanks, it works NuclearPasta0

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