#๐Ÿ”’ if __name__==__main__ not working

17 messages ยท Page 1 of 1 (latest)

silent rose
#

im tryna learn ab ts if name==main thing and i following the code from the tutorial im watching but theyre getting the output while im getting an error, asked ai bout it but it couldn help me much

wheat furnaceBOT
#

@silent rose

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

cloud dock
silent rose
cloud dock
#

When you create a file it's state is already an empty file which you don't need to save, but after that any changes you make to it needs to be saved

silent rose
#

well i didn save my files each time i changed smth until now and it has always worked? until now as until where i am in the tutorial

cloud dock
#

You can see whether your file is unsaved by this

silent rose
#

yea i wondered what it was llol
but still why does this if name equals main gotta be saved but not all the other codes ive run on it? like ive learnt ab funcs loops lists n shi it doesn require to be saved?

cloud dock
#

You need to save your code before running any program, you must've saved them unknowingly or smt

tulip jacinth
#

All unsaved changes don't carry through

silent rose
#

well wtv it works now thanks :))

cloud dock
silent rose
#

oohh alrr thanks

pure ridge
#

@silent rose Click file top right then click auto save

wheat furnaceBOT
#
Python help channel closed for inactivity

This help channel has been closed. Feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.