Skip to main content

Reverse Printf

Project description

pypi-version License

Reverse Printf.

I dont understand

Look this code (python):

>>> print("%2d%2d" % (19, 81))

Oh well, but what’s happen if I need revert the number 1981 to original 19 and 81?:

$ echo "1981" | reverpf "%2d%2d"

Of course, only works in fixed print.

System requirements

  • Python3


I do not know if the printf of C is a standard, but it seems that the python works the same.


$ pip install reverpf



usage: reverpf [-h] -f FORMAT [-i FILE] [-s SEPARATOR] [-v]

optional arguments:
  -h, --help            show this help message and exit
  -f FORMAT, --format FORMAT
                        Format from printf
  -i FILE, --input-file FILE
                        File input
  -s SEPARATOR, --separator SEPARATOR
                        Separator string
  -v, --version         show program's version number and exit


# From stdin
$ echo "1981" | reverpf -f "%2d%2d"

# From file
$ reverpf -f "%2d%2d" -i file.txt -s "|"



Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

reverpf-0.6.1.tar.gz (4.9 kB view hashes)

Uploaded source

Built Distribution

reverpf-0.6.1-py3-none-any.whl (6.8 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page