Changes between Version 138 and Version 139 of UserGuideGit
- Timestamp:
- Mar 2, 2009, 1:01:22 PM (16 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
UserGuideGit
v138 v139 151 151 == Tethered shooting == 152 152 153 It is possible to use an external program to make tethered shooting. The program needs to be run through a shell, where all parameters are given on command-line. If a '''{{{shoot.py}}}''' python script is found in the user config. dir, the 2 functions '''{{{mirrorLockup(stabilizationDelay)}}}''' and '''{{{shoot(bracketNumber)}}}''' will be called instead of internal ones. 154 155 Here is a nexample script which can be used:153 It is possible to use an external program to make tethered shooting. The program needs to be run through a shell, where all parameters are given on command-line. If a '''{{{shoot.py}}}''' python script is found in the user config. dir, the 2 functions '''{{{mirrorLockup(stabilizationDelay)}}}''' and '''{{{shoot(bracketNumber)}}}''' will be called instead of internal ones. Note that if a function does not exists, the internal one will be called instead. 154 155 Here is a minimalistic example script which can be used: 156 156 157 157 {{{ … … 160 160 161 161 def mirrorLockup(stabilizationDelay): 162 print "Mirror lockup (stabilizationDelay=%.1f)" % stabilizationDelay163 162 # See shoot() function 164 163 165 164 166 165 def shoot(bracketNumber): 167 print "Shoot (bracketNumber=%d)" % bracketNumber 168 169 # Launch external command 170 #p = subprocess.Popen(["myTetheredShootingProgram", "-capture", "%d" % bracketNumber], stdin=subprocess.PIPE, stdout=subprocess.PIPE) 171 p = subprocess.Popen(["gphoto2", "--help"], stdin=subprocess.PIPE, stdout=subprocess.PIPE) 172 173 # Send data to external command input 174 #p.stdin.write("bla") 175 176 # Wait end of external command execution 166 167 # Launch the external command 168 p = subprocess.Popen(["gphoto2", "--help"], stdout=subprocess.PIPE) 169 170 # Wait end of execution 177 171 p.wait() 178 172 179 # Print external command return code 180 print "returncode=%d" % p.returncode 181 182 # Print external command output 183 print p.stdout.read() 184 #print p.stdout.readlines() 185 #for line in p.stdout: 186 #print line, 173 # Return result (must be a tuple containing an int and a string) 174 return p.returncode, p.stdout.read() 187 175 }}} 188 176