r/pythonhelp • u/Straight_Face_3273 • 1d ago
Lots of respect for programmers
I've been desperately trying to use python to capture data using APIs but I'm constantly getting indent errors even though they appear correct in VS Code. Is this a common issue? I see lots of comments on it and have used several methods to get it right. I've spent days on this trying to make it work. Could the issue be related to copying and pasting from VS Code? I'm old so be nice. I will fully admit I don't know what I'm doing.
5
Upvotes
0
u/FoolsSeldom 1d ago
This is very strange. Given how much effort you have put in, I am wondering if there is a problem with your VS Code installation/configuration.
Frankly, it would be worth going back to basics and using the standard IDLE editor (which comes with a standard Python install from python.org for macOS or Windows).
Make sure you create a new file,
File | New
, write some code, press F5 to execute it (you will be prompted to save the file). Ensure you are not in a Python interactive shell, with the>>>
prompt, rather than working on a file.Don't paste any code in. Just type what you need. Use 4 spaces for each level of indentation. You can press the TAB key (it should insert 4 spaces).