gpt4 book ai didi

intellij-idea - 如何在 Intellij idea 中为 python 保留空格

转载 作者:行者123 更新时间:2023-12-04 06:09:31 34 4
gpt4 key购买 nike

我只想在单个函数的代码段之间的空行上保留一个空格字符。原因是当剪切/粘贴到解释器中时,如果那里没有空格(表示意外缩进),它将中断。

所以我希望 intellij 不要删除那个空格字符。但是我找不到设置来防止删除额外的空格。

这里是用例:

def myfunc():
print "something"

def internal_Func_that_I_want_separated_by_newline():
print "how to have a line above this one that includes a single space?"

def anotherfunc():
print "foobar"

foobar()
internal_Func_that_I_want_separated_by_newline()

谢谢

最佳答案

你需要设置Editor | Strip trailing spaces on save to None.这是 the screenshot of the option .

关于intellij-idea - 如何在 Intellij idea 中为 python 保留空格,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16863370/

34 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com