I successfully ran your code in Visual Studio 2017, whether it is four spaces or a Tab, it runs successfully. Does anyone know what's causing the unexpected indent error in the VS Python interactive window? Thanks for any info! vs-general ![]() ![]() To top it off, when the code with the unpack operator is executed in a windows command prompt, it works perfectly! I.e., save the python snippet as TestUnpack.py, then type "py -m TestUnpack" in a windows command prompt. I've tried None, Block, and Smart for indenting options, and both Insert Spaces and Keep Tabs for tab options, nothing fixes the error. This results in the following output: j = 0Īll the indents are consistent, either 4 blank spaces or a tab of length 4. The code differs from the above only in the insertion of an asterisk before mylist in the print statement: ![]() Then I decided I wanted the output of mylist to be just a list of space-separated integers (no commas or brackets), by using the unpack operator (*). First I'll show the code that works as expected: I'm trying to execute a short snippet of python code in the VS 2017 Python Interactive Window.
0 Comments
Leave a Reply. |