How can I use the external python console

440 views
Skip to first unread message

Christoph Bülter

unread,
Jul 27, 2015, 10:28:49 AM7/27/15
to spyder
Hi,

I would like to use spyder's external console within some external application (namely 3ds Max 2015). It has a builtin python interpreter, but lacks an interactive shell which makes development quite a pain so far.

The spyder documentation says its console is made to be used in other programs, however I have not yet found the proper way to do it. I was able to launch a single python shell using the testcode at the bottom of spyderlib/widgets/externalshell/baseshell.py, but I would like to have the wrapper widget that can contain multiple of those.

I found some related code in spyderlib/plugins/externalconsole.py but it seems to be coupled to having a spyder main application window.

Could someone give me a short primer on how to use the external console? Any help is much appreciated.

Cheers,
Christoph

David Verelst

unread,
Jul 28, 2015, 3:54:24 AM7/28/15
to spyder
Hi Christoph,

Have you tried to explicitly change the location of the external console as follows:
Tools > Preferences > Console > Python executable, and locate to your 3ds Max 2015 Python binary

All new external consoles you create will now relate to the one you specified. I think a possible drawback is that now you will only have tab completion etc in the console, but not in the editor. The editor runs in the python environment that is used to execute Python, and that one seems to be disconnected from your 3ds Max Python environment. But maybe Carlos or another dev can confirm this.

An alternative approach could be to try to install spyder within the 3ds Max 2015 Python environment...Not exactly sure what the best way of doing that would be though.

Regards,
David

--
You received this message because you are subscribed to the Google Groups "spyder" group.
To unsubscribe from this group and stop receiving emails from it, send an email to spyderlib+...@googlegroups.com.
To post to this group, send email to spyd...@googlegroups.com.
Visit this group at http://groups.google.com/group/spyderlib.
For more options, visit https://groups.google.com/d/optout.

David Verelst

unread,
Jul 28, 2015, 3:55:24 AM7/28/15
to spyder
to be more precise, it is under:
Tools > Preferences > Console > Advanced settings > Python executable, and locate to your 3ds Max 2015 Python binary

Christoph Bülter

unread,
Jul 29, 2015, 3:01:40 PM7/29/15
to spyder, david....@gmail.com
Hey David,

thanks for the suggestion, I haven't even though about launching the whole spyder IDE with the 3ds Max Python, that would of course be even cooler. I will give that a try, a local installation and any hacks would be okay, since I would only like to use it for local development.

What I tried so far was to use the example code from the bottom of baseshell.py and extend it to be able to create a single python console inside 3ds Max, which so far seems to work. As far as I could see in the other code, the wrapper widget that can contain multiple consoles as tabs will need the rest of the IDE to be up and running.

I will try to to use the whole thing and if that fails, write my own simple wrapper widget around it.

Thanks,
Christoph
Reply all
Reply to author
Forward
0 new messages