我正在尝试使用以下结构构建样式表:
.something-[content_name]:before {
content: '[unicode_string]';
}
对于样式表,Unicode字符串遵循以下模式:
/f[0-9a-z][0-9a-z][0-9a-z]
以及一组具有以下结构的SVG:
<glyph unicode="[unicode_string]" d="some_path" />
我有要作为内容插入的内容列表,并且我需要一种方法来遍历并为内容分配unicode值。
我想在移动到下一个位置之前,先在每个位置迭代0-9,然后再重复az(仅小写),结果是:
, ,  ... 
, ,  ... ༀz
, ,  ... , , ,  ... ༁z
, , ð ... , , ,  ... ༁z
代/
的&#x
是不是一个问题,我只是想知道通过这样的方式来循环的最佳方式。
您在寻找itertools.product吗?
import string, itertools
for p in itertools.product(string.digits + string.ascii_lowercase, repeat=3):
print '' + ''.join(p)
对于十六进制数字,只需遍历0123456789abcdef
:
for p in itertools.product('0123456789abcdef', repeat=3):
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句