I came along this
__date__ = "$Date: 2011/06$"
and found this in the docs
- $$ is an escape; it is replaced with a single $.
$identifier
names a substitution placeholder matching a mapping key of"identifier"
. By default,"identifier"
must spell a Python identifier. The first non-identifier character after the $ character terminates this placeholder specification.${identifier}
is equivalent to $identifier. It is required when valididentifier
characters follow the placeholder but are not part of the placeholder, such as"${noun}ification"
.
but I don't understand it.
Could someone explain in plain english what's the $
for and give some examples preferably?
Definition of have (someone) on a string informal. : to be able to make (someone) do anything one wants.
To feel happy and confident that everything will work out in one's favor and/or that one is in complete control.
Definition of string (Entry 1 of 3) 1a : a cord usually used to bind, fasten, or tie —often used attributively a string bag. b : something that resembles a string garnished with potato strings. 2a archaic : a cord (such as a tendon or ligament) of an animal body. b : a plant fiber (such as a leaf vein)
string noun (ROPE) B2 [ C or U ] (a piece of) strong, thin rope made by twisting very thin threads together, used for fastening and tying things: a package tied with string. a ball/piece of string.
To Python, those dollar signs mean nothing at all. Just like the 'D'
or 'a'
that follow, the dollar sign is merely a character in a string.
To your source-code control system, the dollar signs indicate a substitution command. When you check out a new copy of your source code, that string is replaced with the timestamp of the last committed change to the file.
Reference:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With