我安装了ipython但它没有readline选项.我首先下载了gnu readline并编译并安装.DId不知道这是否是一个合适的解决方案,但这是我想到的第一件事.它仍然无法使用与以前相同的错误:
WARNING: Readline services not available on this platform. WARNING: The auto-indent feature requires the readline library
然后我尝试使用pip install readline,我得到以下错误.任何帮助,将不胜感激:
running install running build running build_ext building 'readline' extension creating build creating build/temp.linux-x86_64-2.6 creating build/temp.linux-x86_64-2.6/Modules creating build/temp.linux-x86_64-2.6/Modules/2.x gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DHAVE_RL_CALLBACK -DHAVE_RL_CATCH_SIGNAL -DHAVE_RL_COMPLETION_APPEND_CHARACTER -DHAVE_RL_COMPLETION_DISPLAY_MATCHES_HOOK -DHAVE_RL_COMPLETION_MATCHES -DHAVE_RL_COMPLETION_SUPPRESS_APPEND -DHAVE_RL_PRE_INPUT_HOOK -I. -I/home/jspender/include/python2.6 -c Modules/2.x/readline.c -o build/temp.linux-x86_64-2.6/Modules/2.x/readline.o -Wno-strict-prototypes creating build/lib.linux-x86_64-2.6 gcc -pthread -shared build/temp.linux-x86_64-2.6/Modules/2.x/readline.o readline/libreadline.a readline/libhistory.a -L/home/jspender/lib -lncurses -lpython2.6 -o build/lib.linux-x86_64-2.6/readline.so /usr/bin/ld: cannot find …
我正在尝试创建一个图,但我只想让ticklabels显示如上所示的对数比例.我只希望显示50,500和2000的次要标签.无论如何指定要显示的次要刻度标签?我一直试图解决这个问题,但没有找到一个好的解决方案.我能想到的就是获取minorticklabels()并将fontsize设置为0.这显示在第一段代码下面.我希望有一个更清洁的解决方案.
另一件事是改变颜色栏中的勾选标签的大小,我还没想到.如果有人知道这样做的方法,请告诉我,因为我没有看到颜色栏中的方法很容易做到这一点.
第一个代码:
fig = figure(figto)
ax = fig.add_subplot(111)
actShape = activationTrace.shape
semitones = arange(actShape[1])
freqArray = arange(actShape[0])
X,Y = meshgrid(self.testFreqArray,self.testFreqArray)
Z = sum(activationTrace[:,:,beg:end],axis=2)
surf = ax.contourf(X,Y,Z, 8, cmap=cm.jet)
ax.set_position([0.12,0.15,.8,.8])
ax.set_ylabel('Log Frequency (Hz)')
ax.set_xlabel('Log Frequency (Hz)')
ax.set_xscale('log')
ax.set_yscale('log')
ax.xaxis.set_minor_formatter(FormatStrFormatter('%d'))
ax.yaxis.set_ticks_position('left')
ax.xaxis.set_ticks_position('bottom')
ax.tick_params(axis='both',reset=False,which='both',length=8,width=2)
self.plotSetAxisLabels(ax,22)
self.plotSetAxisTickLabels(ax,18)
cbar = fig.colorbar(surf, shrink=0.5, aspect=20, fraction=.12,pad=.02)
cbar.set_label('Activation',size=18)
return ax, cbar
Run Code Online (Sandbox Code Playgroud)

第二代码:
fig = figure(figto)
ax = fig.add_subplot(111)
actShape = activationTrace.shape
semitones = arange(actShape[1])
freqArray = arange(actShape[0])
X,Y = meshgrid(self.testFreqArray,self.testFreqArray)
Z = sum(activationTrace[:,:,beg:end],axis=2)
surf = ax.contourf(X,Y,Z, 8, …Run Code Online (Sandbox Code Playgroud) 我正在写我的PROMPT_COMMAND="history -a;$PROMPT_COMMAND"但我仍然从不同的终端会话中获得一些重复.似乎我仍然会得到一些重复,但我使用命令得到的更少PROMPT_COMMAND="history -w;$PROMPT_COMMAND".
我知道我可以做到,history -a;history -c; history -r但我不希望他们全部同步.我只想在调用历史记录时发生这种情况-n.我基本上是使用历史记录-a或历史-w但我似乎无法找到两者之间的区别.哪一个最好避免尽可能多的重复.
我一直被这样一个事实所困扰:当退出时使用revive.el和windows.el启用它会打开一个文件并写入它,名为.revive和.windows.这些都保存在最近的文件列表中.反正是为了让它忽略这些文件或我想要的任何其他文件.
我有几个emacs配置文件.我打算将它们合并到一个公共文件中,然后将其他几个文件导入公共文件.然后有自己的功能.我只是将它们全部作为.emacsCommon放在我的主文件夹中但是当我写的时候:
(require '.emacsCommon)
Run Code Online (Sandbox Code Playgroud)
它不加载该功能.这样做的正确方法是什么?
干杯
我试图使用scipy.io.loadmat从.mat文件中加载一个基本字典temp = {'key':array([1,2])}.将loadmat()返回的Python字典文件中的键转换为变量名称,其值与表示键相同.
例如:
temp = {'key':array([1,2])}
Run Code Online (Sandbox Code Playgroud)
转换成
key = array([1,2])
Run Code Online (Sandbox Code Playgroud)
我知道如何使用temp.keys()获取密钥.然后抓取项目很简单,但是如何强制temp.keys()中的字符串列表是变量名而不是字符串.
我希望这是有道理的,但这可能很容易,我只是想不出怎么做.
干杯
我在Python中编写的代码不会以应有的方式释放内存.内存由Python占用,但即使在不再使用后也永远不会被释放.即使你用ctrl + c打破正在运行的程序.删除变量并运行它似乎不收集的gc.collect().或者与Ipython中相同并运行%reset.内存不会被释放并且运行gc.collect()无效.我在Windows中对此进行了测试,因为我想看看它是否可能与垃圾收集器库有关.看来情况就是这样.在Linux中运行下面的代码,然后在Windows中运行.然后比较内存使用情况.你需要安装numpy和scipy.任何有关此问题的帮助或见解将不胜感激.
导入模型,创建实例,然后运行createSpecific().
这是在Ubuntu 10.04中展示此行为的代码:
from numpy import array, maximum,intersect1d, meshgrid, std, log, log10, zeros, ones, argwhere, abs, arange, size, copy, sqrt, sin, cos, pi, vstack, hstack, zeros, exp, max, mean, savetxt, loadtxt, minimum, linspace, where
from numpy.fft import fft
from scipy.stats import f_oneway, kruskal, sem, scoreatpercentile
#import matplotlib
#matplotlib.use('cairo.pdf')
from matplotlib.pyplot import plot, clf, show, cla, xlim, xscale, imshow, ylabel, xlabel, figure, savefig, close, bar, title, xticks, yticks, axes, axis
from matplotlib.axes import Axes
from mpl_toolkits.mplot3d import Axes3D …Run Code Online (Sandbox Code Playgroud) 我一直试图摆脱这个键绑定,但把它设置为nil或'撤消哪个没关系,没有运气.我不知道为什么它首先被设置为Cx Cz.我甚至不介意永久删除suspend-frame命令,如果这将提供解决方案.
这是我的.emacs文件,如果它有帮助:
;;Style files and multi-file documents
(setq TeX-auto-save t)
(setq TeX-parse-self t)
(setq-default TeX-master nil)
(setq inhibit-splash-screen t)
;; Use PDF mode by default
(setq-default TeX-PDF-mode t)
(setq TeX-save-query nil)
(global-auto-revert-mode t)
(global-set-key "\C-x C-z" nil)
(global-set-key "\C-z" nil)
;;Abbreviation mode and settings
(add-hook 'text-mode-hook (lambda () (abbrev-mode 1)))
(setq save-abbrevs t)
(quietly-read-abbrev-file)
;;Reftex and then turn on for Auctex
(require 'reftex)
(add-hook 'LaTeX-mode-hook 'turn-on-reftex)
;;Enable preview latex
(load "preview-latex.el" nil t t)
;; For line numbers loading …Run Code Online (Sandbox Code Playgroud) 原始回复:我试图弄清楚如何在auctex模式乳胶中突出显示任何打开flyspell的乳胶功能.这是一个自定义词典文件还是如何实现的?这可以很容易地合并到组织模式文件中,因此它不会突出显示将导出的插入的乳胶代码.
编辑:从文件顶部和文本中获取的简单示例.基本上,如{}中的ref或label之类的乳胶语法将不会被拼写检查(这已通过使用(setq ispell-parser tex)修复.然后还设置一个函数,使用#+作为第一个文本的特定标签我不希望检查标题.我希望检查标题,但不是#+ LABEL:或#+ TYP_TODO :(未显示.另外一种方法是添加TODO关键字以便不进行检查.我可以想到一种方法来做到这一点是在启动时将这些添加到LOCALWORDS:ispell放置在文件的底部,如果还没有,但是有更简单或更好的方法来执行此操作.
#+TAGS: NOTE REPORT export noexport MEETING
#+TYP_TODO: TODO Weekly WAITING NEXT | Meeting DONE
#+STARTUP: hidestars content hideblocks
The exponential running mean is shown for various alpha values in Figure \ref{fig:saturation_varying_alphaval_00f6set2}.
#+CAPTION: Plot of varying alpha values for the exponential running mean ($EM$) with $S_{min} = 0.0008 \text{ and } P_m = 0.20$
#+LABEL: fig:saturation_varying_alphaval_00f6set2
#+ATTR_LaTeX: width=0.4\textwidth placement=[h!tb]
Run Code Online (Sandbox Code Playgroud) 我最近切换到emacs24并升级到Ubuntu 12.04.我似乎无法让hunspell再次正常工作.我发现hunspell一般比aspell好.Hunspell只想使用澳大利亚词典而不是英语美国词典或冻结我的系统.使用aspell,我可以切换字典或运行flyspell模式.
我的问题是人们如何在emacs24中设置交互式拼写?仍然使用ispell和flyspell或任何其他设置首选.你在使用emacs24使用hunspell吗?我可能会继续努力让这个工作,但想确认其他人没有任何问题.