Archive

Posts Tagged ‘stdlib’

Standard modules as standalone programs

September 5, 2013 1 comment

The following tips are from this presentation.

Encode a file in base64:

python -m base64 some_file

Open a URL in the browser:

python -m webbrowser http://google.com

List of functions in a file:

python -m pyclbr some_file.py
python -m pyclbr module_name

See the rest of the stdlib modules in /usr/lib/python/.

Categories: python Tags: ,
Design a site like this with WordPress.com
Get started