In article <5yudnafyso8houtwnz2dnuvz_tidn...@westnet.com.au>,
R (Chandra) Chandrasekhar 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 comma
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 s
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 d
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())
>>
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{heig
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 u
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{hei
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
* 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
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
accomplis
11 matches
Mail list logo