qtconsole

Setting default configuration for Jupyter QtConsole

末鹿安然 提交于 2021-01-28 19:48:39
问题 I have Jupyter QtConsole installed in Ubuntu 16.04. How can I set default configuration like font family, size and initial imports? 回答1: The docs on configuration options for jupyter will be very helpful here. In short, open ~/.jupyter/jupyter_qtconsole_config.py in your favorite text editor and find your options of interest. Font family : c.ConsoleWidget.font_family Font size : c.ConsoleWidget.font_size Startup scripts and initial imports will be a little more complicated since those are

Logging module does not print in IPython

孤人 提交于 2020-05-25 19:59:14
问题 The following code does print 'I want this to print' in 'ipython qtconsole', however it does not print in plain IPython. import logging import logging.handlers log = logging.getLogger() f = logging.Formatter("%(asctime)s - %(module)s. %(funcName)s - %(levelname)s - %(message)s") fh = logging.handlers.TimedRotatingFileHandler('log.txt', 'W6') fh.setFormatter(f) log.addHandler(fh) log.setLevel(logging.INFO) log.info('I want this to print') In 'IPython qtconsole' however i get different problems

printing bold, colored, etc., text in ipython qtconsole

倖福魔咒の 提交于 2020-03-17 04:30:12
问题 I'm trying to get text to display as bold, or in colors, or possibly in italics, in ipython's qtconsole. I found this link: How do I print bold text in Python?, and used the first and second answers, but in qtconsole, only the underlining option works. I try: print '\033[1m' + 'Hello World!' + '\033[0m' And get: Hello World! (No boldface). The colors don't work either. But: print '\033[4m' + 'Hello World!' + '\033[0m' And get: Hello World! With underlining. This is only in the qtconsole.

iPython/jupyter qtconsole fails to start in anaconda 2.4.0

不羁的心 提交于 2020-01-07 04:44:26
问题 After upgrading Anaconda3 (32-bit) from version 2.3.0 to 2.4.0 (by reinstalling Anaconda) on my Windows 7 64-bit machine, the iPython/jupyter qtconsole fails to start: when executing jupyter-qtconsole.exe or jupyter-qtconsole-script.py , the following error appears: Traceback (most recent call last): File "C:\Anaconda3\Scripts\jupyter-qtconsole-script.py", line 1, in <module> from qtconsole.qtconsoleapp import main File "C:\Anaconda3\lib\site-packages\qtconsole\qtconsoleapp.py", line 45, in

How do I start ipython's qtconsole cleanly on Win7

心不动则不痛 提交于 2020-01-02 06:15:40
问题 I have python 3.4 and ipython 2.3.1 installed on Windows 7. I installed ipython using pip from a wheel from http://www.lfd.uci.edu/~gohlke/pythonlibs/ (Thanks, Chris!). This install procedure does not create any start menu shortcuts, even when run as administrator. I can successfully run "ipython qtconsole" from a cmd window, but then I have to have that command window open and the process doesn't fork--it's just and extra window hosting the child process. If I create a shortcut to do the

Clear memory allocated by plotting in IPython

我的梦境 提交于 2020-01-02 05:42:05
问题 I'm plotting some large plots in IPython QtConsole (and Notebook). These take up a lot of memory, but once they are plotted I don't need them any more and they can go. How can I free up memory? None of the following works: close() clf() cla() %reset The only thing that frees the memory is restarting the kernel , which I don't always want to do (say I worked through a long process to get to a specific point) [To be precise, %reset does free up some memory, but not as much as restarting the

How to make qtconsole to work under Qthread?

眉间皱痕 提交于 2019-12-24 19:27:34
问题 A minimum working example of the problem is below. It works fine but, if I run some heavy task on the jupyter shell, it hangs the GUI until the job is done. You may experienced this on the scrollbar which will hang if you execute something like: In [1]: n = 50000000 ...: while n > 0: ...: n -=1 ...: x = n**4 Unfortunately this is happening also to the master GUI frame (on which the qtconsole is embedded to). The question is, how to set a separate Qthread that execute the qtconsole in the

How do I change the highlight color style of the code in the IPython(Jupyter)?

丶灬走出姿态 提交于 2019-12-12 01:51:34
问题 My question is showed in the following picutre. I want to change the highlight color style of the code region that is specified by the red rectangle in the picutre below. But I dont' know which token I should change style of. My pygment style setting code is below from pygments.style import Style from pygments.token import Keyword, Name, Comment, String, Error, \ Number, Operator, Generic, Whitespace, Token class EmacsStyle(Style): """ The default style (inspired by Emacs 22). """ background

Control ipython history length

馋奶兔 提交于 2019-12-10 17:25:47
问题 The title pretty much says what I want. I want to have more than 1000 lines of input in my ipython-history; which means that pressing arrow-up commands older are showing up. Is this possible? (probably somewhere in ipython-config()?) Thanks 回答1: In http://2sn.org/python/ipython_config.py there is a # c.TerminalInteractiveShell.history_length = 10000 Does it work? 来源: https://stackoverflow.com/questions/26061049/control-ipython-history-length

How can I spawn an IPython qtconsole within my app while passing existing objects to that console

杀马特。学长 韩版系。学妹 提交于 2019-12-10 09:34:39
问题 I am trying to embed an IPython qtconsole in my application, in a similar way that I can embed an IPython text console, thus: from IPython.frontend.terminal.embed import InteractiveShellEmbed myobj={'jason':10} shell = InteractiveShellEmbed() shell.user_ns = myobj shell() I can start a QT console in my application by using from IPython.frontend.qt.console.qtconsoleapp import IPythonQtConsoleApp app = IPythonQtConsoleApp() app.initialize() app.start() But this has no access to existing objects