Re: full screen graphics



On May 21, 8:39 am, myheartinamerica <myheartinamer...@xxxxxxxxx>
wrote:
Hello,

I need to run a particular graphics application over and over again
with a different command line to get benchmarks on the applications
performance (frame rates and similar data). I am running the following
within a while loop that parses out a different command line from a
configuration file.

############
def runCommand(command):
"""runCommand(command)

Parameters:
command -- the full string of the command to execute

"""
print command
try:
childProcess = subprocess.Popen(command)

done = False
while not done:
returnCode = childProcess.poll()
if (returnCode != None):
done = True
else:
# sleep for 10 seconds before checking again
time.sleep(10)
except KeyboardInterrupt:
print 'KeyboardInterrupt received. Trying to kill Wolf2.exe'
print '>TASKKILL /F /T /PID ', childProcess.pid
killCommand = ''.join(('TASKKILL /F /T /PID ',
str(childProcess.pid)))
killSubProcess = subprocess.Popen(killCommand)
killSubProcess.wait()
sys.exit(0)
except OSError, (errno, strerror):
print 'OS Error (%s): %s' % (errno, strerror)
print 'Above error occurred while executing the following:'
print command
except WindowsError, (errno, strerror):
print 'MS Windows Error (%s): %s' % (errno, strerror)
print 'Above error occurred while executing the following:'
print command
##########

The problem lies in that the second time the application is run, it
doesn't grab focus and go full screen, but sits paused. It will not
continue running until I click on the minimized application in the
taskbar. Is there any way to force it to grab focus?

I am running on Win32 with Python 2.5.1.

Your help in this matter is greatly appreciated,
Mick Charles Beaver


If your graphics program uses COM you may be able to do something like
what's done in the following post:

http://mail.python.org/pipermail/python-list/2005-June/327261.html

I found this too, but I haven't tested it myself: http://downgra.de/articles/python-wmii/

You may be able to use Tim Golden's WMI module too. I would think you
could use his "enumerate all running processes" and combine it with
the "run a process minimized", except you'd change the flag so that it
maximized instead. See link below:

http://tgolden.sc.sabren.com/python/wmi_cookbook.html

Hopefully that'll help you some.

Mike


.



Relevant Pages

  • Re: Text boxes in plot dont stay where I put them
    ... I'm not sure what you mean by checking the units properties Skeptic since I'm new to Matlab. ... command or the print command from the MATLAB command window. ... The print command has lots of options and is used to generate both hardcopy output as well as to create files of various output formats. ... The most likely thing that's happening when you print your figure is that the figure is being resized to fit the output size (look at the doc for help on the figure and its paperpositionmode, paperposition, and paperunits properties). ...
    (comp.soft-sys.matlab)
  • Re: Pan and Printing
    ... Can you print a file from the command line using the lpr command? ... I'm also using cups, and I have my print command in Pan set to "lp -d lp", ...
    (alt.os.linux.suse)
  • full screen graphics
    ... with a different command line to get benchmarks on the applications ... print 'Above error occurred while executing the following:' ... doesn't grab focus and go full screen, ...
    (comp.lang.python)
  • Re: Problems with my parport (and printer)
    ... >> switched of and I try to print something, the print command just ... > First of all, if you want to do normal printing, you shouldn't switch on ... when I send data to the printer and it is not connected, the command ... send the line "unsubscribe linux-kernel" in ...
    (Linux-Kernel)
  • Re: Problems installing XP SP2!
    ... package source directory and make sure the that XPSPS2sms.exe file exists in ... in your SMS Program command line property. ... > Executing program as a script ... > OnOptionalExecutionRequests failed for program Automated upgrade from XP ...
    (microsoft.public.sms.admin)