Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #111255

Re: one command on backslash and space for review

From Ian Kelly <ian.g.kelly@gmail.com>
Newsgroups comp.lang.python
Subject Re: one command on backslash and space for review
Date 2016-07-10 11:41 -0600
Message-ID <mailman.172.1468172537.2295.python-list@python.org> (permalink)
References <CACT3xuWi-BTNM2QRe3Gdk4ZyqyFn-m0U-RNPxJXS2sgMd55ciA@mail.gmail.com> <CALwzidk1Z30Q9RiLQgcM50+o_jDx-yVYcB7mnEH2KNfbaCg8zw@mail.gmail.com>

Show all headers | View raw


On Sun, Jul 10, 2016 at 9:19 AM, Ganesh Pal <ganesh1pal@gmail.com> 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.

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: one command on backslash and space for review Ian Kelly <ian.g.kelly@gmail.com> - 2016-07-10 11:41 -0600

csiph-web