ipython

QtConse in Spyder cannot use multiprocessing.Manager

久未见 提交于 2019-12-12 06:50:10
问题 If I open IPython QtConsole standalone and run the following: from multiprocessing import Manager manager = Manager() It worked fine. However, if I use the IPython Console inside Spyder, that specific console stopped responding. I am using Windows 64 bit, Python 3.3.5 64 bit, Spyder 2.3.1. Could anyone please help me with this? 来源: https://stackoverflow.com/questions/26428296/qtconse-in-spyder-cannot-use-multiprocessing-manager

Cannot display inline chart in IPython notebook

早过忘川 提交于 2019-12-12 06:07:04
问题 I've seen the exact same question around but the answers didn't help me. like those questions: Cannot show the graphs on ipython notebook How to make IPython notebook matplotlib plot inline So I decided to post a question so i could post my code, see if there is anything different... hopefully it's something very dull that I'm missing. although the code runs perfectly in ipython shell. Thanks in advance ! %matplotlib inline import matplotlib import numpy as np import matplotlib.pyplot as plt

Replace / remove highlighting in Jupyter Notebook with custom theme

不想你离开。 提交于 2019-12-12 05:39:31
问题 It's clear that the selection is for readability, but it seems too glaring to me. A set of themes for Jupyter How can I edit the configuration and change the transparency or the color of the selected area (blue) or invert the selection to the bracket, or completely remove it? In css syntax I do not understand at all. 回答1: The CSS selector for matching brackets is div.CodeMirror span.CodeMirror-matchingbracket So, you can change the colour of the bracket itself and the background colour of the

Error executing Python script AttributeError: 'NoneType' object has no attribute 'run_line_magic'

一笑奈何 提交于 2019-12-12 05:38:34
问题 I am getting error on the following python code. I'm running from a script. Im using python 2.7.12. import os import numpy as np import pandas as pd import matplotlib.pyplot as plt from IPython import get_ipython ipython_shell = get_ipython() get_ipython().run_line_magic('matplotlib', 'inline') I have tried using both py and jpy extensions. Tried to change the syntax for importing matplotlib but nothing works. The error from running with python shows Traceback (most recent call last): File

How to set default path automatically in IPython

女生的网名这么多〃 提交于 2019-12-12 04:38:18
问题 I'm using WingIDE for development and Ipython for running my scripts. I'm facing some inconvenience on several points: Whenever I update my code, I have to reload my module in order to update it in IPython. To solve that I followed Jomonsugi's answer in the following link: How to automatically reload modules in IPython? and it works. Each time I launch IPython, my path is set to my exe's location and I have to cd to my script's directory. I tried to change directory automatically when

ipython redirect stdout display corruption

大兔子大兔子 提交于 2019-12-12 04:36:10
问题 I'm developing a system in python, and one functionality I need is the ability to have console output go to both the console and a user-specified file. This is replicating the Diary function in MATLAB. I have the following that works perfectly well on both IDLE on windows and python cmdline in ubuntu (this all exists inside a module that gets loaded): class diaryout(object): def __init__(self): self.terminal = sys.stdout self.save = None def __del__(self): try: self.save.flush() self.save

Scroll windows for code in iPython (Jupyter) Notebooks?

早过忘川 提交于 2019-12-12 04:06:05
问题 Is there a way to display large blocks of code in an iPython notebook in a scroll window? I have a notebook where the focus is on graphical output of the code and comments in the markdown text. I want to be able to execute the code in the notebook and have it available to the reader, but many of the code blocks are very lengthy. A scroll window would make a notebook much cleaner and more concise, allowing readers the option of moving past large code blocks. 回答1: The best way so far is to use

Error importing seaborn in ipython notebook - working in ipython

醉酒当歌 提交于 2019-12-12 04:05:26
问题 I have a somewhat similear problem as this guy: when I want to import seaborn in my ipython notebook I get an import error. When I try to import seaborn in ipython console it works! What is the problem? ImportError Traceback (most recent call last) <ipython-input-6-085c0287ecb5> in <module>() ----> 1 import seaborn /usr/lib/python3.4/site-packages/seaborn/__init__.py in <module>() ----> 1 from .rcmod import * 2 from .utils import * 3 from .palettes import * 4 from .linearmodels import * 5

IPython - Raise exception when a shell command fails

孤者浪人 提交于 2019-12-12 03:56:17
问题 I'm using IPython as a system shell. Is there a way to make IPython to raise an exception when the shell command fails? (non-zero exit codes) The default makes them fail silently. 回答1: As of IPython 4.0.1, !cmd is transformed into get_ipython().system(repr(cmd)) ( IPython.core.inputtransformer._tr_system() ). In the source, it's actually InteractiveShell.system_raw() , as inspect.getsourcefile() and inspect.getsource() can tell. It delegates to os.system() in Windows and subprocess.call() in

IPython interactive shell output formatting configuration

安稳与你 提交于 2019-12-12 03:45:27
问题 If there's a quick fix for this, apologies in advance. In the IPython shell, if I have this: In [1]: x = [i for i in range(100)] then I get a list printed with each element on a new line if I call it: In [2]: x Out[2]: [0 1, 2, and so on down to 100. Irritating as hell because often I'm calling objects and don't know how long they'll be (and don't want to check beforehand, and don't want my last commands to get pushed up and out of the way). How can I get it to print that result the way it