Entry tags:
(no subject)
>>> nlist_def = "%s:list:%s"
>>> prefix = "special:active"
>>> nlist_def % prefix
правильно!
Traceback (most recent call last):
File "", line 1, in <module>
nlist_def % prefix
TypeError: not enough arguments for format string
Но я не отчаялся.
>>> nlist_def % (prefix, '%s')
3: 'special:active:list:%s'
>>> prefix = "special:active"
>>> nlist_def % prefix
правильно!
Traceback (most recent call last):
File "", line 1, in <module>
nlist_def % prefix
TypeError: not enough arguments for format string
Но я не отчаялся.
>>> nlist_def % (prefix, '%s')
3: 'special:active:list:%s'