def put(self, x, y, text, fg, bg):
"""
Puts a string at the desired coordinates using the provided colors.
:param x: X position
:param y: Y position
:param text: Text to write
:param fg: Foreground color number
:param bg: Background color number
"""
self.mutex.acquire()
if x < self.width and y < self.height:
try:
self.screen.addstr(int(y), int(x),
symbols.encode(text),
self.pairs[fg, bg])
except curses.error:
# Ignore out of bounds error
pass
self.mutex.release()
评论列表
文章目录