3

Is there a command line switch to carry out the script specified without terminating the process at the end?

Windows' cmd.exe for example has the /K switch.

3 Answers 3

6

As stated on python's manual:

-i switch

When a script is passed as first argument or the -c option is used, enter interactive mode after executing the script.

Sign up to request clarification or add additional context in comments.

Comments

1

One option is to add code in your script to drop into an interactive prompt. See this answer.

import code
code.interact(local=locals())

Comments

-2

No, it doesn't have such an options. See the Python commandline options documentation.

Depending on what you want to do, you can use a shortcut, or write a wrapper module and call the script you want to run through it with the -m option.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.