GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Command-line interface for the `random` module · Issue #118131 · python/cpython Closed Labels 3.13only security fixesonly security fixesstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancementA feature request or enhancement DescriptionFeature or enhancementProposal:Many stdlib libraries have a simple CLI: Some of my favourites: $ python3 -m http.server Serving HTTP on :: port 8000 (http://[::]:8000/) ... $ python3 -m webbrowser https://www.python.org $ python3 -m uuid 5f73cb76-01d7-4390-8cda-17fe9672a29f $ python3 -m calendar 2024 January February March Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su 1 2 3 4 5 6 7 1 2 3 4 1 2 3 [snip] It would be useful to add a CLI to $ python3 -m random curry "fish n chips" tacos fish n chips We can also print a random number:
For example: $ python3 -m random a b c c $ python3 -m random 6 4 $ python3 -m random 2.5 1.9597922929238814 Also with explicit arguments: $ python3 -m random --choice a b c b $ python3 -m random --integer 6 6 $ python3 -m random --float 2.5 1.1778540129562416 $ python3 -m random --float 6 1.4311142568750403 This isn't a Python-specific tool, like For me, just the random choice is the most important, but I can see at least picking a random integer is also useful, like a dice throw. Currently, Has this already been discussed elsewhere?I have already discussed this feature proposal on Discourse Links to previous discussion of this feature:
Linked PRsReacted by Kirill Podoprigora, sobolevn, blhsing, An Long, iforapsy and Erlend E. Aasland Activity
MetadataMetadataAssigneesLabels3.13only security fixesonly security fixesstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancementA feature request or enhancement ProjectsMilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |