Question: I've tried to run a simple "hello world" python script but in my browser it shows plain text and doesn't run.

```
    #!/usr/bin/python

    print "Content-type: text/html"
    print ""

    print "Hello, World"

```

But if I run it using a php exec function, the "Hello World" script runs.

```
    <?php
    echo exec('python hello.py');
    ?>

```

What am I missing to make the .py files run normally?
It's apache on Linux

Answer: 
The crudest solution would be to run it twice .. (*once for each `id`*)

```
onclick="toggle_visibility('first-id');toggle_visibility('second-id')"

```

---

Another would be to pass an array of id values

```
<script type="text/javascript">
function toggle_visibility(ids) {
    for(i=0,len = ids.length; i < len; i++) {
        var e = document.getElementById(ids[i]);
        if(e.style.display == 'block')
            e.style.display = 'none';
        else
            e.style.display = 'block';
    }
}
 </script>

```

And call it like this

```
onclick="toggle_visibility(['first-id','second-id']);"

```
can't you use same function but add the other id ?

```
     <script type="text/javascript">
    function toggle_visibility(id1,id2) {
    var e = document.getElementById(id1);
    var f = document.getElementById(id2);
    if(e.style.display == 'block'&& f.style.display == 'block')
{
      e.style.display = 'none';
      f.style.display = 'none';
}
    else
{
      e.style.display = 'block';
      f.style.display = 'block';
}
    }
     </script>

```

then

```
onclick="toggle_visibility('id_of_element_to_toggle1','id2');"

```