python script run commands as needed
<p>I need to run these commands as needed. Preferably I'd like to double click the file, and have the commands run, then the file closes.</p>

<p>However, when I run the command via open terminal on ubuntu and type <code>./start_wifi.py</code> it fails with:</p>

<pre><code>$ ./start_wifi.py 
^C./start_wifi.py: line 6: syntax error near unexpected token `"rfkill unblock all"'
./start_wifi.py: line 6: `os.system("rfkill unblock all")'
</code></pre>

<p><strong>here is my script:</strong></p>

<pre><code>#!/bin/bash

import os
import time

os.system("rfkill unblock all")
print("\nunblocked wlp5s0\n")
os.system("sudo iwlist wlp5s0 scan")
print("\nscanned for wireless networks\n")
os.system("sudo ip link set wlp5s0 up")
print("\nbrought up wlp5s0...\ngive it 5 seconds...\nsleeping now\n")
time.sleep(5)
exit()
</code></pre>

<p>What can I do to achieve this?</p>