Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: eryk sun Newsgroups: comp.lang.python Subject: Re: problem Date: Thu, 14 Jan 2016 15:39:12 -0600 Lines: 22 Message-ID: References: <5697f08f$0$23822$e4fe514c@news.xs4all.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: news.uni-berlin.de kYhwVNjRS2496n/dM0qGEwbCJWlM8L0YsvtU8mIO3OiA== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'cmd': 0.09; 'exit.': 0.09; 'repl': 0.09; 'scripts,': 0.09; 'python': 0.10; 'jan': 0.11; 'interpreter': 0.15; 'thu,': 0.15; '2016': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'subprocess': 0.16; 'wrote:': 0.16; 'shell': 0.18; 'input': 0.18; 'to:name:python-list@python.org': 0.20; 'subject:problem': 0.22; 'am,': 0.23; 'import': 0.24; 'header:In-Reply-To:1': 0.24; 'chris': 0.26; 'fri,': 0.27; 'message-id:@mail.gmail.com': 0.27; '14,': 0.27; '15,': 0.30; 'checked': 0.31; 'gets': 0.35; 'received:google.com': 0.35; 'something': 0.35; 'should': 0.36; 'instead': 0.36; 'received:209.85': 0.36; 'to:addr:python-list': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'setting': 0.37; 'received:209.85.213': 0.37; 'received:209': 0.38; 'skip:o 20': 0.38; 'end': 0.39; 'to:addr:python.org': 0.40; 'your': 0.60 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=A1jZe2QnIpyCvjKVejZpOAjRoWaR8wFPT7kdNa1s4TI=; b=Q23JJ8cXrh41jnCRlW/oAfffR2BRsdDJEyDEXDYH9rBltcEeKRUkk6pLLIBDLt3gya hMoztvI6AIPf3NkVMYPG2QILiiVRoM97KwnLRRxWuAvz0qzQy4hOmi/vGIUbycD6xcMe IqTmBxYxDC+PzDDC2R63QEWVSsbkqloOi8kD1PJLW3+2VLDNJvDcz6czDTw7UWYuaWQq vHMjGFJSVV5u6gInWTNClKqgSS5cdJ8+jW0Y4roVcydhvzLZ65vQs9vCv//1xJyAb2jk TXWJAHDfv1X4z/ZxwOfwTW6AK2Xnb7wjPuESvTIdvd/5YKFX+5lW5RkhfJEk2PoFk6Td OXKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:content-type; bh=A1jZe2QnIpyCvjKVejZpOAjRoWaR8wFPT7kdNa1s4TI=; b=elHbmgpJSWy1REG+tHvs1YHRrR3X4p/aPLSfLgyf0QyzuncvAQG//bIMPubs78ynHJ uxs5SpmKQplBXkXr40RcHM+vsEwFvwz/vjGPtHX/MBHUuEtqp3JGk27/Y8M7Ka7ZWQPx 8ZQ1/f7PN1ypR9+EtJn+pLcP3K1lF6rrMGv+DEpwQQ+yefU7PfYyTs+VNPCwBl+qkmTz DzyTOBB6oVMyjGLUBpXpRmcxVIkmUGsKFB3gF3cX3fUAMSTTqox5gWtnJVuwmFTK5cRl Shx6Q0DRNLkebfNq21LQYnzBHS5etE0eyyLMsy+V54JK4/K9i1hXyMOMtwCZQgKHqVSb DU/A== X-Gm-Message-State: ALoCoQl2rRKrp8GxGLrO60fgMkB6o9C3QUrVmIj8Pxacd2o+jWgBE4j6jRy4InUEHLntfuLcWkzicbNdlkE8bO8r/iNjXEzGkA== X-Received: by 10.50.4.38 with SMTP id h6mr7178179igh.32.1452807592063; Thu, 14 Jan 2016 13:39:52 -0800 (PST) In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com comp.lang.python:101718 On Thu, Jan 14, 2016 at 3:10 PM, Chris Angelico wrote: > On Fri, Jan 15, 2016 at 6:01 AM, Irmen de Jong wrote: >> Either put something like this at the end of your python scripts, to keep the console open: >> >> raw_input("press enter to exit...") > > Small qualification: This is 3.5, so you should use input instead of raw_input. > > input("Press enter to exit...") You can also make the interpreter enter the REPL by setting PYTHONINSPECT, which works for the current process since this gets checked at exit. import os os.environ['PYTHONINSPECT'] = '1' Or use subprocess.Popen to start a new cmd shell attached to the current console: import subprocess subprocess.Popen('cmd.exe')