![]() (Much gratitude to the legendary Carlos Cordoba for taking time to answer such an elementary problem. Hope this maybe helps out another absolute beginner. It's such a stupid mistake that I couldn't find anything on Google or Stack Overflow. What I wanted to do was run the cell by pressing ctrl return. I was running only the line by putting the cursor in/on it and pressing F9. I'd be very grateful for any help or pointers. It seems as though it's the enter that's causing the error, but this seems rather hard to fathom. TRAILING INDENT PDFKIT CODEAlso, highlighting the code and going to Source -> Fix Indentation doesn't help, I get the same error. One of the things that you could do (this is sort of a nasty solution) is to draw the text in white (so its drawn but invisible), and then check the value of doc. I get the same error when I just let the IDE do it's job and automatically format the spacing for me after the enter strokes. I thought maybe I was mixing spaces (behind the colon) with tabs (on the following line), but I get the same error when I don't insert a space behind the colon (just a tab on the following line). Whereas if I type it on the same line: for i in range(1,11): print(i) Whereas if I write it on the same line, the error disappears: def iris_data(): print("hello")Īnd again in the following example: for i in range(1,11):įile "C:\Users\.\AppData\Local\Temp\ipykernel_9452\1334445784.py", line 1 No matter which code I type, the Indentation Error is always just at the end of the colon when I indent, and disappears when I write it all on the same line.Īs another example, in the below code (again using 4 spaces here): def iris_data(): If I write the same code on the same line, I don't get an error. IndentationError: expected an indented block I'm using Spyder as an IDE and it indents it for me, but whether I use Spyder's indent or indent it myself (with tab or 4 spaces), the error I get is: In if 8 4 > 0:įile "C:\Users\.\AppData\Local\Temp\ipykernel_9452\858389318.py", line 1 The simplest example that generates the error is (using 4 spaces here): if 3 5 > 0: But when I include an enter and a tab stroke, the interpreter throws an indentation error. The problem I'm having is that code will run when I have it all on one line. But the solutions that have worked there were to either include a tab (or 4 spaces) in the following line, or else fix other issues there were with the more complex code, which answers don't work or don't seem applicable in my case. Maven/ are a lot of questions concerning indentation errors on stack overflow and I've been through a lot. Maven/com.mikepenz:material-design-iconic-typeface Maven/com.mikepenz:google-material-typeface Maven/com.jakewharton:butterknife-compiler Maven/com.jakewharton:butterknife-annotations Maven/com.dangdang:sharding-jdbc-config-spring Maven/com.andkulikov:transitionseverywhere Maven/com.alibaba:druid-spring-boot-starter Maven/com.actionbarsherlock:actionbarsherlock Maven/cn.bingoogolapple:bga-refreshlayout Want to go ahead and start earning for your ongoing maintenance of your project? Go ahead and apply to lift it by clicking through! Table of contents TRAILING INDENT PDFKIT FREETo see if your package is eligible, feel free to Ctrl-F or Cmd-F and search the package name. To get an easy sense for just what that means, we wanted to share a complete list of all projects that are eligible for earn income through Tidelift right now. This monthly recurring income is now available for over 4,000 different open source packages, across ecosystems such as Maven, RubyGems, PyPI, and npm. Each month, the maintainers who have partnered with Tidelift-we call them "lifters"-receive the income they've earned from Tidelift and our customers. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |