Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #111255 > unrolled thread
| Started by | Ian Kelly <ian.g.kelly@gmail.com> |
|---|---|
| First post | 2016-07-10 11:41 -0600 |
| Last post | 2016-07-10 11:41 -0600 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.lang.python
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: one command on backslash and space for review Ian Kelly <ian.g.kelly@gmail.com> - 2016-07-10 11:41 -0600
| From | Ian Kelly <ian.g.kelly@gmail.com> |
|---|---|
| Date | 2016-07-10 11:41 -0600 |
| Subject | Re: one command on backslash and space for review |
| Message-ID | <mailman.172.1468172537.2295.python-list@python.org> |
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 top | Article view | comp.lang.python
csiph-web