Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Ian Kelly Newsgroups: comp.lang.python Subject: Re: one command on backslash and space for review Date: Sun, 10 Jul 2016 11:41:28 -0600 Lines: 27 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: news.uni-berlin.de uvU+Vi//A/9bTE5LGJmOZAB7rprF2oFiHL3NiktFjskQ== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.005 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'cc:addr:python-list': 0.09; 'backslash': 0.09; 'cmd': 0.09; 'delimited': 0.09; 'subject:command': 0.09; 'python': 0.10; '2.7': 0.13; 'question.': 0.13; '2016': 0.16; 'i.e': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'unnecessary.': 0.16; 'wrote:': 0.16; 'string': 0.17; 'thoughts': 0.18; 'team,': 0.18; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'am,': 0.23; 'seems': 0.23; 'header :In-Reply-To:1': 0.24; 'command': 0.26; 'linux': 0.26; 'message- id:@mail.gmail.com': 0.27; 'correct': 0.28; 'idea': 0.28; 'fine': 0.28; 'correct,': 0.29; 'formed': 0.29; 'sleep': 0.29; 'run': 0.33; 'quotes': 0.33; 'running': 0.34; 'received:google.com': 0.35; 'could': 0.35; 'but': 0.36; 'subject:: ': 0.37; 'still': 0.40; 'sample': 0.63; "they're": 0.66; 'here': 0.66; 'jul': 0.72; '9:19': 0.84; 'subject:review': 0.84; 'subject:space': 0.84; 'to:none': 0.91 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:cc; bh=5z9/et0vK7V1I0zkqkUAF3ty8RkWAqBR2toPg6AjHN4=; b=GgIW7Hod3jjZ9Ph7MxdIzfjlG/5hMrhT9KE4G0WXUbMqcpFSfy+awh/JjqBA9ZhOgc p1RRi9OKVFh90YWB8bkhvZVykqM+LAap4hGErNLHshqaMPG7oFD1R/p6TWcppGl52RRV 3c9svM6kDH4ymRi9u7c5ZbBTRF/UIoGHRKwBzgHwRs0TVB2H0GcE815QIQcs4Z5NSApy eyP/6k3MilBfnU/yjuTUwGV1kZdBa+1tFaTyXtD3GG7hNs36ke3cMQN3PHj5KghTaLkX hzpHfOnL8wdzINCe0Y5INRBfNwjXhDiHnBxhI/tIlcIL3gKWyMq2sl+/zZzZZ93AoJLb ha4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:cc; bh=5z9/et0vK7V1I0zkqkUAF3ty8RkWAqBR2toPg6AjHN4=; b=IZegSOGMW8M90GwppNJPHjw8GIUG+bHV95fYm+uI42UMoTYwQl69az0aIHu3dn/88z qOS/7BCNfJu6L+FtUcG5aZjbm7G95Dhkja8yR7YKziXBQU+2LaEUF71ZvBf21SmfL+r8 ZyIzVRH2EHzOT1KKTKXthNTBgnKD3IW3xxUBY64XD1ENcZmiKSnu/WOIYWgx/62p4Bqr SpkrkE/x1Q5ZUBdpZ+TBePMl9KW9x5FWHO65hn4KMF/vIo//J9KUcagbDPuFd27I3FTk fG+KgGikpkNzZSUp3UuNS3LcJN0fiNSSXekyKYbD47E/sJWbNc0GKVF7wN7bNGg54hiX dK+A== X-Gm-Message-State: ALyK8tItAHX1bCYFRQShlheEnR6xLWmavOHEGN3XxxMtVu6cg4p/CbOY0VD9+Xt1t3EYf8nMr6c9n/a7jUPcfQ== X-Received: by 10.157.37.119 with SMTP id j52mr8650936otd.115.1468172527666; Sun, 10 Jul 2016 10:42:07 -0700 (PDT) In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: X-Mailman-Original-References: Xref: csiph.com comp.lang.python:111255 On Sun, Jul 10, 2016 at 9:19 AM, Ganesh Pal wrote: > Hello Team, > > I am on python 2.7 and Linux , I want to form the below sample > command so that I could run it on the shell. > > Command is --> run_parallel -za1 -s 'daemon -cf xyz; sleep 1' > > Here is how I formed the command and it seems to look fine and work > fine , but I think it could still be better any idea ? > >>>> cmd = "run_parallel -za" + str(number) + \ > ... " -s" + " \'daemon -cf xyz; sleep 1\'" cmd = "run_parallel -za{} -s 'daemon -cf xyz; sleep 1'".format(number) > Looking for thoughts around: > > 1. If backslash are syntactically correct They're correct, but using them before single quotes in a string delimited by double quotes is unnecessary. > 3. Iam running sleep command on the cluster i.e , how could I make it > look Python or its fine to have sleep ? I don't understand the question.