Ame*_*ina 19 python ide matlab
在最近的MATLAB版本中,可以在%%使用之前从两行之间执行代码区域Ctrl-Enter.这样的区域称为代码单元,它允许快速的代码测试和调试.
例如
%% This is the beginning of the 1st cell
a = 5;
%% This is the end of the 1st cell and beginning of the 2nd cell
% This is just a comment
b = 6;
%% This is the end of the 2nd cell
Run Code Online (Sandbox Code Playgroud)
有没有支持类似功能的python编辑器?
编辑:我刚刚发现Spyderlib支持用F9支持"阻塞"执行(用空行分隔的代码区域),但是正如这个帖子所提到的,这个特性仍然不是很强大(特别是与循环结合).
Python IEP的交互式编辑器有一个Matlab样式的单元格符号来标记代码段(通过以'##'开头),默认情况下快捷键也是Ctrl+ Enter:
## Cell one
"""
A cell is everything between two commands starting with '##'
"""
a = 3
b = 4
print('The answer is ' + str(a+b))
## Cell two
print('Hello World')
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
6137 次 |
| 最近记录: |