Show More
@@ -226,11 +226,11 b' class Kernel(Configurable):' | |||||
226 | # Kernel request handlers |
|
226 | # Kernel request handlers | |
227 | #--------------------------------------------------------------------------- |
|
227 | #--------------------------------------------------------------------------- | |
228 |
|
228 | |||
229 | def _publish_pyin(self, code, parent): |
|
229 | def _publish_pyin(self, code, parent, execution_count): | |
230 | """Publish the code request on the pyin stream.""" |
|
230 | """Publish the code request on the pyin stream.""" | |
231 |
|
231 | |||
232 |
self.session.send(self.iopub_socket, u'pyin', {u'code':code |
|
232 | self.session.send(self.iopub_socket, u'pyin', {u'code':code, | |
233 | parent=parent) |
|
233 | u'execution_count': execution_count}, parent=parent) | |
234 |
|
234 | |||
235 | def execute_request(self, ident, parent): |
|
235 | def execute_request(self, ident, parent): | |
236 |
|
236 | |||
@@ -271,7 +271,7 b' class Kernel(Configurable):' | |||||
271 | # Re-broadcast our input for the benefit of listening clients, and |
|
271 | # Re-broadcast our input for the benefit of listening clients, and | |
272 | # start computing output |
|
272 | # start computing output | |
273 | if not silent: |
|
273 | if not silent: | |
274 | self._publish_pyin(code, parent) |
|
274 | self._publish_pyin(code, parent, shell.execution_count) | |
275 |
|
275 | |||
276 | reply_content = {} |
|
276 | reply_content = {} | |
277 | try: |
|
277 | try: |
@@ -766,7 +766,12 b' These messages are the re-broadcast of the ``execute_request``.' | |||||
766 | Message type: ``pyin``:: |
|
766 | Message type: ``pyin``:: | |
767 |
|
767 | |||
768 | content = { |
|
768 | content = { | |
769 | 'code' : str # Source code to be executed, one or more lines |
|
769 | 'code' : str, # Source code to be executed, one or more lines | |
|
770 | ||||
|
771 | # The counter for this execution is also provided so that clients can | |||
|
772 | # display it, since IPython automatically creates variables called _iN | |||
|
773 | # (for input prompt In[N]). | |||
|
774 | 'execution_count' : int | |||
770 | } |
|
775 | } | |
771 |
|
776 | |||
772 | Python outputs |
|
777 | Python outputs |
General Comments 0
You need to be logged in to leave comments.
Login now