iamkale,

TIL Python 3.12 introduces a new command line interface for simple querying of SQLite databases 🎉 🐍

python -m sqlite3 [-h] [-v] [filename] [sql]<br></br>

https://docs.python.org/3.12/library/sqlite3.html#sqlite3-cli

iamkale,

Oh cool, Python 3.12 now lets you call the uuid module as a CLI script to quickly generate UUID's 🤯🐍

$> python -m uuid<br></br>bd24079f-52d6-4777-8301-3341e21140ca<br></br>$> python -m uuid -u uuid3 -n @url -N blah<br></br>595259d0-5f26-31a4-8574-6857a5e58e55<br></br>

https://docs.python.org/3.12/library/uuid.html#uuid-cli

hugovk, (edited )
@hugovk@mastodon.social avatar

@iamkale This came up today, my colleague needed a one-off UUID and asked about the import, but I ran the python -m uuid CLI instead! 👍

RhetTbull,

@hugovk @iamkale @simon has an interesting post about some of these CLI gems in the standard library: https://til.simonwillison.net/python/stdlib-cli-tools

urda,
@urda@urda.social avatar

@iamkale I always liked being able to launch a local HTTP server via CLI and Python

iamkale,

@urda Good ol' python3 -m http.server

urda,
@urda@urda.social avatar

@iamkale fun fact: AWS internally scans Amazon and sent me a “don’t do that” InfoSec email once when I left one of those running for a week.

dichotomiker,
@dichotomiker@dresden.network avatar

@iamkale $> python -m <module_name> isn't new, is it?

iamkale,

@dichotomiker I'm highlighting new things you can do with that that weren't possible before 3.12

urda,
@urda@urda.social avatar

@iamkale ok this is cool 😎

venite,
@venite@mastodon.nl avatar

@iamkale this is brilliant! @hugovk

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