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


Groups > comp.lang.python > #34693

Error .. Please Help

Path csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <insideshoes@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.017
X-Spam-Evidence '*H*': 0.97; '*S*': 0.00; 'elif': 0.04; 'subject:Error': 0.07; '"w")': 0.09; 'nameerror:': 0.09; 'received :mail-qc0-f174.google.com': 0.09; 'subject:Help': 0.10; 'advance': 0.10; '&gt;&gt;': 0.16; '0.0,': 0.16; 'skip:" 30': 0.20; 'to:name :python-list@python.org': 0.20; 'import': 0.21; 'color,': 0.22; 'defined': 0.22; '(most': 0.27; 'message-id:@mail.gmail.com': 0.27; 'skip:& 10': 0.29; "skip:' 10": 0.30; 'error': 0.30; 'code': 0.31; 'file': 0.32; 'print': 0.32; 'getting': 0.33; 'traceback': 0.33; 'to:addr:python-list': 0.33; 'received:google.com': 0.34; 'thanks': 0.34; 'continue': 0.35; 'received:209.85': 0.35; 'but': 0.36; 'subject:Please': 0.36; 'should': 0.36; 'why': 0.37; 'received:209': 0.37; 'received:209.85.216': 0.37; 'to:addr:python.org': 0.39; 'header:Received:5': 0.40; '!!!': 0.62; 'between': 0.63; 'skip:c 50': 0.66; 'color': 0.69; '8bit%:100': 0.70; '\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0': 0.84; '\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0': 0.84
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=gC8HjpzdvfZHSUA00tq6tzpPbQShT0hnddU/NZKZUyg=; b=D4cd5d99RRa7opzwuBePzeUmILPHOn2goZVjilhCxGMDYdRqghpvDJ2+119Bn9u/Av ZjLW+SzWcd1fOYi/mUgysSwE5IneId64phjaIauP2tOfxnP0mDEPTps419/Xe7ebPyJh F3hIzNUp2LnYQbDq3Cq/kzBPrS//+++oYl2OWtXR6JcpyF+uLPjA+4JmZLhgpesiEUvl zAp2vNMJpF2mkG6dJezFUIWA6rIxjpCsFeukb4nERgushoU9Rs3605AvEYMLXIaADOQW G1rWseFvl7YD+l0J9/mY3cJoX+8Dleg840Egw+cZDzLtqjtwL9rDeWqvGriOn2qrEJiI eLQQ==
MIME-Version 1.0
Date Wed, 12 Dec 2012 16:00:18 +0100
Subject Error .. Please Help
From inshu chauhan <insideshoes@gmail.com>
To "python-list@python.org" <python-list@python.org>
Content-Type multipart/alternative; boundary=047d7bdc1a868c559804d0a90eb9
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.776.1355324421.29569.python-list@python.org> (permalink)
Lines 84
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1355324421 news.xs4all.nl 6970 [2001:888:2000:d::a6]:58028
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:34693

Show key headers only | View raw


[Multipart message — attachments visible in raw view] - view raw

In this code :

import cv
g = open("PointCloudmitClass.txt", "w")
image = cv.LoadImageM("Z:/modules/intensity_000001.tif",
cv.CV_LOAD_IMAGE_UNCHANGED)
print image
for y in xrange(0,image.height):
    for x in xrange(0,image.width):
        color = image[y,x]
        if color == (0.0,0.0,0.0):
            continue
        else :

            if color == (0.0,255.0,0.0):
                classification = 1
            elif color == (128.0, 0.0, 255.0):
                classification = 2
            elif color == (255.0,0.0,0.0):
                classification = 3
            elif color == (128.0, 128.0, 128.0):
                classification = 4
            elif color == (128.0, 64.0, 0.0):
                classification = 5
            elif color == (0.0, 0.0, 255.0):
                classification = 6
            elif color == (255.0, 0.0, 255.0):
                classification = 7

            print >> g, x , y , color, classification


I am getting the following error..

Traceback (most recent call last):
  File "Z:\modules\Get_Classification.py", line 27, in <module>
    print >> g, x , y , color, classification
NameError: name 'classification' is not defined

Its simple error of name but m not getting why it should come as I have
already defined Classification in between if-else loop ??

Thanks in Advance !!!


IC

Back to comp.lang.python | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Error .. Please Help inshu chauhan <insideshoes@gmail.com> - 2012-12-12 16:00 +0100
  Re: Error .. Please Help Ulrich Eckhardt <ulrich.eckhardt@dominolaser.com> - 2012-12-12 16:46 +0100

csiph-web