Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #54057 > unrolled thread

Expected an indented block

Started byaltugozgercek@gmail.com
First post2013-09-12 08:43 -0700
Last post2013-09-13 01:51 +1000
Articles 3 — 3 participants

Back to article view | Back to comp.lang.python


Contents

  Expected an indented block altugozgercek@gmail.com - 2013-09-12 08:43 -0700
    Re: Expected an indented block John Gordon <gordon@panix.com> - 2013-09-12 15:57 +0000
    Re: Expected an indented block Chris Angelico <rosuav@gmail.com> - 2013-09-13 01:51 +1000

#54057 — Expected an indented block

Fromaltugozgercek@gmail.com
Date2013-09-12 08:43 -0700
SubjectExpected an indented block
Message-ID<eba80aa0-d13d-45ca-ba5e-f0006d7721e3@googlegroups.com>
Hey guys ! its my first topic and I'm gonna start with a problem :) Im totally beginner in Python and each time I try to run this program it gives me the error down below:

http://imgur.com/ufUAMTs

I'm using Sublime Text, same problems occured in TextWrangler and in Vim too. I tried python3 python.py too nothing has changed. Thanks in advance. 

[toc] | [next] | [standalone]


#54059

FromJohn Gordon <gordon@panix.com>
Date2013-09-12 15:57 +0000
Message-ID<l0so8v$p43$1@reader1.panix.com>
In reply to#54057
In <eba80aa0-d13d-45ca-ba5e-f0006d7721e3@googlegroups.com> altugozgercek@gmail.com writes:

> Hey guys ! its my first topic and I'm gonna start with a problem :) Im
> totally beginner in Python and each time I try to run this program it
> gives me the error down below:

> http://imgur.com/ufUAMTs

That error involves the previous program line, which your screenshot
doesn't show, so it's hard to say exactly what the problem is.

However, I'll take a guess that the previous line is an "if" statement,
which requires that the following line be indented.  Did you indent the
print statement?

This error can also be caused by using a mix of tabs and spaces on the
same line.  Don't do that.

(And by the way, it's generally better to post errors and code as text
instead of a screenshot.)

-- 
John Gordon                   A is for Amy, who fell down the stairs
gordon@panix.com              B is for Basil, assaulted by bears
                                -- Edward Gorey, "The Gashlycrumb Tinies"

[toc] | [prev] | [next] | [standalone]


#54060

FromChris Angelico <rosuav@gmail.com>
Date2013-09-13 01:51 +1000
Message-ID<mailman.314.1379001454.5461.python-list@python.org>
In reply to#54057
On Fri, Sep 13, 2013 at 1:43 AM,  <altugozgercek@gmail.com> wrote:
> Hey guys ! its my first topic and I'm gonna start with a problem :) Im totally beginner in Python and each time I try to run this program it gives me the error down below:
>
> http://imgur.com/ufUAMTs
>
> I'm using Sublime Text, same problems occured in TextWrangler and in Vim too. I tried python3 python.py too nothing has changed. Thanks in advance.

Without the code, we can't much help. But look at line 3 - it probably
has an if, while, or for statement. Did you write python.py? Did you
copy and paste it from somewhere? If the latter, make sure you retain
indentation, as it's important to Python - and it's not always
possible to figure out how far things should be indented otherwise.

If python.py isn't very large, you'd do well to simply include its
content in-line here. Including the full traceback (as text, not as an
image) is also extremely helpful. In a few years, this list/newsgroup
thread will be being read by hundreds or thousands of people, not all
of whom will want to click web links to figure out what you're saying
- and that's assuming imgur is still holding your image, which I'm not
sure is guaranteed. Text is reliable!

ChrisA

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web