Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder4.news.weretis.net!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.011 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'args': 0.07; 'subject:form': 0.07; 'subject:missing': 0.07; 'arguments': 0.09; 'specified,': 0.09; 'gui': 0.12; 'assume': 0.14; 'args.': 0.16; 'argument,': 0.16; 'brackets': 0.16; 'descriptor.': 0.16; 'descriptors': 0.16; 'descriptors.': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'mode,': 0.16; 'streams.': 0.16; 'subject:key': 0.16; 'variables:': 0.16; 'wrote:': 0.18; 'passing': 0.19; 'input': 0.22; 'rules': 0.22; 'convenient': 0.24; 'directory.': 0.24; "haven't": 0.24; 'environment': 0.24; 'values': 0.27; 'gets': 0.27; 'header:In-Reply-To:1': 0.27; 'specifically': 0.29; 'am,': 0.29; 'generally': 0.29; 'unix': 0.29; 'message-id:@mail.gmail.com': 0.30; 'program,': 0.31; 'easier': 0.31; 'that.': 0.31; 'facility': 0.31; 'invoke': 0.31; 'name;': 0.31; 'sep': 0.31; 'file': 0.32; 'open': 0.33; 'fri,': 0.33; 'but': 0.35; 'received:google.com': 0.35; 'really': 0.36; 'doing': 0.36; 'subject:?': 0.36; 'should': 0.36; 'application': 0.37; 'turn': 0.37; 'list': 0.37; 'configured': 0.38; 'whatever': 0.38; 'to:addr:python-list': 0.38; 'skip:- 10': 0.38; 'little': 0.38; 'sure': 0.39; 'to:addr:python.org': 0.39; 'easy': 0.60; 'most': 0.60; 'course': 0.61; "you're": 0.61; 'provide': 0.64; 'talking': 0.65; 'prompt': 0.68; 'programs,': 0.74; 'square': 0.74; "it'd": 0.84; 'popup': 0.84; 'edwards': 0.91; 'these.': 0.91; '2013': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=Y5+mN+LGTCAtsCLTjrKFiCl2X/0ybQfRGlOM0HONdL4=; b=F2gzGtFZi9e5lwoMg/cmgkKr9jD3hl972yuIw+Z5QQa31EcDK6rAjyo1fif4aiYlob D1giiwC+f5Ta+huXYWoeSRPx2l+RXpoYZ1oAxme80GRYG9lE3QWz2KhVxlm5QOs7Suuh sbQfkEilAKE9L7wDO4FAg8NUJ61uuAeR2gnWoMc1OI5Mwz/+jDneI7qx6rK/C85DTK1V J6qblIxu8a64F6M+jsrXCFcngVzAhJK1785uvHkpqSie1oDzTp1M+4Q+1AviOACBKaLD AgnGxVbNRKAh0nWkCMtaJCYBuHso1CAVmOlTReoDrZ6YSJMqEFLIdjchbbwM6C8I+KOh Ykgg== MIME-Version: 1.0 X-Received: by 10.58.19.233 with SMTP id i9mr654628vee.36.1380208634937; Thu, 26 Sep 2013 08:17:14 -0700 (PDT) In-Reply-To: References: <5242f8bc$0$30000$c3e8da3$5496439d@news.astraweb.com> <52437bca$0$30000$c3e8da3$5496439d@news.astraweb.com> Date: Fri, 27 Sep 2013 01:17:14 +1000 Subject: Re: Referrer key missing form os.environ dictionary? From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 36 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1380208642 news.xs4all.nl 15896 [2001:888:2000:d::a6]:37527 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:54833 On Fri, Sep 27, 2013 at 12:11 AM, Grant Edwards wrote: > On a Unix system when you invoke a program, you "pass" it four things: > > 1) A dictionary where keys/values are both strings [enviornment variables] > 2) A list of strings [command line args] > 3) A set of open file descriptors. > 4) The current working directory. > > You can provide input values to the program through any of these. > > For interactive programs, 2 and 3 are the most convenient. Hrm, not sure about #3 for interactive programs, unless you specifically mean the three standard streams. With most Unix shells, you should be able to set environment variables: PGUSER=fred PGPASSWORD=secret psql Not as convenient as #2, but far easier than passing an open file descriptor. Of course, passing file descriptors around is pretty easy programmatically, but when you say "interactive" I assume you're talking also about an interactive shell. GUI interactions of course follow their own rules completely. In most systems, it's really easy to invoke an application with one argument, a file name; it's generally much harder to customize the arguments at the keyboard. OS/2 had a facility for doing that. You just put square brackets into the configured args and it'd turn it into a prompt: --foo=bar --mode=[Choose mode, 1-3:] %* You'd get a nice little popup with the prompt you specified, and whatever you type gets put into the args. Haven't seen that in any other system - at least, not as conveniently. ChrisA