Aborting Execution, If Filename is changed
<p>This was A Question Asked by my teacher. "How Would You Stop Your Script From Executing, IF Filenamed is renamed by User."</p>

<p>I had sumthing this idea in my mind.</p>

<pre><code>#consider the name of the script to be myscript.py
import os
signal = 0
while 1:
    if "myscript.py" not in os.listdir("."):
        signal = 1
    else:
        if signal:
            break
        else:
            #do the requirements
</code></pre>

<p>But then He said, whatif, the user has a file named "myscript.py" already in the directory, and he changed the name of the script, the script would run well. And there I got stuck.</p>

<p>I am using python2.7, OS: Windows, Allowed To use Any external Libraries if required, Any suggestions?</p>
