Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio Code does not print to terminal with correct indentation

I have a new computer at work and I am setting up Visual Studio Code.

I write a simple function in the editor and send it to terminal, I get the following error:

IndentationError: unexpected indent

enter image description here

I tried to remove indentation in formula definition of editor, and it worked:

enter image description here

Is there something I can do to correct this issue, as it will wreak havoc on more complex functions and loops

like image 554
frank Avatar asked Oct 19 '25 02:10

frank


1 Answers

This is a known CPython issue on Windows (it has nothing to do with Visual Studio Code): https://github.com/python/cpython/pull/124119

As a workaround, you can either switch back to Python 3.12, or use the "Native REPL" in Visual Studio Code, which is not affected by this issue.

like image 154
cbrnr Avatar answered Oct 22 '25 04:10

cbrnr



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!