Quantcast
Channel: CodeSection,代码区,Python开发技术文章_教程 - CodeSec
Viewing all articles
Browse latest Browse all 9596

Google ignites Python library for command lines

$
0
0

Google ignites Python library for command lines

With its python Fire library, Google is offering Python developers a mechanism to easily generate command-line interfaces.

Newly available via open source, Python Fire turns code into a CLI without developers needing to do any more work, so it's easier to transition between theBash linux CLI and Python. Google engineers have already used Python Fire to produce CLI tools from Python libraries, including the Python Imaging Library and a tool in theGoogle Brain machine intelligence project that manages experiments equally from Python or Bash.

"You don't have to define arguments, set up help information, or write a main function that defines how your code is run," said Dave Bieber, a software engineer for Google Brain

Fire uses inspection to turn Python objects into a CLI that offers tab completion and documentation. Fire can be run on any object, including functions, classes, and modules. The tool can help debugging or exploring Python code and turning existing code into a CLI, and developers will find it easier to use a REPL via Fire. CLIs built with Fire come with an interactive mode. "Run the CLI with the `--interactive` flag to launch an iPython REPL with the result of your command," Bieber said.


Viewing all articles
Browse latest Browse all 9596

Trending Articles