How to start python interactively from python script?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • draghuram@gmail.com

    How to start python interactively from python script?

    Hi,

    I would like to have a python script which does some computations at
    the beginning and then changes to interactive mode (by displaying the
    prompt). How can I do this?

    Thanks in advance,
    Raghu.

  • Mage

    #2
    Re: How to start python interactively from python script?

    draghuram@gmail .com wrote:
    [color=blue]
    >Hi,
    >
    >I would like to have a python script which does some computations at
    >the beginning and then changes to interactive mode (by displaying the
    >prompt). How can I do this?
    >
    >[/color]
    popen()

    Mage

    Comment

    • Thomas Heller

      #3
      Re: How to start python interactively from python script?

      "draghuram@gmai l.com" <draghuram@gmai l.com> writes:
      [color=blue]
      > Hi,
      >
      > I would like to have a python script which does some computations at
      > the beginning and then changes to interactive mode (by displaying the
      > prompt). How can I do this?[/color]


      You call 'os.setenv["PYTHONINSP ECT"] = "1"' at the somewher in your
      script.

      Thomas

      Comment

      • draghuram@gmail.com

        #4
        Re: How to start python interactively from python script?

        Thank you. 'os.environ["PYTHONINSP ECT"] = "1"' does the job.

        Raghu.

        Comment

        • Michele Simionato

          #5
          Re: How to start python interactively from python script?

          $ python -i myscript.py

          Michele Simionato

          Comment

          Working...