This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import wx | |
| class FrameOne(wx.Frame): | |
| def __init__(self): | |
| wx.Frame.__init__(self, None, title='Frame 1') | |
| self.Bind(wx.EVT_CLOSE, self.on_close) | |
| def on_close(self, event): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import wx | |
| app = wx.App(False) | |
| frame = wx.Frame(None, wx.ID_ANY, "Hello World") | |
| icon = wx.Icon("py.ico") | |
| frame.SetIcon(icon) | |
| frame.Show() | |
| app.MainLoop() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| import shutil | |
| def copy_files_from_file(file_path): | |
| with open(file_path) as f: | |
| for line in f: | |
| dirname, filename = os.path.dirname(line), os.path.basename(line) | |
| proj_dir = os.path.join(dirname, 'ProjectData') | |
| if os.path.exists(proj_dir): | |
| shutil.move(match, os.path.join(proj_dir, filename)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| import shutil | |
| def move_file_type_v2(path, ftype, excludes): | |
| matches = glob.glob('{}/**/*{}'.format(path, ftype), recursive=True) | |
| for match in matches: | |
| dirname, filename = os.path.dirname(match), os.path.basename(match) | |
| if dirname not in excludes: | |
| proj_dir = os.path.join(dirname, 'ProjectData') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import wx | |
| class WizardPage(wx.Panel): | |
| """""" | |
| def __init__(self, parent, title=None): | |
| """Constructor""" | |
| wx.Panel.__init__(self, parent) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # eanbc_demo.py | |
| from reportlab.graphics.barcode import eanbc | |
| from reportlab.platypus import SimpleDocTemplate | |
| from reportlab.platypus import Paragraph | |
| from reportlab.lib.styles import getSampleStyleSheet | |
| def eanbc_demo(barcode_value): | |
| doc = SimpleDocTemplate('eanbc_demo.pdf') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle | |
| from reportlab.platypus import SimpleDocTemplate, Paragraph | |
| from reportlab.platypus import PageBreak | |
| from reportlab.platypus.tableofcontents import TableOfContents | |
| def simple_toc(): | |
| doc = SimpleDocTemplate("simple_toc.pdf") | |
| story = [] | |
| styles = getSampleStyleSheet() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import wx | |
| #---------------------------------------------------------------------- | |
| # BEGIN Demo Code | |
| class FindPrefixListBox(wx.ListBox): | |
| def __init__(self, parent, id, pos=wx.DefaultPosition, size=wx.DefaultSize, | |
| choices=[], style=0, validator=wx.DefaultValidator): | |
| wx.ListBox.__init__(self, parent, id, pos, size, choices, style, validator) | |
| self.typedText = '' | |
| self.log = parent.log |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import wx | |
| from ObjectListView import ObjectListView, ColumnDefn | |
| class Book(object): | |
| """ | |
| Model of the Book object | |
| Contains the following attributes: | |
| 'ISBN', 'Author', 'Manufacturer', 'Title' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import wx | |
| import wx.lib.scrolledpanel as scrolled | |
| class MainPanel(scrolled.ScrolledPanel): | |
| def __init__(self, parent): | |
| scrolled.ScrolledPanel.__init__(self, parent) | |
| main_sizer = wx.BoxSizer(wx.VERTICAL) |