Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!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.009 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'shutil': 0.07; 'received :mail-lpp01m010-f46.google.com': 0.09; 'unix,': 0.09; 'subject:not': 0.11; 'subject:Why': 0.16; 'subprocess': 0.16; 'way:': 0.16; 'worst': 0.16; 'wrote:': 0.19; 'import': 0.20; 'header:In-Reply-To:1': 0.22; 'case,': 0.23; 'message- id:@mail.gmail.com': 0.24; 'src': 0.28; 'yes.': 0.28; 'received:209.85.215.46': 0.30; 'received:209.85': 0.32; 'received:google.com': 0.32; 'could': 0.32; 'am,': 0.34; 'to:addr :python-list': 0.35; 'received:209': 0.35; 'subject:?': 0.35; 'received:209.85.215': 0.37; 'why': 0.37; 'subject:: ': 0.37; 'skip:s 20': 0.37; 'to:addr:python.org': 0.39; 'header:Received:5': 0.40; '2012': 0.62 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=LSb6y/VZkSMXHYIqmdxdc2tvYp4I87hqDxXCWoihMCQ=; b=a2FNYmd+1Kj8J9+pBzYycL9wwQDUj4v27vKsncXcljkQAN7Y5inMX8uRSop9VbvzA8 JoVbfT3fUFUZ7X04Vg9beBKzplGHIxkjv89bXRepzcziVgdyJi+dvEqMbQj4yWTwWI44 0cL756t7Q3ZnvETgaZWWDlkVa6qGayneTRbUAFZ/IYehYgwuKQ9Q1qAIkXFwMhBexX+a MpzHfJb6vPAPG6WgMoANxzuRkbmXb0WSL53F1U/MWvZv0LrrlG65vKnnESaqZrglouAR p0K13rhAzVfwi3Mb1BT4xVGfvL6NHMg3fya7gBgelmk4GvmpkIGE2xYT2MvImPj9Nabx 6B6w== MIME-Version: 1.0 In-Reply-To: References: <38b3fc48-1d05-4373-b32e-64da95173864@pz2g2000pbc.googlegroups.com> From: Ian Kelly Date: Tue, 3 Apr 2012 10:29:24 -0600 Subject: Re: No os.copy()? Why not? To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 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: 22 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1333470597 news.xs4all.nl 6863 [2001:888:2000:d::a6]:50727 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:22615 On Tue, Apr 3, 2012 at 12:24 AM, Thomas Rachel wrote: > Am 02.04.2012 23:11 schrieb HoneyMonster: > > >> One way: >> import os >> >> os.system ("cp src sink") > > > Yes. The worst way you could imagine. > > Why not the much much better > > from subprocess > subprocess.call(['cp', 'src', 'sink']) In any case, either of these approaches will only work in UNIX, whereas shutil is cross-platform.