F
F
Fluttercry2016-04-14 17:57:40
Python
Fluttercry, 2016-04-14 17:57:40

python -i command with pythonstartup?

Hello.
I sometimes have a need to run a python script and stay in interactive mode, which is easily solved with the command python -i some_script.py, but it does not execute a normal pythonstartup script. I need to do both in sequence.
Is there a not too hacky (like adding pythonstartup imports directly to the script) solution to this issue?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
Bteam, 2016-04-21
@Fluttercry

Write a main function in some_scripts.py that runs if __name__ == '__main__': main() and just run it in interactive python.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question