How to build a comma separated array in python : <p>I have a list of user id's in a list in python
<code>['user1', 'user2' , 'user3',...]</code> 
and i am trying to build an array from these list of user id's and then trying to pass this new array into a shell command in python. I am able to do all the other steps but i am stuck with this building an array thing. </p>

<p>I have tried this so far, </p>

<pre><code>my_list = ['user1', 'user2' , 'user3'
string = "user_id="
var = [string + x for x in my_list]
</code></pre>

<p>But what i actually need is something like this</p>

<pre><code>var = "(|(user_id=user1)(user_id=user2)(user_id=user3))"
</code></pre>

<p>and this list goes for many other values.
I am stuck here how to build this value <code>(user_id=user1)(user_id=user2)(user_id=user3)</code> in python.</p>

<p>Can anyone suggest some ideas?</p>
