“Jeśli nazwa == Main” Kod odpowiedzi

__name __ == __main__ w Python

# If the python interpreter is running that module (the source file)
# as the main program, it sets the special __name__ variable to have
# a value “__main__”. If this file is being imported from another 
# module, __name__ will be set to the module’s name.
if __name__=='__main__':
  # do something
Noobie Nareshhhh

Jeśli __name __ == '__ main__':

if __name__=='__main__':
Blue-eyed Bat

Co jeśli __name _ == "_ main__": zrobić?

basically,   (__name__ == '__main__') ==True

confirms file is NOT a/part of a module and may continue execution  
ruperto2770

Jeśli __name__ == '__main__'

#This is a way of executing your code if it runs directly from your system.
#This means that your code was not 'imported', but executed directly.

if __name__ == "__main__":
	#execute my code...
Chinedu Francis Ozurumba

Jeśli nazwa == Main

# The code in this 'if' statement runs only if current file is the
# the main file. Mean this if statement code will not run if you import
# that file into other program.

if __name__ == '__main__':
Hammad Zafar

Odpowiedzi podobne do “Jeśli nazwa == Main”

Pytania podobne do “Jeśli nazwa == Main”

Więcej pokrewnych odpowiedzi na “Jeśli nazwa == Main” w Python

Przeglądaj popularne odpowiedzi na kod według języka

Przeglądaj inne języki kodu