加载以下内容时(或 64 位 Windows 7 上 xchat 版本 2.8.9 的任何 python 脚本):
__module_name__ = "test.py"
__module_version__ = "0.666"
__module_description__ = "I AM AN EXPERT PROGRAMMER"
import xchat, random, string, re
def test(word, word_eol, userdata):
cmd = word[1]
text = open("E:\\xpy\\nickslol.txt","r")
for line in text:
line = line.rstrip("\r\n")
xchat.command("%s %s" % (cmd, line))
xchat.hook_command("test", test)
[02:31:14] ValueError: invalid \x escape [02:31:14] Module has no __module_name__ defined
请您参考如下方法:
Windows 路径名使用原始字符串:r"E:\xpy\nickslol.txt"
