Sorry if I have sounded a bit too demanding, it's just it can be very tempting to ask questions when you are desperately trying to get something to work and when you dont really know alot about python scripts.<div><br>
</div><div>I have been doing a lot of reading and using trial and error and reading and re-reading the replies but havent got it to work yet. I'm guessing "be" is backend? Here is the latest script ive tried but still no joy</div>
<div>:( :</div><div><br></div><div><div>#!/usr/bin/env python</div><div><br></div><div>import sys</div><div>if len(sys.argv) != 3:</div><div> raise Exception('Invalid argument count')</div><div>chanid, starttime = sys.argv[1:3]</div>
<div>import os</div><div>from MythTV import MythBE, findfile</div><div>be = MythBE()</div><div>prog = be.getRecording(<chanid>, <be>)</div><div>oldbase = prog.basename.rsplit('.',1)[0]</div><div>newbase = prog.formatPath('%m-%d_%H-%i-%s_%cN_%T').rsplit('.',1)[0]</div>
<div>sg = findfile(prog.basename, prog.storagegroup)</div><div>if sg is None:</div><div> raise Exception('file not found')</div><div>from MythTV import System</div><div>ccextractor = System(path="/home/dave/uksub2srt/uksub2srt.py")</div>
<div>ccextractor('-i', os.path.join(sg.dirname, prog.basename),</div><div> '-o', '/home/subtitles/{0}.srt'.format(newbase))</div></div><div><br></div><div>dave</div>
<div><br></div><div><br><br><div class="gmail_quote">On 3 February 2012 18:52, Michael T. Dean <span dir="ltr"><<a href="mailto:mtdean@thirdcontact.com" target="_blank">mtdean@thirdcontact.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>On 02/03/2012 01:15 PM, David Crawford wrote:<br>
> Would it be "be" and "starttime" ?<br>
<br>
</div>FWIW--and speaking as an outsider to this conversation looking in (I'll<br>
admit I haven't read all the replies in this thread)--Raymond seems to<br>
have gone out of his way to help you out with this script, and it seems<br>
that you're not doing as much as you probably should to "help him help<br>
you." Perhaps you could spend a little more time trying to work through<br>
what the script is doing and how to make it do exactly what you want<br>
before asking questions--and I think if you do, you'll find that you're<br>
able to figure out many of the answers by yourself. This way, when you<br>
do ask questions they would be more-carefully-considered questions about<br>
things that you may not be able to figure out without guidance.<br>
<br>
Since the goal of your script seems to be very much a personal goal (and<br>
not one that would help the community in general--based on<br>
<a href="http://www.gossamer-threads.com/lists/mythtv/users/501301#501301" target="_blank">http://www.gossamer-threads.com/lists/mythtv/users/501301#501301</a> +<br>
<a href="http://www.gossamer-threads.com/lists/mythtv/users/501367#501367" target="_blank">http://www.gossamer-threads.com/lists/mythtv/users/501367#501367</a> , which<br>
are, to be honest, a bit cryptic about what exactly you're trying to<br>
do)--your taking the time to figure out exactly what's going on with the<br>
script would help you, too. It would allow you to fix the script on<br>
your own when it breaks or to update or enhance it or to create your own<br>
scripts in the future.<br>
<br>
To do this will involve a lot of searching on the Internet, looking at<br>
completed/working scripts (to get an idea of how Python works in<br>
general, and to get an idea of how the MythTV Python bindings work--see,<br>
for example, <a href="http://www.mythtv.org/wiki/Category:Python_Scripts" target="_blank">http://www.mythtv.org/wiki/Category:Python_Scripts</a> ), as<br>
well as trial and error. If you pick some of the shorter scripts and<br>
pick apart exactly what they're doing, I think it will help you figure<br>
out how the script/pieces he's provided work. You'll also need to do<br>
some searching on the Internet to learn what's going on. And, you may<br>
need to consult some Python scripting tutorials (search for "python<br>
scripting tutorial" (no quotes) with your favorite search engine). And,<br>
lastly, probably reading and re-reading this thread--your questions and<br>
his replies.<br>
<br>
This isn't meant to be "mean" or in any way say that you're on your own,<br>
but is just trying to suggest some approaches that might help you to<br>
learn a new programming language. I know that learning programming and<br>
programming languages can seem like a daunting task, but with the right<br>
tools and approach, it's quite possible. And, if you want to create<br>
customized computer programs, chances are you're going to need to figure<br>
it out, eventually.<br>
<br>
Mike<br>
<div><div>_______________________________________________<br>
mythtv-users mailing list<br>
<a href="mailto:mythtv-users@mythtv.org" target="_blank">mythtv-users@mythtv.org</a><br>
<a href="http://www.mythtv.org/mailman/listinfo/mythtv-users" target="_blank">http://www.mythtv.org/mailman/listinfo/mythtv-users</a><br>
</div></div></blockquote></div><br></div>