1

I just posted a question here why python imports take as long as they do. Are there environments that don't require reinitializing modules? If so, what are they?

Details: I'm trying to learn basic python syntax while using extended libraries (matplotlib, mayavi), and each time I test my code I wait (several!!) seconds for the modules to load. There must be a faster way to do this, but I don't know what environments are well suited. Suggestions?

asked Aug 24, 2015 at 4:08
2
  • 1
    Sounds like your setup is broken to me. Look at this to see what it's doing stackoverflow.com/questions/7332299/trace-python-imports. Also maybe check the problem is with the imports using the timeit module? And for completeness there's a builtin profiler as well. stackoverflow.com/questions/582336/… Commented Aug 24, 2015 at 4:12
  • @dementedhedgehog the answer to the question I reference suggests that some modules just take a long time to load. I did a bit of profiling, and that seemed reasonable Commented Aug 24, 2015 at 4:19

2 Answers 2

1

Take a look at ipython and pandas they might be closer to what you want. Python does have a reload for modules but I'm not sure how well it works so anything that keeps a single python instance running and doesn't spawn python child processes is likely to fit the bill (sorry not sure what's available in that area).

http://ipython.org/

http://pandas.pydata.org/

answered Aug 24, 2015 at 4:31
Sign up to request clarification or add additional context in comments.

2 Comments

Ipython seems pretty good! I like using both an editor and interactive session in tandem (debug, record respectively), but I think once I figure out a new workflow this will be fast for development. Thanks!
Excellent. Take a look here for editor config ipython.org/ipython-doc/1/config/editors.html for some thoughts on editor/ipython interaction.
1

Any environment with client/server architecture (short-lived cli/gui/web-clients, long-lived computational kernels) such as https://jupyter.org/ will do.

answered Aug 24, 2015 at 14:45

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.