比如
taskdata = "url=http%3A%2F%2Fzjcmpp.hexin.com.cn%2Fsoft%2FTHS_freeldy.exe&save_path=%2F&user=%s"%("csdnuser")
出现error: ValueError: unsupported format character
解决办法
taskdata = "url=http%3A%2F%2Fzjcmpp.hexin.com.cn%2Fsoft%2FTHS_freeldy.exe&save_path=%2F&user={0}".format("csdnuser")
参考:http://stackoverflow.com/questions/8856523/valueerror-unsupported-format-character-while-forming-strings
本文介绍了一种常见的Python编程错误——字符串格式化错误,并提供了解决方案。通过使用format方法,可以避免出现ValueError: unsupported format character的问题。
5472

被折叠的 条评论
为什么被折叠?



