摘要: ``` def setText(aString): clip.OpenClipboard() clip.EmptyClipboard() clip.SetClipboardData(con.CF_UNICODETEXT, aString) clip.CloseClipboard() ``` 阅读全文
posted @ 2017-03-22 10:07 idlewith 阅读(191) 评论(0) 推荐(0) 编辑
摘要: ``` self.text.bind("", self.selectText) self.text.bind("", self.selectText) ``` ``` def selectText(self, event): self.text.tag_add('sel', '1.0', 'end') return 'break' ``` 阅读全文
posted @ 2017-03-22 10:06 idlewith 阅读(415) 评论(0) 推荐(1) 编辑
摘要: ``` def to_short_with(long_name): head = long_name.split(' ')[0] tail = long_name.split(' ')[-1] return head[0].lower() + tail.lower() ``` 阅读全文
posted @ 2017-03-22 10:06 idlewith 阅读(106) 评论(0) 推荐(0) 编辑
摘要: ``` def center_window(self, cont, width, height): screenwidth = cont.winfo_screenwidth() screenheight = cont.winfo_screenheight() size = "%sx%s+%s+%s" % ( width... 阅读全文
posted @ 2017-03-22 10:01 idlewith 阅读(265) 评论(0) 推荐(0) 编辑