Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #60397

Re: Excute script only from another file

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!xlned.com!feeder3.xlned.com!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.003
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'scripts': 0.03; 'subject:file': 0.07; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject:script': 0.09; 'garg': 0.16; 'invoking': 0.16; 'maliciously': 0.16; 'naming': 0.16; 'rationale': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'wrote:': 0.18; 'trying': 0.19; 'header:User-Agent:1': 0.23; 'directory.': 0.24; 'header:X -Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; 'accidentally': 0.31; 'obscure': 0.31; 'probably': 0.32; 'subject:from': 0.34; 'something': 0.35; 'but': 0.35; 'there': 0.35; 'really': 0.36; 'like,': 0.36; 'doing': 0.36; 'should': 0.36; 'two': 0.37; 'nov': 0.38; 'to:addr:python-list': 0.38; 'explain': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'how': 0.40; 'name': 0.63; 'yourself': 0.78; 'protect': 0.79; '2013': 0.98
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Dave Angel <davea@davea.name>
Subject Re: Excute script only from another file
Date Sun, 24 Nov 2013 22:20:21 -0500
References <989ee1b9-141a-4cb3-a9a2-f1527c0d0db3@googlegroups.com> <989ee1b9-141a-4cb3-a9a2-f1527c0d0db3@googlegroups.com>
Content-Type text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding 8bit
X-Gmane-NNTP-Posting-Host 174.32.174.29
In-Reply-To <989ee1b9-141a-4cb3-a9a2-f1527c0d0db3@googlegroups.com>
User-Agent Groundhog Newsreader for Android
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.3157.1385349595.18130.python-list@python.org> (permalink)
Lines 21
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1385349595 news.xs4all.nl 15987 [2001:888:2000:d::a6]:48834
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:60397

Show key headers only | View raw


On Sun, 24 Nov 2013 17:55:08 -0800 (PST), Himanshu Garg 
<hgarg.india@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

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Excute script only from another file Himanshu Garg <hgarg.india@gmail.com> - 2013-11-24 17:55 -0800
  Re: Excute script only from another file Chris Angelico <rosuav@gmail.com> - 2013-11-25 14:15 +1100
  Re: Excute script only from another file Dave Angel <davea@davea.name> - 2013-11-24 22:20 -0500
    Re: Excute script only from another file Larry Hudson <orgnut@yahoo.com> - 2013-11-26 00:10 -0800
  Re: Excute script only from another file Michael Torrie <torriem@gmail.com> - 2013-11-24 19:58 -0700
  Re: Excute script only from another file Peter Otten <__peter__@web.de> - 2013-11-25 09:12 +0100
  Re: Excute script only from another file Himanshu Garg <hgarg.india@gmail.com> - 2013-11-25 02:52 -0800
    Re: Excute script only from another file Dave Angel <davea@davea.name> - 2013-11-25 07:16 -0500
    Re: Excute script only from another file Rick Johnson <rantingrickjohnson@gmail.com> - 2013-11-25 18:28 -0800
      Re: Excute script only from another file Chris Angelico <rosuav@gmail.com> - 2013-11-26 13:41 +1100
        Re: Excute script only from another file Rick Johnson <rantingrickjohnson@gmail.com> - 2013-11-25 19:45 -0800
      Re: Excute script only from another file Steven D'Aprano <steve@pearwood.info> - 2013-11-26 03:09 +0000
      Re: Excute script only from another file Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2013-11-26 12:25 -0500
      Re: Excute script only from another file Chris Angelico <rosuav@gmail.com> - 2013-11-27 10:09 +1100
        Re: Excute script only from another file Rick Johnson <rantingrickjohnson@gmail.com> - 2013-11-26 17:56 -0800
          Re: Excute script only from another file Chris Angelico <rosuav@gmail.com> - 2013-11-27 13:39 +1100

csiph-web