本文整理汇总了Python中com.aurellem.gb.Gb.nwritePNG方法的典型用法代码示例。如果您正苦于以下问题:Python Gb.nwritePNG方法的具体用法?Python Gb.nwritePNG怎么用?Python Gb.nwritePNG使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.aurellem.gb.Gb
的用法示例。
在下文中一共展示了Gb.nwritePNG方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: screenshot
# 需要导入模块: from com.aurellem.gb import Gb [as 别名]
# 或者: from com.aurellem.gb.Gb import nwritePNG [as 别名]
def screenshot(filename, literal=False):
"""
Saves a PNG screenshot to the file at filename. Use literal if you want to
store it in the current directory. Default is to save it to screenshots/
under the project.
"""
screenshots_path = os.path.join(project_path, "screenshots/")
filename = os.path.join(screenshots_path, filename)
if len(filename) < 4 or filename[-4:] != ".png":
filename += ".png"
Gb.nwritePNG(filename)
print "Screenshot saved to: " + str(filename)