Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Script to debug problems with namespace packages. | |
Set the PACKAGE variable below and run this script with the same Python you're having problems with. | |
""" | |
from __future__ import print_function | |
# Set this to the name of the namespace package you're having problems with | |
PACKAGE = "backports" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
======= Memory map: ======== | |
00400000-007a8000 r-xp 00000000 08:02 1179705 /usr/bin/python3.5 | |
009a8000-009aa000 r--p 003a8000 08:02 1179705 /usr/bin/python3.5 | |
009aa000-00a41000 rw-p 003aa000 08:02 1179705 /usr/bin/python3.5 | |
00a41000-00a72000 rw-p 00000000 00:00 0 | |
00d0f000-01339000 rw-p 00000000 00:00 0 [heap] | |
7f3818000000-7f3818021000 rw-p 00000000 00:00 0 | |
7f3818021000-7f381c000000 ---p 00000000 00:00 0 | |
7f3820000000-7f3820021000 rw-p 00000000 00:00 0 | |
7f3820021000-7f3824000000 ---p 00000000 00:00 0 |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# encoding: utf-8 | |
from IPython.terminal.prompts import Prompts, Token | |
import os | |
class MyPrompts(Prompts): | |
def in_prompt_tokens(self, cli=None): | |
return [ | |
(Token, ' '), | |
(Token.PromptNum, str(self.shell.execution_count)), | |
(Token.Prompt, u'│ '), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Create a notebook containing code from a script. | |
Run as: python make_nb.py my_script.py | |
""" | |
import sys | |
import nbformat | |
from nbformat.v4 import new_notebook, new_code_cell | |
nb = new_notebook() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy | |
def f(): | |
a = numpy.random.random(1e8) | |
raise Exception |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ python3 interrupt-debug.py | |
0 | |
1 | |
2 | |
3 | |
^C--Return-- | |
> /home/takluyver/scratch/interrupt-debug.py(6)handle_sigint()->None | |
-> pdb.set_trace() | |
(Pdb) p a | |
4 |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.