Mark Smith - Writing Awesome Command-Line Programs in Python смотреть онлайн
Mark Smith - Writing Awesome Command-Line Programs in Python
[EuroPython 2014]
[24 July 2014]
Command-Line programs can have a lot to them - usually more than you think, yet often suffer from a lack of thought.
This is a tour through how to structure your code, tools in the standard library and some 3rd party libraries. Take your command-line programs to the next level!
-----
Python is a great language for writing command-line tools - which is why so much of Linux is secretly written in Python these days. Unfortunately, what starts as a simple script can quickly get out of hand as more features are added and more people start using it!
The talk will consist of a tour through various useful libraries and practical code showing how each can be used, and include advice on how to best structure simple and complex command-line tools.
Things to consider when writing command-line apps:
* Single-file vs Multiple-file
* Standard library only vs. 3rd party requirements
* Installation - setup.py vs. native packaging
The different parts of a command-line program:
* Option Parsing:
* Libraries: getopt, optparse, argparse, docopt
* Sub-commands
* Configuration:
* Formats: Ini file, JSON, YAML
* Where should it be stored (cross-platform);
* Having multiple configuration files, and allowing user config to override global config
* Output:
* Colour - colorama
* Formatting output for the user
* Formatting output for other programs
* How do you know when your output is being piped to another program?
* Managing logging and verbosity
* Managing streamed input
* Exit values: What are the conventions?
* Interactive apps - REPL
* Structuring a bunch of programs/commands around a shared codebase.
* Command-line frameworks: clint, compago & cliff
* Testing command-line apps
* Writing command-line tools in Python 3 vs Python 2
Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «Mark Smith - Writing Awesome Command-Line Programs in Python» бесплатно и без регистрации, вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.
Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.
Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!
Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.