hugovk,
@hugovk@mastodon.social avatar

🎲 Do you like Python's little CLIs? For example:

$ python -m http.server
$ python -m webbrowser example_url
$ python -m uuid
$ python -m calendar

What about adding one to random?

$ python -m random curry "fish n chips" tacos
curry

$ python -m random 6
6

$ python -m random 2.5
1.6423361547011504

Give your feedback on my proposal at
https://discuss.python.org/t/command-line-interface-for-the-random-module/51304

If there's support we might be able to get it into 3.13 before May's beta cutoff! 🤞

0xdefec7edcafe,
@0xdefec7edcafe@piaille.fr avatar

@hugovk i often use python3 -m antigravity

jpmens,
@jpmens@mastodon.social avatar

deleted_by_author

fcodvpt,
@fcodvpt@framapiaf.org avatar

@jpmens @hugovk "python -m uuid : New in version 3.12", a reason to get a newer Python version :D

hugovk,
@hugovk@mastodon.social avatar

@fcodvpt @jpmens Also improved ‘Did you mean …’ suggestions for exceptions and lots more! https://docs.python.org/3/whatsnew/3.12.html

darac,
@darac@furry.engineer avatar

@hugovk I do like them. rich uses that idea as a demo area (e.g. python -m rich.progress) so I think it's a good place to put some functionality (e.g. Pick a random number) without getting too worked up about exposing all the bells and whistles.

hugovk,
@hugovk@mastodon.social avatar

@darac Ah yes, I really like how Rich shows demos like that. I copied it for python -m termcolor :)

I fully agree about keeping it simple, we don't need to expose the bells and whistles like random.vonmisesvariate(mu, kappa)

veronica,
@veronica@mastodon.online avatar

@hugovk Never used those actually. I have at least one ipython terminal open at any given time. It is my default calculator! 😊

  • All
  • Subscribed
  • Moderated
  • Favorites
  • python
  • DreamBathrooms
  • magazineikmin
  • tacticalgear
  • InstantRegret
  • ngwrru68w68
  • Durango
  • Youngstown
  • slotface
  • mdbf
  • rosin
  • PowerRangers
  • kavyap
  • thenastyranch
  • vwfavf
  • anitta
  • hgfsjryuu7
  • cisconetworking
  • osvaldo12
  • everett
  • ethstaker
  • GTA5RPClips
  • khanakhh
  • tester
  • modclub
  • cubers
  • Leos
  • normalnudes
  • provamag3
  • All magazines