Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed2.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.025 X-Spam-Evidence: '*H*': 0.95; '*S*': 0.00; 'interpreter': 0.05; 'continuation': 0.07; 'subject:code': 0.07; 'subject:using': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; 'redo': 0.16; 'subject:program': 0.16; 'wow,': 0.16; 'subject:python': 0.16; 'wrote:': 0.18; 'wed,': 0.18; '(but': 0.19; 'command': 0.22; 'cc:addr:gmail.com': 0.22; 'email addr:gmail.com>': 0.22; 'cc:addr:python.org': 0.22; 'cc:2**1': 0.23; 'commands,': 0.24; 'script.': 0.24; 'environment': 0.24; '>': 0.26; 'first,': 0.26; 'switch': 0.26; 'task': 0.26; 'defined': 0.27; 'header:In- Reply-To:1': 0.27; 'cool': 0.30; 'dec': 0.30; 'message- id:@mail.gmail.com': 0.30; 'url:mailman': 0.30; 'end,': 0.31; 'jean': 0.31; 'run': 0.32; 'url:python': 0.33; 'running': 0.33; 'something': 0.35; 'received:google.com': 0.35; 'url:listinfo': 0.36; "didn't": 0.36; 'possible': 0.36; 'url:org': 0.36; 'wrong': 0.37; 'pm,': 0.38; 'does': 0.39; 'itself': 0.39; 'url:mail': 0.40; 'manually': 0.60; "you're": 0.61; 'further': 0.61; 'to:addr:gmail.com': 0.65; 'line,': 0.68; 'console,': 0.84; 'copy- paste': 0.84; 'experiment': 0.84; 'subject:commands': 0.84; 'joel': 0.91; 'hill': 0.95; '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 :cc:content-type; bh=y1wgsurbNNBnBya5HOfRG4ciUXahMprTKrg+J4pSZ6o=; b=Jc5cHIn4zMvviTMhkN2RTqAebArKKqVnIdvHMckSsCX9fqUgDxEYFsJJmOzcU9VuLs e9utGDomZRVkrQZVg+vXE5oRxurKWwlOpORmk0VxtmB+cZNNVw6xm8P7Dy4oReAd9pi/ T3vfbrDAJ6LQoSnZSHUxDuQzcxN+7eg000NHKD55npll7ElvXw9QQTtensL2GLiY9r/l yQPA3kTjXprSO1dH6eP/rPSvYgbD2JScsiVEq3gv8A0dKfw+2k539OXO5/MM8oEVQgfK z0Etl3wOd4H96RPoajAYMjmBpdbuyIn9A0QrnKrhuim5zpb4OrPC3JjdtS25yqgReRn0 1jDA== MIME-Version: 1.0 X-Received: by 10.221.37.9 with SMTP id tc9mr1657308vcb.39.1387398585169; Wed, 18 Dec 2013 12:29:45 -0800 (PST) In-Reply-To: References: <7fb59330-6de2-4ea9-923e-7845de22df1e@googlegroups.com> Date: Wed, 18 Dec 2013 15:29:45 -0500 Subject: Re: how to develop code using a mix of an existing python-program and console-commands From: Joel Goldstick To: Jerry Hill Content-Type: multipart/alternative; boundary=001a11337ed4d4bb7304edd4e7f0 Cc: "python-list \(General\)" , Jean Dubois 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: 92 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1387398588 news.xs4all.nl 2858 [2001:888:2000:d::a6]:45416 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:62340 --001a11337ed4d4bb7304edd4e7f0 Content-Type: text/plain; charset=UTF-8 On Wed, Dec 18, 2013 at 3:28 PM, Jerry Hill wrote: > On Wed, Dec 18, 2013 at 3:17 PM, Jean Dubois > wrote: > > I have a python-program which I want to perform its task first, then > > switch to > > the python console to experiment with further commands, using what was > > already > > defined in the python-program. > > I want this as an alternative for what I do now (but which is not very > > efficient): > > I start the python-console and then manually copy-paste line per line > from > > the program in the console, then try out possible continuation commands, > > if however something goes wrong I have to redo the whole process. > > On the command line, python itself can take command line options, > including one that does exactly what you're looking for. > > python -i script.py > > That command will run script.py to its end, then drop you into the > interactive interpreter with the environment intact from running the > script. > > -- > Jerry > -- > https://mail.python.org/mailman/listinfo/python-list > Wow, Jerry, I didn't know that one. Cool -- Joel Goldstick http://joelgoldstick.com --001a11337ed4d4bb7304edd4e7f0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable



On Wed, Dec 18, 2013 at 3:28 PM, Jerry Hill <<= a href=3D"mailto:malaclypse2@gmail.com" target=3D"_blank">malaclypse2@gmail= .com> wrote:
On Wed, Dec 18, 2013 at 3:= 17 PM, Jean Dubois <jeanduboi= s314@gmail.com> wrote:
> I have a python-program which I want to perfor= m its task first, then
> switch to
> the python console to experiment with further commands, using what was=
> already
> defined in the python-program.
> I want this as an alternative for what I do now (but which is not very=
> efficient):
> I start the python-console and then manually copy-paste line per line = from
> the program in the console, then try out possible continuation command= s,
> if however something goes wrong I have to redo the whole process.

On the command line, python itself can take command line options,
including one that does exactly what you're looking for.

python -i script.py

That command will run script.py to its end, then drop you into the
interactive interpreter with the environment intact from running the
script.

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

Wow, = Jerry, I didn't know that one.=C2=A0 Cool

--
--001a11337ed4d4bb7304edd4e7f0--