Geany 和 Python 3. 将文本发送到终端会自动添加缩进。为什么?
我正在使用 Geany (Manjaro XFCE) 运行 python 3.19(在 ipython 8.1 中),当我将以下文本发送到终端(使用键盘快捷键)时:
def myequation(x, B, a):
y=np.exp(-B*x)
return y
我遇到了经典的“意外缩进”。这不是空格/制表符等问题。使用复制/粘贴效果很好;使用 %paste 效果很好。问题是,当将文本发送到终端时,Geany 会自动添加我不想要的缩进,因此我的代码最终会被发送为:
def myequation(x, B, a):
y=np.exp(-B*x)
return y
因此,为了正确发送,我应该写:
def myequation(x, B, a):
y=np.exp(-B*x)
return y
或者
def myequation(x, B, a):
y=np.exp(-B*x)
return y
看起来很奇怪。我之前一直使用 geany 和 python(2 和 3),但从未遇到过这个问题。知道如何在向终端发送文本时停止这种自动缩进吗?
谢谢!
I'm running python 3.19 (in ipython 8.1) with Geany (Manjaro XFCE), and when I send the following text to terminal (with keyboard shortcut):
def myequation(x, B, a):
y=np.exp(-B*x)
return y
I have the classical "unexpected indent". It is not a problem of spaces/tabs, etc. Using copy/paste works fine; using %paste works fine. The problem is that when sending the text to terminal Geany automatically adds indents that I don't want, so my code ends up being sent like:
def myequation(x, B, a):
y=np.exp(-B*x)
return y
Thus, to be sent properly I should write:
def myequation(x, B, a):
y=np.exp(-B*x)
return y
or
def myequation(x, B, a):
y=np.exp(-B*x)
return y
which looks very strange. I've been using geany and python (2 and 3) before, and never had this issue. Any idea how to stop this automatic indentation when sending text to terminal?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好的,找到解决方法了。以防万一有人遇到同样的问题,这里是答案:
这是我找到答案的几个链接:
https://github.com/kassio/neoterm/issues/71 ;
https://github.com/kassio/neoterm/pull/90
Ok, found how to solve it. Just in case anyone has the same problem, here the answer:
Here a couple of links where I found the answer:
https://github.com/kassio/neoterm/issues/71 ;
https://github.com/kassio/neoterm/pull/90