In article 5yudnafyso8houtwnz2dnuvz_tidn...@westnet.com.au,
R (Chandra) Chandrasekhar chyav...@gmail.com wrote:
---
import subprocess
width = 5
height = 30
colors = ['#abcdef]', '#456789']
filename = /tmp/image.png
# I want to get the equivalent of variable interpolation in Perl
# so that the
Dear Folks,
I want to execute a command from within python using the subprocess module.
Coming from a Perl background, I thought I could use variable
interpolation in strings, but found that this is neither supported nor
the Python way. Accordingly, I am a little at sea about how to
* R (Chandra) Chandrasekhar:
width = 5
height = 30
colors = ['#abcdef]', '#456789']
filename = /tmp/image.png
# I want to get the equivalent of variable interpolation in Perl
# so that the command
#
# convert -size 5x30 gradient:#abcdef-#456789 /tmp/image.png
#
# is derived from the variables
R (Chandra) Chandrasekhar wrote:
I want to execute a command from within python using the subprocess
module.
Coming from a Perl background, I thought I could use variable
interpolation in strings, but found that this is neither supported nor
the Python way. Accordingly, I am a little at
Peter Otten wrote:
import subprocess
def convert(width=5, height=30, colors=['#abcdef', '#456789'],
filename=tmp/image with space in its name.png):
lookup = locals()
assert all(\n not in str(s) for s in lookup.values())
subprocess.call(\
convert
-size
{width}x{height}
On 2/15/2010 7:35 AM, R (Chandra) Chandrasekhar wrote:
Dear Folks,
I want to execute a command from within python using the subprocess module.
Coming from a Perl background, I thought I could use variable
interpolation in strings, but found that this is neither supported
Yes, it is: see the
Peter Otten wrote:
import subprocess
def convert(width=5, height=30, colors=['#abcdef', '#456789'],
filename=tmp/image with space in its name.png):
lookup = locals()
assert all(\n not in str(s) for s in lookup.values())
subprocess.call(\
convert
-size
{width}x{height}
R (Chandra) Chandrasekhar wrote:
Peter Otten wrote:
import subprocess
def convert(width=5, height=30, colors=['#abcdef', '#456789'],
filename=tmp/image with space in its name.png):
lookup = locals()
assert all(\n not in str(s) for s in lookup.values())
Alf P. Steinbach wrote:
* R (Chandra) Chandrasekhar:
width = 5
height = 30
colors = ['#abcdef]', '#456789']
filename = /tmp/image.png
# I want to get the equivalent of variable interpolation in Perl
# so that the command
#
# convert -size 5x30 gradient:#abcdef-#456789 /tmp/image.png
#
# is
R (Chandra) Chandrasekhar wrote:
Peter Otten wrote:
import subprocess
def convert(width=5, height=30, colors=['#abcdef', '#456789'],
filename=tmp/image with space in its name.png):
lookup = locals()
assert all(\n not in str(s) for s in lookup.values())
On Tue, 16 Feb 2010 00:11:36 +0800, R (Chandra) Chandrasekhar wrote:
One other question I forgot to ask is this why is there a terminal
backslash in
subprocess.call(\
Removing the backslash makes the function fail.
I wonder why, because is supposed to allow multi-line strings. I am
11 matches
Mail list logo