Is there an existing web application that allows multiple users to work with an interactive session such as IDLE at the same time?
Something like:
IDLE 2.6.4 Morgan: >>> letters = list("abcdefg") Morgan: >>> # now, how would you iterate over letters? Jack: >>> for char in letters: print "char %s" % char char a char b char c char d char e char f char g Morgan: >>> # nice nice
If not, I would like to create it. Is there some kind of module that I can use that mimics an interactive session? I need an interface like this:
def class InteractiveSession(): ''' An interactive Python session ''' def putLine(line): ''' Evaluates line ''' pass def outputLines(): ''' A list of all lines that have been output by the session ''' pass def currentVars(): ''' A dictionary of currently defined variables and their values ''' pass
(Although this last function will be more of an additional function.)
To state my problem differently: I would like to create a new interface for IDLE. How can i do this?
UPDATE: Or maybe I can simulate IDLE via eval() ?
UPDATE 2: What if I did something like this:
I already have a GAE Python chat setup application that allows users to log in, create chats and chat with each other.
Instead of just storing incoming messages in a data warehouse, I could do something like this:
def putLine(line, user, chat_room): ''' Evaluates line for the session used by chat_room '''
InteractiveSession Model:
def class InteractiveSession(db.Model):
Can this work, or am I leaving / this approach is not feasible / am I duplicating work when I have to use something already built?
UPDATE 3 . Also, assuming everything else works, I would like to highlight the syntax. Ideally, I would have some kind of API or service that I could use to parse the code and fine-tune it accordingly.
for c in "characters":
will become:
<span class="keyword">for</span> <span class="var">c</span> <span class="keyword">in</span> <span class="string>"characters"</span><span class="punctuation">:</span>
Is there a good existing Python tool for this?
python user-interface python-idle
Nick heiner
source share