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?

Community
  • 1
  • 1
anon01
  • 10,618
  • 8
  • 35
  • 58
  • 1
    Sounds like your setup is broken to me. Look at this to see what it's doing http://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. http://stackoverflow.com/questions/582336/how-can-you-profile-a-python-script – demented hedgehog Aug 24 '15 at 04: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 – anon01 Aug 24 '15 at 04:19

2 Answers2

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/

demented hedgehog
  • 7,007
  • 4
  • 42
  • 49
  • 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! – anon01 Aug 27 '15 at 02:58
  • Excellent. Take a look here for editor config http://ipython.org/ipython-doc/1/config/editors.html for some thoughts on editor/ipython interaction. – demented hedgehog Aug 27 '15 at 03:21
1

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

jfs
  • 399,953
  • 195
  • 994
  • 1,670