admin管理员组文章数量:1356924
This is my simple python code that i used to simply paste using right-click or ctrl+v in windows 10.
In windows 11, the cmd or terminal wants to help me but is ruining my code and wasting my time. what is the reason behind this auto-indent? do developers really want us to work more for launching a multiline python code so we take python seriously?
number = 24
divisors = [2, 3, 4, 5, 6]
for d in divisors:
if number % d == 0:
print(f"{number} is a multiple of {d}")
else:
print(f"{number} is not a multiple of {d}")
but after pasting: (this auto-indent is not helping) it actually creates some errors and wastes my time. for example sometimes if my code has 1000 lines i have to stay awake for a night to type the code line by line.
This is my simple python code that i used to simply paste using right-click or ctrl+v in windows 10.
In windows 11, the cmd or terminal wants to help me but is ruining my code and wasting my time. what is the reason behind this auto-indent? do developers really want us to work more for launching a multiline python code so we take python seriously?
number = 24
divisors = [2, 3, 4, 5, 6]
for d in divisors:
if number % d == 0:
print(f"{number} is a multiple of {d}")
else:
print(f"{number} is not a multiple of {d}")
but after pasting: (this auto-indent is not helping) it actually creates some errors and wastes my time. for example sometimes if my code has 1000 lines i have to stay awake for a night to type the code line by line.
Share Improve this question edited Mar 27 at 23:23 Santiago Squarzon 61.6k5 gold badges24 silver badges54 bronze badges asked Mar 27 at 23:16 Amin KavianiAmin Kaviani 254 bronze badges 3- 1 "so we take Python seriously?" Maybe you just need a better terminal or a different OS? Windows 11 auto-indents by default. Try Shift + Ctrl + V to paste as plain text or use a real editor to not waste time. – Paolo Commented Mar 27 at 23:22
- 2 Your issue seem to be most likely caused by Windows Terminal and unrelated to PowerShell itself. Your issue is also unrelated to programming in which case your question doesn't belong to this site. – Santiago Squarzon Commented Mar 27 at 23:23
- 3 Why would you want to run 1000 lines of code interactively rather than editing and saving a script file and running that? – user19077881 Commented Mar 27 at 23:30
1 Answer
Reset to default 0Install an use iPython
, and add it to Windows Terminal. FYI, here is my iPython
profile (from %LOCALAPPDATA%\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState\settings.json
)
{
"commandline": "ipython.exe",
"font":
{
"face": "Courier New",
"size": 14
},
"guid": "{d816c293-704d-4ce2-aec9-33e46e1f900c}",
"hidden": false,
"icon": "C:\\Program Files\\Python313\\Lib\\test\\tkinterdata\\python.png",
"name": "iPython",
"startingDirectory": "D:\\BAT"
}
Result:
本文标签: windows cmd autoindent for python codes problemStack Overflow
版权声明:本文标题:windows cmd auto-indent for python codes problem - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744063802a2584614.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论