python3诅咒pad中的addstr在迭代循环中不显示

2024-06-17 11:13:32 发布

您现在位置:Python中文网/ 问答频道 /正文

用这些创建:

self.pads = []
self.pads.append( [ server, channel, curses.newpad(height - 2, width) ] )

问题函数:

def writepad(self, server, channel, message): # Write a line on-to pad, but do not switch pad_num (current pad)
    (height, width) = self.stdscr.getmaxyx() # Conserve code.
    self.stdscr.addstr('%s\n' % str(self.pads)) # debug
    for i in self.pads:
        if i.count(server) and i.count(channel):
            i[2].addstr('%s\n' % message)
            #i[2].refresh(1, 0, 0, 0, height - 2, width) # propably useless
            self.stdscr.addstr('debug: %s\n' % message)
    #self.stdscr.refresh() # propably useless

输出:

[['main', 'µIRC', <_curses.curses window object at 0x7f73ff5a6b70>]]
debug: use /connect <server address>[:<server port>]

问题:

Pad addstr没有打印任何可见的内容。我用的是python3.3。你知道吗


Tags: debugselfmessageservercountchannelwidthrefresh