下划线加个括号 _("xxxxxx") 是什么意思?

Kernel_Don 2011-06-28 03:04:11
File "./btdownloadheadless.py", line 138
'(%s)' % (statistics['numSeeds'],
^
SyntaxError: invalid syntax

--------------------------------------------------------------------------
运行btdownloadheadless.py有以上出错提示,第138行如下:

self.seedStatus = _("%d seen now, plus %d distributed copies ") \
'(%s)' % (statistics['numSeeds'],
statistics['numCopies'], nextCopies)

错在哪里?下划线加个括号 _("xxxxxx") 是什么意思?
...全文
353 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
georgema 2011-06-30
  • 打赏
  • 举报
回复
一般把gettext在import的时候改名成_,这样代码看上去比较短
iambic 2011-06-28
  • 打赏
  • 举报
回复
调用名为_的函数,参数为"xxxxxx"。

37,743

社区成员

发帖
与我相关
我的任务
社区描述
JavaScript,VBScript,AngleScript,ActionScript,Shell,Perl,Ruby,Lua,Tcl,Scala,MaxScript 等脚本语言交流。
社区管理员
  • 脚本语言(Perl/Python)社区
  • WuKongSecurity@BOB
加入社区
  • 近7日
  • 近30日
  • 至今

试试用AI创作助手写篇文章吧