Cargando…

Robust Python CLI.

Build a robust Python CLI tool with argparse The argparse module is part of the Python standard library and meant to help you build robust command line tools. Once you need flags, switches, values, or positional arguments, it is very difficult to achieve that without using a framework. In this case,...

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_on1302643601
003 OCoLC
005 20231017213018.0
006 m o c
007 vz czazuu
007 cr cnannnuuuuu
008 220309s2022 xx 009 o vleng d
040 |a ORMDA  |b eng  |e rda  |e pn  |c ORMDA  |d OCLCO  |d OCLCF 
024 8 |a 50129VIDEOPAIML 
035 |a (OCoLC)1302643601 
037 |a 50129VIDEOPAIML  |b O'Reilly Media 
050 4 |a QA76.73.P98 
082 0 4 |a 005.26/2  |2 23 
049 |a UAMI 
245 0 0 |a Robust Python CLI. 
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 (9 min.)) :  |b sound, color. 
306 |a 000900 
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, presenter. 
520 |a Build a robust Python CLI tool with argparse The argparse module is part of the Python standard library and meant to help you build robust command line tools. Once you need flags, switches, values, or positional arguments, it is very difficult to achieve that without using a framework. In this case, argparse can help build all you need to handle inputs in the terminal. We'll see how a single file named size.py that calculates file sizes can make use of argparse to handle the input in the terminal. Then, we will cover how error handling is done automatically when the expectations from argparse aren't met. And finally, we'll go through some of the help menu options that construct the body of the help output. Check the resources section for the GitHub repo with sample code Why would you want to use argparse Since argparse is part of the Python standard library, there is no need for you to define or install any external dependencies. You are ensuring that any Python installation in any system will work correctly out of the gate. A very basic Python CLI tool without dependencies using the argparse module Next steps Now that you know how to enhance a Python script into a more powerful one with argparse, you can try out other frameworks like the Click framework or something much simpler by using the sys module. I have examples and guides for the sys.argv module and for using the Click framework. Useful links and resources GitHub repo with sample code Build Python applications from scratch Setup your Data Science environment with VSCode. 
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/~/50129VIDEOPAIML/?ar  |z Texto completo (Requiere registro previo con correo institucional) 
994 |a 92  |b IZTAP