Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.008 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'arguments': 0.09; 'solution,': 0.09; 'subject:command': 0.09; 'subject:module': 0.09; 'subject:using': 0.09; 'cc:addr:python-list': 0.11; '*name*': 0.16; 'andreas': 0.16; 'argument.': 0.16; 'closed.': 0.16; 'expecting': 0.16; 'expects': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'tempfile': 0.16; 'subject:python': 0.16; 'wrote:': 0.18; 'wed,': 0.18; 'all,': 0.19; 'bit': 0.19; 'module': 0.19; 'cc:addr:python.org': 0.22; 'exists': 0.24; 'file.': 0.24; 'cc:2**0': 0.24; 'header:In-Reply- To:1': 0.27; 'dec': 0.30; 'message-id:@mail.gmail.com': 0.30; 'file': 0.32; 'another': 0.32; 'open': 0.33; 'url:python': 0.33; 'subject:with': 0.35; "can't": 0.35; 'one,': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'object,': 0.36; "i'll": 0.36; 'url:org': 0.36; 'list': 0.37; 'url:library': 0.38; 'pm,': 0.38; 'rather': 0.38; 'that,': 0.38; 'url:3': 0.61; "you're": 0.61; 'first': 0.61; 'here:': 0.62; "you'll": 0.62; 'more': 0.64; 'fact,': 0.69; 'guaranteed': 0.75; 'to:none': 0.92; '2013': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=ncxXrplNQqqzjQ0iXPzsstVxyesfbn+Bu6JolvSzgiQ=; b=YR1WTk88XITq12ooXCgMKj/lhX16cIvbHHwvrqzwvPriyXdqMuVLT1AXSXNaUXvPfi +I/XZ5uLDY8uMqm3ZPgPWdZSR2R/dN3TW8tj99V/J1crVZqqZstzuJwcJ7Ffyf2o9rN5 X6A+pwZoWrsvcB5veaI03zbasHjRXG5mLLGhilub+GPdlB/CbMWWRdH7IFjxwvQk29sx hWudak7xtI3b1hQ/Q0+UduNYHMi1MvRrbOjds0C44vFSRh9N31EbGbBt+65CwHrUwg0S ceiiZ70K80FEptNqUdQUgA3nhcolUD4oWv3lHtzVp8AaIZJ8kdl3YxYAcpW7HEJMxHT6 nn7A== MIME-Version: 1.0 X-Received: by 10.68.248.33 with SMTP id yj1mr44370576pbc.45.1386154309220; Wed, 04 Dec 2013 02:51:49 -0800 (PST) In-Reply-To: <20131204103827.6c5332c6@Hof> References: <3104d38f-3fca-43b0-b6a4-b600684f765e@googlegroups.com> <6fb2b162-cf9b-4c1c-bf5f-f14baf5baac4@googlegroups.com> <35c86484-d0dd-4954-adee-cde3a2fd7ac1@googlegroups.com> <20131204103827.6c5332c6@Hof> Date: Wed, 4 Dec 2013 21:51:49 +1100 Subject: Re: using ffmpeg command line with python's subprocess module From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 18 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1386154312 news.xs4all.nl 2948 [2001:888:2000:d::a6]:33992 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:61008 On Wed, Dec 4, 2013 at 8:38 PM, Andreas Perstinger wrote: > "fp" is a file object, but subprocess expects a list of strings as > its first argument. More fundamentally: The subprocess's arguments must include the *name* of the file. This means you can't use TemporaryFile at all, as it's not guaranteed to return an object that actually has a file name. There's another problem, too, and that's that you're not closing the file before expecting the subprocess to open it. And once you do that, you'll find that the file no longer exists once it's been closed. In fact, you'll need to research the tempfile module a bit to be able to do what you want here; rather than spoon-feed you an exact solution, I'll just say that there is one, and it can be found here: http://docs.python.org/3.3/library/tempfile.html ChrisA