Quantcast
Channel: Active questions tagged code-completion - Stack Overflow
Viewing all articles
Browse latest Browse all 74

Scripting a python process using an interactive interpreter

$
0
0

How could I use the Interactive Interpreter to script another python process?

For example, I would like to use pyspread as a spreadsheet to visualize data, but import custom functions and variables to it and edit cells in it from within PyCharm, because PyCharm provides code completion features which make writing code much easier.

The GUI of the application and the interactive console do not have to respond simultaneously, but I would like to be able to transition easily between them.

I have considered importing the code module to the process and including a read queue feature in the main event loop so that code sent to the queue can be executed sequentially to HID events sent to the process.

Another method is to execfile the program from within an interactive interpreter

Both of these methods seem to work acceptably, except that they do not seem to expose the internal classes and variables of the process to the language server associated with the console, nor do they allow for easy transition between console and GUI.

Creating a new variable within a normal console allows this variable to be suggested by the completion engine, however the same does not happen within a code.interact() session. Neither names from the process or names created during the session are suggested for completion.

PEP 734 - Multiple interpreters,which is in review, seems to address this topic. Can it be accomplished currently? Thank you.


Viewing all articles
Browse latest Browse all 74

Trending Articles