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:
commit
17c1b3ca5b
|
@ -431,7 +431,10 @@ def ScriptLauncher():
|
||||||
|
|
||||||
def ExecuteCommandSubprocess(command, *args):
|
def ExecuteCommandSubprocess(command, *args):
|
||||||
try:
|
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()
|
out, err = sp.communicate()
|
||||||
if out:
|
if out:
|
||||||
print(out.decode("utf-8"))
|
print(out.decode("utf-8"))
|
||||||
|
@ -691,12 +694,12 @@ def TableSimulation():
|
||||||
Display data in a table format
|
Display data in a table format
|
||||||
"""
|
"""
|
||||||
import PySimpleGUI as sg
|
import PySimpleGUI as sg
|
||||||
|
sg.ChangeLookAndFeel('Dark1')
|
||||||
|
|
||||||
layout = [[sg.T('Table Test')]]
|
layout = [[sg.T('Table Test')]]
|
||||||
|
|
||||||
for i in range(20):
|
for i in range(20):
|
||||||
row = [sg.T(f'Row {i} ', size=(10, 1))]
|
layout.append([sg.T('{} {}'.format(i,j), size=(4, 1), background_color='black', pad=(1, 1)) for j in range(10)])
|
||||||
layout.append([sg.T(f'{i}{j}', size=(4, 1), background_color='white', pad=(1, 1)) for j in range(10)])
|
|
||||||
|
|
||||||
sg.FlexForm('Table').LayoutAndRead(layout)
|
sg.FlexForm('Table').LayoutAndRead(layout)
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,8 @@ Until then enjoy it working somewhat slowly.
|
||||||
|
|
||||||
|
|
||||||
def main():
|
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:
|
if filename is None:
|
||||||
exit(69)
|
exit(69)
|
||||||
vidFile = cv.VideoCapture(filename)
|
vidFile = cv.VideoCapture(filename)
|
||||||
|
@ -31,7 +32,7 @@ def main():
|
||||||
[sg.ReadFormButton('Exit', size=(10, 2), pad=((600, 0), 3), font='Helvetica 14')]]
|
[sg.ReadFormButton('Exit', size=(10, 2), pad=((600, 0), 3), font='Helvetica 14')]]
|
||||||
|
|
||||||
# create the form and show it without the plot
|
# 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.Layout(layout)
|
||||||
form.ReadNonBlocking()
|
form.ReadNonBlocking()
|
||||||
|
|
||||||
|
|
|
@ -1646,11 +1646,14 @@ class FlexForm:
|
||||||
self.TKroot.y = None
|
self.TKroot.y = None
|
||||||
|
|
||||||
def OnMotion(self, event):
|
def OnMotion(self, event):
|
||||||
deltax = event.x - self.TKroot.x
|
try:
|
||||||
deltay = event.y - self.TKroot.y
|
deltax = event.x - self.TKroot.x
|
||||||
x = self.TKroot.winfo_x() + deltax
|
deltay = event.y - self.TKroot.y
|
||||||
y = self.TKroot.winfo_y() + deltay
|
x = self.TKroot.winfo_x() + deltax
|
||||||
self.TKroot.geometry("+%s+%s" % (x, y))
|
y = self.TKroot.winfo_y() + deltay
|
||||||
|
self.TKroot.geometry("+%s+%s" % (x, y))
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
def _KeyboardCallback(self, event ):
|
def _KeyboardCallback(self, event ):
|
||||||
|
|
Loading…
Reference in New Issue