Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Add a page to the documentation listing stdlib modules with a command-line interface (CLI) #109435

Copy link
Copy link
Closed
@vstinner

Description

@vstinner
Issue body actions

While reviewing PR #109152, I discover that the sqlite3 module has a command line interface. Maybe I knew and then I forgot.

Is there a a documentation page listing all modules with a command-line interface (CLI)? I don't know so.

By searching for main( pattern and for __main__.py files, so far, I found:

Some modules include self-tests in their main() function. I dislike that and I would suggest to remove it and at least move it to their test suite.

  • ctypes.util: self-test
  • ctypes.textpad: demo
  • curses.has_key: self-test?
  • dbm.__init__: get the DB type... but this CLI is not easy discoverable, it's in the init module!
  • getopt: self-test
  • heapq: self-test
  • shlex: print tokens. Is it really useful?
  • imaplib: self-test, "test the IMAP4_stream class"
  • modulefinder: self-test
  • netrc: just parse ~/.netrc if available, and then display nothing... not very useful
  • random: benchmark
  • smtplib: "Test the sendmail method", try to send an email to localhost SMTP server.
  • symtable: self-test. parse itself (symtable.py)
  • turtle: it's a demo. Looks more like an easter egg or advanced example than "an useful CLI".
  • textwrap: self-test
  • tkinter: self-test
  • wsgiref.simple_server: self-test, run a server, open itself in a browser, stop the server.
  • xml.sax.expatreader: Sheakspear easter egg.
  • xml.sax.xmlreader: self-test.
  • xmlrpc.client + xmlrpc.server: simple demo.

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsDocumentation in the Doc dirDocumentation in the Doc dir

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.