Hello, my friends,
I am using python's subprocess to call a cam.exe to record the computer
screen. Cam.exe is revised based on CamStudio. It is available at
http://hejibo.info/download/cam.exe
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
--
You received this message because you are subscribed to the Google Groups
"PyInstaller" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/pyinstaller/-/G-vgDx4nXTAJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/pyinstaller?hl=en.