On Sun, 24 Nov 2013 17:55:08 -0800 (PST), Himanshu Garg <hgarg.in...@gmail.com> wrote:
Like, I have two scripts "scrip1.py" and "script2.py" and there is
a line in "script1.py" to call "script2.py" as subprocess.call(["python", "script2.py"]).

Then this is should call script2 but I should not be able to
directly call script2 as $python script2.py

Are you really trying to protect against yourself accidentally invoking it or someone maliciously doing it? I would probably give scrpt2 an obnoxious name like htrerttcdrrthyyh.py or put it in an obscure directory. But if you explain the rationale we might come up with something better.

How about naming it dontrunme.py ?

--
DaveA

--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to