Question: I have written my own module, mainly handling a filefield for a django site. After messing around with some things related to mod\_wsgi (solved by updating to 3.3), i got my code to run. Right after all the necessary imports, before defining any classes or functions, i test for the availability of sox, an audiocommandlinetool essential to some of my modules functions:

```
sox = 'path/to/sox'
test=subprocess.Popen([sox,'-h'], shell=False, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
error=test.communicate()[1]
if error:
    raise EnvironmentError((1,'Sox not installed properly'),)

```

This worked fine. Now i have updated ubuntu from 8.04 to 10.04 and the code aborts on the line of the call to subprocess.Popen, throwing the following error message:

```
File "/usr/lib/python2.6/subprocess.py", line 1139, in _execute_child
    raise child_exception
OSError: [Errno 8] Exec format error  

```

I already looked for execution rights of sox, i have no other idea where to look for a solution of this. Can subprocess execution rights be limited? Any hints what could be going on here?

Answer: 
`||` says: if any condition is true, It'll return true, without looking at the ones after it.

So `true || false` is true, `false || true` is true.

In your case, you say "if strExt is not equal to **wav** and is not equal to **mp3**, then execute the code". In case that one of them is true, it executes.

I'm thinking that you're looking for the `&&` symbol. The `logical and` says "I'll return true only if every condition is true" - when it hits a false, it returns false.

What I think your code should look like:

```
if (strExt!='wav' && strExt!='mp3')

```
If you want to get into second `if`, when `strExt` is not equal to both `'wav'` and `'mp3'` you need to use an `&&` operator.

```
if (strExt!='wav' || strExt!='mp3')

```

when `strExt='wav'` => `strExt!='wav'` = false; `strExt!='mp3'` = true => false or true = true and gets into `if` statement and is the case is similar when `strExt='mp3'` .