Merge pull request #146 from MikeTheWatchGuy/Dev-latest

Fix for *args crash in python 3.4.  Had no idea was broken.   OpenCV …
This commit is contained in:
MikeTheWatchGuy 2018-09-06 21:31:15 -04:00 committed by GitHub
commit 17c1b3ca5b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 10 deletions

View File

@ -431,7 +431,10 @@ def ScriptLauncher():
def ExecuteCommandSubprocess(command, *args):
try:
sp = subprocess.Popen([command,*args], shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
expanded_args = []
for a in args:
expanded_args += a
sp = subprocess.Popen([command,expanded_args], shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
out, err = sp.communicate()
if out:
print(out.decode("utf-8"))
@ -691,12 +694,12 @@ def TableSimulation():
Display data in a table format
"""
import PySimpleGUI as sg
sg.ChangeLookAndFeel('Dark1')
layout = [[sg.T('Table Test')]]
for i in range(20):
row = [sg.T(f'Row {i} ', size=(10, 1))]
layout.append([sg.T(f'{i}{j}', size=(4, 1), background_color='white', pad=(1, 1)) for j in range(10)])
layout.append([sg.T('{} {}'.format(i,j), size=(4, 1), background_color='black', pad=(1, 1)) for j in range(10)])
sg.FlexForm('Table').LayoutAndRead(layout)

View File

@ -14,7 +14,8 @@ Until then enjoy it working somewhat slowly.
def main():
filename = sg.PopupGetFile('Filename to play')
filename = 'C:/Python/MIDIVideo/PlainVideos/- 08-30 Ted Talk/TED Talk Short - Video+.mp4'
# filename = sg.PopupGetFile('Filename to play')
if filename is None:
exit(69)
vidFile = cv.VideoCapture(filename)
@ -31,7 +32,7 @@ def main():
[sg.ReadFormButton('Exit', size=(10, 2), pad=((600, 0), 3), font='Helvetica 14')]]
# create the form and show it without the plot
form = sg.FlexForm('Demo Application - Embedding Matplotlib In PySimpleGUI', no_titlebar=True)
form = sg.FlexForm('Demo Application - Embedding Matplotlib In PySimpleGUI', no_titlebar=True, location=(0,0))
form.Layout(layout)
form.ReadNonBlocking()

View File

@ -1646,11 +1646,14 @@ class FlexForm:
self.TKroot.y = None
def OnMotion(self, event):
try:
deltax = event.x - self.TKroot.x
deltay = event.y - self.TKroot.y
x = self.TKroot.winfo_x() + deltax
y = self.TKroot.winfo_y() + deltay
self.TKroot.geometry("+%s+%s" % (x, y))
except:
pass
def _KeyboardCallback(self, event ):