Hello everyone,
I'm trying to basically get a cmd variable to pass into commands.getstatusoutput. The problem is that the command has a lot of single and double quotes in it and I can't seem to get it to store as a variable. When I print the cmd it comes out as I want it to (since I tried \ escaping one of the single quotes.. here is an example of what I'm trying to do:
cmd1 = "convert -pointsize %i -fill %s -draw " % (pointsize, fill)
cmd2 = '\'text %d,%d "%s Hour: %i"\' %s %s_cap.jpg' % (half_image, up_buff, out_month, hour, jpg, jpg)
cmd = cmd1+cmd2
if I print this it gives me:
convert -pointsize 72 -fill yellow -draw 'text 900,180 "September 21 Hour: 0"' example.jpg example.jpg_cap.jpg
But just simply typing cmd into the prompt or passing the cmd I'm still getting those \ in there. So I need a way of avoiding using them. I'm sure this is pretty common place, but I'm drawing a blank. cmd2 will give me an error if I try to type it in without the escape () character. Thanks in advance!