Cargando…

What is __name__ for in Python.

What is the if __name__ condition in Python for? If you've seen __main__ at the end of a Python script and wondered why that is there it is to avoid side effects when importing and allowing you to run the file as a script on the terminal. If you want more details, watch this short video where w...

Descripción completa

Detalles Bibliográficos
Clasificación:Libro Electrónico
Formato: Electrónico Video
Idioma:Inglés
Publicado: [Place of publication not identified] : Pragmatic AI Solutions, [2022]
Edición:[First edition].
Temas:
Acceso en línea:Texto completo (Requiere registro previo con correo institucional)

MARC

LEADER 00000cgm a22000007i 4500
001 OR_on1302646414
003 OCoLC
005 20231017213018.0
006 m o c
007 vz czazuu
007 cr cnannnuuuuu
008 220309s2022 xx 004 o vleng d
040 |a ORMDA  |b eng  |e rda  |e pn  |c ORMDA  |d OCLCO  |d OCLCF 
024 8 |a 50130VIDEOPAIML 
035 |a (OCoLC)1302646414 
037 |a 50130VIDEOPAIML  |b O'Reilly Media 
050 4 |a QA76.73.P98 
082 0 4 |a 005.13/3  |2 23 
049 |a UAMI 
245 0 0 |a What is __name__ for in Python. 
250 |a [First edition]. 
264 1 |a [Place of publication not identified] :  |b Pragmatic AI Solutions,  |c [2022] 
300 |a 1 online resource (1 video file (4 min.)) :  |b sound, color. 
306 |a 000400 
336 |a two-dimensional moving image  |b tdi  |2 rdacontent 
337 |a computer  |b c  |2 rdamedia 
338 |a online resource  |b cr  |2 rdacarrier 
344 |a digital  |2 rdatr 
347 |a video file  |2 rdaft 
380 |a Instructional films  |2 lcgft 
511 0 |a Alfredo Deza, publisher. 
520 |a What is the if __name__ condition in Python for? If you've seen __main__ at the end of a Python script and wondered why that is there it is to avoid side effects when importing and allowing you to run the file as a script on the terminal. If you want more details, watch this short video where we work with a Python script to find out those side effects and how the Python script can change once the if condition with __name__ is done at the end. Next Steps Now that you know about the conditional at the end, you might want to explore writing Python scripts that use this trick. There are several examples you can follow in these GitHub repositories with argparse, the Click framework and using sys.argv: argparse GitHub repo examples sys.argv GitHub repo examples Build Python applications from scratch. 
588 0 |a Online resource; title from title details screen (O'Reilly, viewed March 9, 2022). 
590 |a O'Reilly  |b O'Reilly Online Learning: Academic/Public Library Edition 
650 0 |a Python (Computer program language) 
650 0 |a Computer programming. 
650 6 |a Python (Langage de programmation) 
650 6 |a Programmation (Informatique) 
650 7 |a computer programming.  |2 aat 
650 7 |a Computer programming.  |2 fast  |0 (OCoLC)fst00872390 
650 7 |a Python (Computer program language)  |2 fast  |0 (OCoLC)fst01084736 
655 2 |a Webcast 
655 7 |a Instructional films.  |2 fast  |0 (OCoLC)fst01726236 
655 7 |a Internet videos.  |2 fast  |0 (OCoLC)fst01750214 
655 7 |a Nonfiction films.  |2 fast  |0 (OCoLC)fst01710269 
655 7 |a Instructional films.  |2 lcgft 
655 7 |a Nonfiction films.  |2 lcgft 
655 7 |a Internet videos.  |2 lcgft 
655 7 |a Films de formation.  |2 rvmgf 
655 7 |a Films autres que de fiction.  |2 rvmgf 
655 7 |a Vidéos sur Internet.  |2 rvmgf 
700 1 |a Deza, Alfredo,  |e presenter. 
710 2 |a Pragmatic AI Solutions (Firm),  |e publisher. 
856 4 0 |u https://learning.oreilly.com/videos/~/50130VIDEOPAIML/?ar  |z Texto completo (Requiere registro previo con correo institucional) 
994 |a 92  |b IZTAP