##// END OF EJS Templates
Merge pull request #13214 from Kojoley/ipexec-pycharm-qol-fix...
Merge pull request #13214 from Kojoley/ipexec-pycharm-qol-fix ipexec: prevent output coloring under PyCharm

File last commit:

r20278:8f4dcac7
r26941:32ffaeff merge
Show More
Test Output Callbacks.ipynb
291 lines | 4.6 KiB | text/plain | TextLexer
/ tools / tests / Test Output Callbacks.ipynb
MinRK
add output callbacks test notebook...
r13209 {
Min RK
add kernel metadata to example notebooks
r20278 "cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Basic Output"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"from IPython.display import display"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"print('hi')"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"display('hi')"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"1"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"%matplotlib inline\n",
"import matplotlib.pyplot as plt\n",
"plt.plot([1,3,2])"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"%%javascript\n",
"console.log(\"I ran!\");"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"%%html\n",
"<b>bold</b>"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"%%latex\n",
"$$\n",
"a = 5\n",
"$$"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# input_request"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"raw_input(\"prompt > \")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# set_next_input"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"%%writefile tst.py\n",
"def foo():\n",
" pass\n"
]
},
MinRK
add output callbacks test notebook...
r13209 {
Min RK
add kernel metadata to example notebooks
r20278 "cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"%load tst.py"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Pager in execute_reply"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"plt?"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# object_info"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"# press shift-tab after parentheses\n",
"int("
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# complete"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"# press tab after f\n",
"f"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# clear_output"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"import sys, time\n",
"from IPython.display import clear_output"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"for i in range(10):\n",
" clear_output()\n",
" time.sleep(0.25)\n",
" print(i)\n",
" sys.stdout.flush()\n",
" time.sleep(0.25)\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"for i in range(10):\n",
" clear_output(wait=True)\n",
" time.sleep(0.25)\n",
" print(i)\n",
" sys.stdout.flush()\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": []
MinRK
add output callbacks test notebook...
r13209 }
Min RK
add kernel metadata to example notebooks
r20278 ],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.4.2"
}
},
"nbformat": 4,
"nbformat_minor": 0
}