Skip to main content

Advanced String Formatting for Python >= 2.4

Project description

StringFormat is an independent port of the Python 3 advanced string formatting, compatible with Python >= 2.4. This implementation is pure Python.

Add the method str.format only if it is missing (Python < 2.6):

import stringformat

stringformat.init()

Enable auto-numbering fields ("{} {}" instead of "{0} {1}") with Python 2.6 also:

import sys
import stringformat

if sys.version_info < (2, 7):
    stringformat.init(True)

The advanced string formatting is officially included in the language since Python 2.6.

http://docs.python.org/whatsnew/2.6.html#pep-3101-advanced-string-formatting

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

StringFormat-0.4.tar.gz (10.7 kB view details)

Uploaded Source

File details

Details for the file StringFormat-0.4.tar.gz.

File metadata

  • Download URL: StringFormat-0.4.tar.gz
  • Upload date:
  • Size: 10.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for StringFormat-0.4.tar.gz
Algorithm Hash digest
SHA256 a6b0c5dfe62e46cf4cc6ece7bcecaa5412fa938ccc1d826f151b22d27be74d48
MD5 14d1937ca147150b51f943e7efa373a6
BLAKE2b-256 0ef61ebfb6d511ac9041f03932ddb7dd0247baaba9f815db59dda5a2737e904c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page