本文整理匯總了Python中caca.canvas.Canvas.wherey方法的典型用法代碼示例。如果您正苦於以下問題:Python Canvas.wherey方法的具體用法?Python Canvas.wherey怎麽用?Python Canvas.wherey使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類caca.canvas.Canvas
的用法示例。
在下文中一共展示了Canvas.wherey方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_gotoxy
# 需要導入模塊: from caca.canvas import Canvas [as 別名]
# 或者: from caca.canvas.Canvas import wherey [as 別名]
def test_gotoxy(self):
""" module canvas: Canvas.gotoxy()
"""
cv = Canvas(10, 10)
cv.gotoxy(5, 5)
self.assertEqual((5, 5), (cv.wherex(), cv.wherey()))
self.assertRaises(CanvasError, cv.gotoxy, "a", 9)
self.assertRaises(CanvasError, cv.gotoxy, 9, "a")
示例2: test_wherey
# 需要導入模塊: from caca.canvas import Canvas [as 別名]
# 或者: from caca.canvas.Canvas import wherey [as 別名]
def test_wherey(self):
""" module canvas: Canvas.wherey()
"""
cv = Canvas(10, 10)
self.assertEqual(0, cv.wherey())