我用python3.7编写了一个相当复杂的程序。然而,我正在寻找一种方法,以减少(后来再次扩大)我已经功能的功能。这样我就不必在每次想回到顶部时滚动200行代码。你知道吗
正如我所说的,我正在用python3.7编写代码,这似乎是一种非常简单/初级的技术。然而,我试过谷歌搜索很多东西,不幸的是英语不是我的母语,我不知道什么谷歌。在谷歌上搜索“用Python减少代码”对我没用。所以我希望你们这些怪胎能帮我!:)
例如
而不是
1 # This is some random code
2 print("Hello")
3 print("beautiful")
4 print("World")
5 # This is some random code
我想要一个
1 # This is some random code
2-4 # Here all the other lines should be reduced to one line
5 # This is some random code
在IDE中使用代码折叠。建议的关于水蟒的ide可以在here找到。我推荐visualstudio代码。
相关问题 更多 >
编程相关推荐