Python Reportlab: wrap cyrillic text into table cell - word-wrap

I have problem to wrap cyrillic text into table cell. I use pdfmetrics.registerFont to set font who display cyrillic symbols, but when the text is longer than the width of the cell it is not wrapped. I try to use getSampleStyleSheet and then the text is wrapped into the cell, but I get black boxes instead of cyrillic symbols. Here is an example of my code:
from reportlab.pdfbase import pdfmetrics
from reportlab.pdfbase.ttfonts import TTFont
from reportlab.pdfgen import canvas
from reportlab.lib.pagesizes import A4
from reportlab.lib.units import cm
from reportlab.platypus import Table, TableStyle
from reportlab.lib import colors
def coord(x, y, unit=1):
x, y = x * unit, height - h - y * unit
return x, y
width, height = A4
pdfmetrics.registerFont(TTFont('bold', 'Lora-Bold.ttf'))
pdfmetrics.registerFont(TTFont('regular', 'Lora-Regular.ttf'))
file_name = 'Report2.pdf'
title = 'ПРОТОКОЛ'
new_incidents = [('къс текст', 'къс текст', 'къс текст', 'дълъг текст', 'дълъг текст'),
('къс текст', 'къс текст', 'къс текст', 'дъъъъъллъъгггггг текстттттттттт',
'дъъъъъллъъгггггг текстттттттттт')]
pdf = canvas.Canvas(file_name)
table1 = Table(new_incidents, colWidths=[1.6 * cm, 2.8 * cm, 2.8 * cm, 2.5 * cm, 2.5 * cm])
table1.setStyle(TableStyle([('ALIGN', (0, 1), (-1, -1), 'LEFT'),
('ALIGN', (0, 0), (-1, 0), 'CENTER'),
('INNERGRID', (0, 0), (-1, -1), 0.25, colors.black),
('BOX', (0, 0), (-1, -1), 0.25, colors.black),
('FONT', (0, 0), (-1, 0), 'bold', 9),
('FONT', (0, 1), (-1, -1), 'regular', 8)
]))
elems = []
elems.append(table1)
w, h = table1.wrap(width, height)
table1.wrapOn(pdf, 550, 840)
x, y = coord(1.5, 6, cm)
table1.drawOn(pdf, x, y)
pdf.save()

To wrap the text, you must use the Paragraph.
First you need to connect styles:
styles = getSampleStyleSheet()
styles["Normal"].fontName = 'regular'
styleN = styles["Normal"]
and then wrap the cell's text with Paragraph:
new_incidents = [('къс текст', 'къс текст', 'къс текст', 'дълъг текст', 'дълъг текст'),
('къс текст', 'къс текст', 'къс текст', Paragraph('дъъъъъллъъгггггг текстттттттттт', styleN),
Paragraph('дъъъъъллъъгггггг текстттттттттт', styleN))]

Related

reverse the color for heatmap colorbar [duplicate]

I would like to know how to simply reverse the color order of a given colormap in order to use it with plot_surface.
The standard colormaps also all have reversed versions. They have the same names with _r tacked on to the end. (Documentation here.)
The solution is pretty straightforward. Suppose you want to use the "autumn" colormap scheme. The standard version:
cmap = matplotlib.cm.autumn
To reverse the colormap color spectrum, use get_cmap() function and append '_r' to the colormap title like this:
cmap_reversed = matplotlib.cm.get_cmap('autumn_r')
In matplotlib a color map isn't a list, but it contains the list of its colors as colormap.colors. And the module matplotlib.colors provides a function ListedColormap() to generate a color map from a list. So you can reverse any color map by doing
colormap_r = ListedColormap(colormap.colors[::-1])
As of Matplotlib 2.0, there is a reversed() method for ListedColormap and LinearSegmentedColorMap objects, so you can just do
cmap_reversed = cmap.reversed()
Here is the documentation.
As a LinearSegmentedColormaps is based on a dictionary of red, green and blue, it's necessary to reverse each item:
import matplotlib.pyplot as plt
import matplotlib as mpl
def reverse_colourmap(cmap, name = 'my_cmap_r'):
"""
In:
cmap, name
Out:
my_cmap_r
Explanation:
t[0] goes from 0 to 1
row i: x y0 y1 -> t[0] t[1] t[2]
/
/
row i+1: x y0 y1 -> t[n] t[1] t[2]
so the inverse should do the same:
row i+1: x y1 y0 -> 1-t[0] t[2] t[1]
/
/
row i: x y1 y0 -> 1-t[n] t[2] t[1]
"""
reverse = []
k = []
for key in cmap._segmentdata:
k.append(key)
channel = cmap._segmentdata[key]
data = []
for t in channel:
data.append((1-t[0],t[2],t[1]))
reverse.append(sorted(data))
LinearL = dict(zip(k,reverse))
my_cmap_r = mpl.colors.LinearSegmentedColormap(name, LinearL)
return my_cmap_r
See that it works:
my_cmap
<matplotlib.colors.LinearSegmentedColormap at 0xd5a0518>
my_cmap_r = reverse_colourmap(my_cmap)
fig = plt.figure(figsize=(8, 2))
ax1 = fig.add_axes([0.05, 0.80, 0.9, 0.15])
ax2 = fig.add_axes([0.05, 0.475, 0.9, 0.15])
norm = mpl.colors.Normalize(vmin=0, vmax=1)
cb1 = mpl.colorbar.ColorbarBase(ax1, cmap = my_cmap, norm=norm,orientation='horizontal')
cb2 = mpl.colorbar.ColorbarBase(ax2, cmap = my_cmap_r, norm=norm, orientation='horizontal')
EDIT
I don't get the comment of user3445587. It works fine on the rainbow colormap:
cmap = mpl.cm.jet
cmap_r = reverse_colourmap(cmap)
fig = plt.figure(figsize=(8, 2))
ax1 = fig.add_axes([0.05, 0.80, 0.9, 0.15])
ax2 = fig.add_axes([0.05, 0.475, 0.9, 0.15])
norm = mpl.colors.Normalize(vmin=0, vmax=1)
cb1 = mpl.colorbar.ColorbarBase(ax1, cmap = cmap, norm=norm,orientation='horizontal')
cb2 = mpl.colorbar.ColorbarBase(ax2, cmap = cmap_r, norm=norm, orientation='horizontal')
But it especially works nice for custom declared colormaps, as there is not a default _r for custom declared colormaps. Following example taken from http://matplotlib.org/examples/pylab_examples/custom_cmap.html:
cdict1 = {'red': ((0.0, 0.0, 0.0),
(0.5, 0.0, 0.1),
(1.0, 1.0, 1.0)),
'green': ((0.0, 0.0, 0.0),
(1.0, 0.0, 0.0)),
'blue': ((0.0, 0.0, 1.0),
(0.5, 0.1, 0.0),
(1.0, 0.0, 0.0))
}
blue_red1 = mpl.colors.LinearSegmentedColormap('BlueRed1', cdict1)
blue_red1_r = reverse_colourmap(blue_red1)
fig = plt.figure(figsize=(8, 2))
ax1 = fig.add_axes([0.05, 0.80, 0.9, 0.15])
ax2 = fig.add_axes([0.05, 0.475, 0.9, 0.15])
norm = mpl.colors.Normalize(vmin=0, vmax=1)
cb1 = mpl.colorbar.ColorbarBase(ax1, cmap = blue_red1, norm=norm,orientation='horizontal')
cb2 = mpl.colorbar.ColorbarBase(ax2, cmap = blue_red1_r, norm=norm, orientation='horizontal')
There is no built-in way (yet) of reversing arbitrary colormaps, but one simple solution is to actually not modify the colorbar but to create an inverting Normalize object:
from matplotlib.colors import Normalize
class InvertedNormalize(Normalize):
def __call__(self, *args, **kwargs):
return 1 - super(InvertedNormalize, self).__call__(*args, **kwargs)
You can then use this with plot_surface and other Matplotlib plotting functions by doing e.g.
inverted_norm = InvertedNormalize(vmin=10, vmax=100)
ax.plot_surface(..., cmap=<your colormap>, norm=inverted_norm)
This will work with any Matplotlib colormap.
There are two types of LinearSegmentedColormaps. In some, the _segmentdata is given explicitly, e.g., for jet:
>>> cm.jet._segmentdata
{'blue': ((0.0, 0.5, 0.5), (0.11, 1, 1), (0.34, 1, 1), (0.65, 0, 0), (1, 0, 0)), 'red': ((0.0, 0, 0), (0.35, 0, 0), (0.66, 1, 1), (0.89, 1, 1), (1, 0.5, 0.5)), 'green': ((0.0, 0, 0), (0.125, 0, 0), (0.375, 1, 1), (0.64, 1, 1), (0.91, 0, 0), (1, 0, 0))}
For rainbow, _segmentdata is given as follows:
>>> cm.rainbow._segmentdata
{'blue': <function <lambda> at 0x7fac32ac2b70>, 'red': <function <lambda> at 0x7fac32ac7840>, 'green': <function <lambda> at 0x7fac32ac2d08>}
We can find the functions in the source of matplotlib, where they are given as
_rainbow_data = {
'red': gfunc[33], # 33: lambda x: np.abs(2 * x - 0.5),
'green': gfunc[13], # 13: lambda x: np.sin(x * np.pi),
'blue': gfunc[10], # 10: lambda x: np.cos(x * np.pi / 2)
}
Everything you want is already done in matplotlib, just call cm.revcmap, which reverses both types of segmentdata, so
cm.revcmap(cm.rainbow._segmentdata)
should do the job - you can simply create a new LinearSegmentData from that. In revcmap, the reversal of function based SegmentData is done with
def _reverser(f):
def freversed(x):
return f(1 - x)
return freversed
while the other lists are reversed as usual
valnew = [(1.0 - x, y1, y0) for x, y0, y1 in reversed(val)]
So actually the whole thing you want, is
def reverse_colourmap(cmap, name = 'my_cmap_r'):
return mpl.colors.LinearSegmentedColormap(name, cm.revcmap(cmap._segmentdata))

VPython Object Revolution

Having to use VPython currently, and I want to make a model of the Solar System.
Currently I have all the Planets and the orbital Rings, however, the actual orbit is what I'm finding very difficult.
GlowScript 2.7 VPython
from visual import *
# Declaring Celestial Body Objects
Sun = sphere(pos = vec(0, 0, 0), radius = 10, color = color.yellow)
Mercury = sphere(pos = vec(25, 0, 0), radius = 2, color = color.green)
Venus = sphere(pos = vec(40, 0, 0), radius = 2.5, color = color.red)
Earth = sphere(pos = vec(50, 0, 0), radius = 2.65, color = color.blue)
Mars = sphere(pos = vec(70, 0, 0), radius = 2.3, color = color.red)
Jupiter = sphere(pos = vec(90, 0, 0), radius = 3, color = color.orange)
Saturn = sphere(pos = vec(105, 0, 0), radius = 2.9, color = color.orange)
Uranus = sphere(pos = vec(117.5, 0, 0), radius = 2.9, color = color.orange)
Neptune = sphere(pos = vec(135, 0, 0), radius = 2.8, color = color.blue)
Pluto = sphere(pos = vec(165, 0, 0), radius = 1.5, color = color.white)
# Declaring Orbital Rings of Celestial Body Objects
Mercury.ring = ring(pos = vec(0, 0, 0), axis = vec(0, 1, 0), size = vec(0.1, Mercury.pos.x * 2, Mercury.pos.x * 2))
Venus.ring = ring(pos = vec(0, 0, 0), axis = vec(0, 1, 0), size = vec(0.1, Venus.pos.x * 2, Venus.pos.x * 2))
Earth.ring = ring(pos = vec(0, 0, 0), axis = vec(0, 1, 0), size = vec(0.1, Earth.pos.x * 2, Earth.pos.x * 2))
Mars.ring = ring(pos = vec(0, 0, 0), axis = vec(0, 1, 0), size = vec(0.1, Mars.pos.x * 2, Mars.pos.x * 2))
Jupiter.ring = ring(pos = vec(0, 0, 0), axis = vec(0, 1, 0), size = vec(0.1, Jupiter.pos.x * 2, Jupiter.pos.x * 2))
Saturn.ring = ring(pos = vec(0, 0, 0), axis = vec(0, 1, 0), size = vec(0.1, Saturn.pos.x * 2, Saturn.pos.x * 2))
Uranus.ring = ring(pos = vec(0, 0, 0), axis = vec(0, 1, 0), size = vec(0.1, Uranus.pos.x * 2, Uranus.pos.x * 2))
Neptune.ring = ring(pos = vec(0, 0, 0), axis = vec(0, 1, 0), size = vec(0.1, Neptune.pos.x * 2, Neptune.pos.x * 2))
Pluto.ring = ring(pos = vec(0, 0, 0), axis = vec(0, 1, 0), size = vec(0.1, Pluto.pos.x * 2, Pluto.pos.x * 2))
# Infinite Loop
while 1 == 1:
Mercury.rotate(angle = radians(360), axis = vec(Mercury.pos.y, Mercury.pos.x, 0), origin = vec(0, 0, 0))
rate(50)
print("Error! Escaped While Loop!")
When I switch out the rotate method with Mercury.rotate(angle = 0.0174533, axis = vec(0, Mercury.pos.x, 0), origin = vec(0, 0, 0)), it properly rotates... yet only for a quarter of the rotation. I've read about everything to do with this, but N/A.
After the quarter revolution, the planet sometimes decides to violently "seizure," when the angle is a larger number. It just seems like a barrier of sorts.
You should write axis=vec(0,1,0). The axis of rotation needs to be always pointing upward.

NagivationToolbar fails when updating in Tkinter canvas

I am trying to update a two-panel plot in Tkinter canvas using matplotlib. Here is the minimum code that shows my current understanding. The main problem is while the navigation toolbar works for the initial plots (y = sin(x), y = cos(x)), however it fails when I press the update button to update it. For example if I zoom in a curve, I cannot use home button to return to its original state. I have been trying different ways, but to no avail. I would appreciate anyone's suggestions.
One minor issue I notice is that if I want to kill the plot, I should go to menubar and select python/quit Python, otherwise if I just click the X at the top left of the plot window, the terminal freezes (I have to kill the terminal).
I am using Python 2.7.14 and matplotlob 2.1.0.
from Tkinter import *
import Tkinter as tk
import ttk
from math import exp
import os # for loading files or exporting files
import tkFileDialog
##loading matplotlib modules
import matplotlib
matplotlib.use("TkAgg")
import matplotlib.pyplot as plt
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2TkAgg
from matplotlib.figure import Figure
import matplotlib.gridspec as gridspec
import numpy as np
top = tk.Tk()
top.title("Intermolecular PDFs")
top_frame = ttk.Frame(top, padding = (10, 10))
top_frame.pack()
fig = plt.figure(figsize=(10, 6), dpi=100) ##create a figure; modify the size here
x = np.linspace(0,1)
y = np.sin(x)
z = np.cos(x)
fig.add_subplot(211)
plt.title("Individual PDFs")
plt.xlabel(ur"r (\u00c5)", labelpad = 3, fontsize = 15)
plt.ylabel(ur"PDF, G (\u00c5$^{-2})$", labelpad = 10, fontsize = 15)
plt.plot(x,y, "r-", lw=2)
plt.xticks(fontsize = 11)
plt.yticks(fontsize = 11)
fig.add_subplot(212)
plt.title("Difference PDFs")
plt.xlabel(ur"r (\u00c5)", labelpad = 3, fontsize = 15)
plt.ylabel(ur"PDF, G (\u00c5$^{-2})$", labelpad = 10, fontsize = 15)
plt.plot(x,z,"g-", lw=2)
plt.xticks(fontsize = 11)
plt.yticks(fontsize = 11)
fig.tight_layout()
canvas = FigureCanvasTkAgg(fig, master = top_frame)
canvas.show()
canvas.get_tk_widget().pack(side=tk.TOP, fill=tk.BOTH, expand=1)
#self.canvas.draw()
toolbar = NavigationToolbar2TkAgg(canvas, top_frame)
#self.toolbar.pack()
toolbar.update()
canvas._tkcanvas.pack(side=tk.TOP, fill=tk.BOTH, expand=1)
def update():
fig.clf()
new_x = np.linspace(1,100)
new_y = new_x**2
new_z = new_x**3
fig.add_subplot(211)
plt.title("Individual PDFs")
plt.xlabel(ur"r (\u00c5)", labelpad = 3, fontsize = 15)
plt.ylabel(ur"PDF, G (\u00c5$^{-2})$", labelpad = 10, fontsize = 15)
plt.plot(new_x,new_y, "r-", lw=2)
plt.xticks(fontsize = 11)
plt.yticks(fontsize = 11)
fig.add_subplot(212)
plt.title("Difference PDFs")
plt.xlabel(ur"r (\u00c5)", labelpad = 3, fontsize = 15)
plt.ylabel(ur"PDF, G (\u00c5$^{-2})$", labelpad = 10, fontsize = 15)
plt.plot(new_x,new_z,"g-", lw=2)
plt.xticks(fontsize = 11)
plt.yticks(fontsize = 11)
fig.tight_layout()
canvas.show()
ttk.Button(top_frame, text = "update",command = update).pack()
top.mainloop()
The main problem is that the home button does not know which state it should refer to when being pressed. The original state it would refer to does not even exist any more, because the figure had been cleared in the meantime. The solution to this is to call
toolbar.update()
which will, amongst other things, create a new home state for the button to revert to when being pressed.
There are some other minor issues with the code:
Instead of clearing the figure, you may just update the data of the lines drawn in it. This would eliminate a lot of redundant code.
I would strongly advise not to use pyplot at all when embedding a figure in Tk. Instead, use the object oriented approach, creating objects like figure and axes and then call their respective methods. (I'm not sure if this is the reason for the freezing though, because even the initial code did not freeze for me when running it.)
There were some unnecessary commands floating in the code.
The following is a clean version with all the above being taken care of:
import Tkinter as tk
import ttk
##loading matplotlib modules
import matplotlib
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2TkAgg
from matplotlib.figure import Figure
import numpy as np
top = tk.Tk()
top.title("Intermolecular PDFs")
top_frame = ttk.Frame(top, padding = (10, 10))
top_frame.pack()
matplotlib.rcParams["xtick.labelsize"] = 11
matplotlib.rcParams["ytick.labelsize"] = 11
fig = Figure(figsize=(10, 6), dpi=100) ##create a figure; modify the size here
x = np.linspace(0,1)
y = np.sin(x)
z = np.cos(x)
ax = fig.add_subplot(211)
ax.set_title("Individual PDFs")
ax.set_xlabel(ur"r (\u00c5)", labelpad = 3, fontsize = 15)
ax.set_ylabel(ur"PDF, G (\u00c5$^{-2})$", labelpad = 10, fontsize = 15)
line, = ax.plot(x,y, "r-", lw=2)
ax2 = fig.add_subplot(212)
ax2.set_title("Difference PDFs")
ax2.set_xlabel(ur"r (\u00c5)", labelpad = 3, fontsize = 15)
ax2.set_ylabel(ur"PDF, G (\u00c5$^{-2})$", labelpad = 10, fontsize = 15)
line2, = ax2.plot(x,z,"g-", lw=2)
canvas = FigureCanvasTkAgg(fig, master = top_frame)
canvas.get_tk_widget().pack(side=tk.TOP, fill=tk.BOTH, expand=1)
fig.tight_layout()
toolbar = NavigationToolbar2TkAgg(canvas, top_frame)
toolbar.update()
canvas._tkcanvas.pack(side=tk.TOP, fill=tk.BOTH, expand=1)
def update():
new_x = np.linspace(1,100)
new_y = new_x**2
new_z = new_x**3
line.set_data(new_x,new_y)
line2.set_data(new_x,new_z)
ax.relim()
ax.autoscale()
ax2.relim()
ax2.autoscale()
fig.tight_layout()
canvas.draw_idle()
toolbar.update()
ttk.Button(top_frame, text = "update",command = update).pack()
top.mainloop()
Note: In newer versions of matplotlib you should use NavigationToolbar2Tk instead of NavigationToolbar2TkAgg.

unable to upload dynamic image frames of video into S3

I need to detect faces from video and store the image frames in S3
I am stuck at s3_client.upload_file how can i add dynamic frames of the video
import numpy as np
import boto3
from boto.s3.key import Key
import cv2
count=0
loop=0
cascPath = 'haarcascade_frontalface_default.xml'
faceCascade = cv2.CascadeClassifier(cascPath)
cap = cv2.VideoCapture('https://s3-us-west-2.amazonaws.com/test1/news.mp4')
s3_client = boto3.client('s3')
while(cap.isOpened()):
ret, frame = cap.read()
faces = faceCascade.detectMultiScale(
frame,
scaleFactor=2.1,
minNeighbors=5,
minSize=(30, 30),
flags=cv2.CASCADE_SCALE_IMAGE
)
print('------',faces)
#print('------',loop)
for (x, y, w, h) in faces:
cv2.rectangle(frame, (x, y), (x+w, y+h), (0, 255, 0), 2)
crop_img = frame[y:y+h,x:x+w]
cv2.imwrite('frame%d.jpg' %count, crop_img)
s3_client.upload_file('frame%d.jpg', 'test1', 'frame%d.jpg' )
print('---storing in S3----------')
count += 1
cap.release()
cv2.destroyAllWindows()

WxPython Resize an Image using GridBagSizer

I am sorry if this is too simple... I tried to add a logo to my first GUI, however, I am not sure what is the best way to resize it. At this moment, I am using image.Scale to adjust the logo size and place GridBagSizer.
self.image = wx.Image("logo11w.png", wx.BITMAP_TYPE_ANY)
w = self.image.GetWidth()
h = self.image.GetHeight()
self.image = self.image.Scale(w/8, h/8)
self.sb1 = wx.StaticBitmap(self.panel, -1, wx.BitmapFromImage(self.image))
self.sizer.Add(self.sb1, pos=(0, 0), flag=wx.TOP|wx.LEFT|wx.BOTTOM, border=15)
.
I am wondering if there is an auto way to do this? Since I am using GridBagSizer, is it possible to leave one "grid" (e.g., 1 by 1 "box") for my logo? Thanks in advance!
Code:
import wx
class landing_frame(wx.Frame):
def __init__(self, parent, title):
wx.Frame.__init__(self, parent, id = wx.ID_ANY, title = wx.EmptyString, pos = wx.DefaultPosition, size = wx.Size(800, 600), style = wx.DEFAULT_FRAME_STYLE|wx.TAB_TRAVERSAL )
self.font1 = wx.Font(18, wx.DECORATIVE, wx.ITALIC, wx.BOLD)
self.InitUI()
self.Centre()
self.Show()
def InitUI(self):
self.panel = wx.Panel(self)
self.sizer = wx.GridBagSizer(5, 15)
self.image = wx.Image("logo11w.png", wx.BITMAP_TYPE_ANY)
w = self.image.GetWidth()
h = self.image.GetHeight()
self.image = self.image.Scale(w/8, h/8)
self.sb1 = wx.StaticBitmap(self.panel, -1, wx.BitmapFromImage(self.image))
self.sizer.Add(self.sb1, pos=(0, 0), flag=wx.TOP|wx.LEFT|wx.BOTTOM, border=15)
self.text1 = wx.StaticText(self.panel, label="Welcome!")
self.sizer.Add(self.text1, pos=(0, 2), flag=wx.TOP|wx.LEFT|wx.BOTTOM, border=15)
line = wx.StaticLine(self.panel)
self.sizer.Add(line, pos=(1, 0), span=(1, 5), flag=wx.EXPAND|wx.BOTTOM, border=10)
self.text2 = wx.StaticText(self.panel, label="Question 1?")
self.sizer.Add(self.text2, pos=(2, 0), flag=wx.ALL, border=10)
self.sampleList = ['Op1', 'Op2', 'Op3']
self.combo = wx.ComboBox(self.panel, 10, choices=self.sampleList)
self.sizer.Add(self.combo, pos=(2, 1), span=(1, 5), flag=wx.EXPAND|wx.ALL, border=10)
self.input1 = wx.StaticText(self.panel, 11, label="Please Enter Filepath")
self.sizer.Add(self.input1, pos=(3, 0), span=(1, 1), flag=wx.ALL , border=10)
self.input2 = wx.FilePickerCtrl(self.panel, 12, wx.EmptyString, u"Select a file", u"*.*", wx.DefaultPosition, wx.DefaultSize, wx.FLP_DEFAULT_STYLE )
self.sizer.Add(self.input2, pos=(3, 1), span=(1, 20), flag=wx.EXPAND|wx.ALL, border=10)
self.input3 = wx.StaticText(self.panel, 13, label="Additional inputs")
self.sizer.Add(self.input3, pos=(4, 0), flag=wx.ALL , border=10)
self.input4 = wx.TextCtrl(self.panel, 14, 'E.g. ...', wx.DefaultPosition, wx.DefaultSize, 0, wx.DefaultValidator )
self.sizer.Add(self.input4, pos=(4, 1), span=(1, 10), flag=wx.EXPAND|wx.ALL, border=10)
self.panel.SetSizer(self.sizer)
if __name__ == '__main__':
app = wx.App(redirect=False, filename="mylogfile.txt")
landing_frame(None, title="Test")
app.MainLoop()
Here is the logo

Resources