Skip to content

A PyPI port of the infamous left-pad npm package.

License

Notifications You must be signed in to change notification settings

cglwn/leftpad-pypi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

leftpad

Left pad a string in Python. Created to try out making a pip package and uploading it to the Python Package Index (PyPI). Inspired by the left-pad package on npm which broke parts of the internet.

Install

pip install leftpad

Usage

from leftpad import left_pad

left_pad("foo", 5)
// => "  foo"

left_pad("foobar", 6)
// => "foobar"

left_pad(1, 2, '0')
// => "01"

left_pad(17, 5, 0)
// => "00017"

Testing

Run python -m doctest leftpad.py.

About

A PyPI port of the infamous left-pad npm package.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages