My source code is below. I can run this python code
to record my computer screen. But after I pack it with
PyInstaller, the generated .exe file cannot call cam.exe to
record the screen anymore. There is no error message. Just
nothing happens.
Please help me how to use PyInstaller to pack a python
program, which uses subprocess to call another program.
Thanks! Merry Christmas!
import os
from time import strftime,localtime
import time
from thread import start_new_thread
import subprocess
global CamStudioProc
def CloseVideoRecording():
print 'destroy'
CamStudioProc.communicate('\tstdin: to stdin\n')
print 'communicate'
CamStudioProc.stdin.close()
print 'stdin close'
def Start_CamStudio(timestamp):
import subprocess
global CamStudioProc
outfilename = 'VideoRecording-%s.avi'%timestamp
CamStudioProc = subprocess.Popen("cam.exe -outfile
%s"%outfilename,stdin=subprocess.PIPE,shell=False)
if __name__ == '__main__':
timestamp = str(time.time())
print "timestamp:",timestamp
start_new_thread(Start_CamStudio,(timestamp,))
---------------------------
He Jibo
Assistant Professor
Department of Psychology,
Wichita State University
website:
www.hejibo.info