Question: I need help with my program. I declared a one-dimensional array of 6 and I want to show random values between 1-6 in a text box 

My question is how do I show values in my array in textbox1.text?

Here is my code:

```
Public Sub ClickMyFirstClassButton()

   If FirstClass.Checked = True Then

        'This piece of code declares an array
        Dim Seats As Integer()

        'This is a One Dimensional Array
        ReDim Seats(6)

        TextBox1.Text = (String.Format("First Class is checked. The number of seats are : ", (Seats)))
        'ElseIf FirstClass.AutoCheck = True Then

        'MessageBox.Show("FirstClass is Auto checked")
    End If
End Sub 

```

I messed around with my program and this is what I did.

Public Sub ClickMyFirstClassButton()

```
    If FirstClass.Checked = True Then

        'Dim Seats As Integer() = {1, 2, 3, 4, 5, 6}
        Dim Seats(0 To 6) As Integer
        Seats(0) = 1
        Seats(1) = 2
        Seats(2) = 3
        Seats(3) = 4
        Seats(4) = 5
        Seats(5) = 6

        TextBox1.Text = (String.Format("First Class is checked. Your seat is : {0}", Seats(RandomNumber(Seats))))
        MessageBox.Show(String.Format("First Class is checked. Your seat is : {0}", Seats(RandomNumber(Seats))))
        'ElseIf FirstClass.AutoCheck Then

        'MessageBox.Show("FirstClass is Auto checked")

    End If
End Sub

```

Answer: 
As suggested by @eryksun, this solves the issue:

```
p = subprocess.Popen('clip.exe', stdin=subprocess.PIPE, stdout=subprocess.PIPE, universal_newlines=True)
p.communicate('hello \n world')
p.wait()

```
I suspect it's because you're using `shell=True`, refactor your code to not use it.

But I would suggest abandoning this approach alltogether and use [pyperclip](https://pypi.python.org/pypi/pyperclip/) for the clipboard support. It's cross-platform and freely available.