Skip to content

yegle/fstring

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fstring

Build Status PyPI - Python Version PyPI version

Alows easy python usage of strings.

Usage

pip install fstring

from fstring import fstring
x = 1
y = 2.0
plus_result = "3.0"
print fstring("{x}+{y}={plus_result}")  # Prints: 1+2.0=3.0

Also supports evaluation

print fstring("1+1 is {1+1}")

Now you don't need to format your strings with %s %r or %d, or even number them by order of appearance. you can just call them by their name which makes your code so so so much more readable!

instead of print "Hello, %s :) What a nice %s?" % (username, time_of_day)

how about print fstring("Hello {username} :), What a nice {time_of_day}?")?

About

PEP 498 Python 2.7 Backport

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%