2004年03月17日 星期三 13:53
'\xff'*length_of_string就可以 ======== 2004-03-17 12:00:14 您在来信中写道: ======== 如何比较方便的获得"\xff\xff\xff\xff\xff.....\xff\xff"这种很多重复字符的字符串? 我现在的用法是 s = ''.zfill(length_of_string).replace('0', the_sub_string) 可以用,但想知道有没有更直接、更高效的用法? 谢谢! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.exoweb.net/pipermail/python-chinese/attachments/20040317/4dcef3a3/attachment.html
2004年03月17日 星期三 14:17
应该是'\\xff'*length_of_string 必须对\进行逃逸 ----- Original Message ----- From: 贾利亚 To: python-chinese at lists.python.cn Sent: Wednesday, March 17, 2004 1:53 PM Subject: Re: [python-chinese] How to get a filled string? '\xff'*length_of_string就可以 ======== 2004-03-17 12:00:14 您在来信中写道: ======== 如何比较方便的获得"\xff\xff\xff\xff\xff.....\xff\xff"这种很多重复字符的字符串? 我现在的用法是 s = ''.zfill(length_of_string).replace('0', the_sub_string) 可以用,但想知道有没有更直接、更高效的用法? 谢谢! ------------------------------------------------------------------------------ _______________________________________________ python-chinese list python-chinese at lists.python.cn http://python.cn/mailman/listinfo/python-chinese -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.exoweb.net/pipermail/python-chinese/attachments/20040317/d2c0cbba/attachment.htm
Zeuux © 2024
京ICP备05028076号