Various fixes

This commit is contained in:
MikeTheWatchGuy 2018-09-07 23:23:45 -04:00
parent ceb09ae62c
commit a968100ab8
4 changed files with 33 additions and 24 deletions

View file

@ -3,12 +3,16 @@ import glob
import ntpath
import subprocess
LOCATION_OF_YOUR_SCRIPTS = 'C:/Python/PycharmProjects/GooeyGUI/'
LOCATION_OF_YOUR_SCRIPTS = ''
# Execute the command. Will not see the output from the command until it completes.
def execute_command_blocking(command, *args):
expanded_args = []
for a in args:
expanded_args.append(a)
# expanded_args += a
try:
sp = subprocess.Popen([command,*args], shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
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"))
@ -20,8 +24,11 @@ def execute_command_blocking(command, *args):
# Executes command and immediately returns. Will not see anything the script outputs
def execute_command_nonblocking(command, *args):
expanded_args = []
for a in args:
expanded_args += a
try:
sp = subprocess.Popen([command,*args], shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
sp = subprocess.Popen([command,expanded_args], shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
except: pass
def Launcher2():