how to print array without adding newline

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

how to print array without adding newline

This post has NOT been accepted by the mailing list yet.
Hello: I am trying to output an array to another program that takes an array as input, but the print statement adds a newline. If it were adding to each individual element, I could solve it easily, but it is adding one at the end of the array. Is there another way to print an array besides

print arrayname

If it were a string, I have a whole host of options, but I need it to be output as an array. Each element is a url. I call it from a browser, and it works except for the added newline.

Here are the relevant lines:

/* code that connects to cloudfiles omitted */

containers = conn.get_all_containers()
print "Content-type: text/html\n\n";
    del wholelist[int(sys.argv[1]):]
    while i < int(sys.argv[1]):
        i = i+1
except IndexError, e:
    del newlist[5]
print newlist

The output I am seeing is as follows:

['', '', '']

Any tips on better coding practices are welcome, but please don't beat me up