a guest Jun 26th, 2019 64 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- #!/usr/bin/env python
- from tkinter import Tk
- from time import sleep
- from tkinter.messagebox import showwarning
- import win32com.client as win32
- warn = lambda app: showwarning(app, 'Exit?')
- RANGE = range(3, 8)
- def excel():
- app = 'Excel'
- xl = win32.gencache.EnsureDispatch('%s.Application' % app)
- ss = xl.Workbooks.Add()
- sh = ss.ActiveSheet
- xl.Visible = True
- sh.Cells(1, 1).Value = 'Python-to-%s Demo' % app
- for i in RANGE:
- sh.Cells(i, 1).Value = 'Line %d' % i
- sh.Cells(i + 2, 1).Value = "Th-th-th-that's all wolks!"
- if __name__ == '__main__':
RAW Paste Data