🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.gis
Article #12395

Re: [Python] problem z odczytaniem warto ci zmiennych

#12395
From: Mateusz Loskot
Date: Thu, 06 Jan 2011 18:41
28 lines
1785 bytes
"Pawe" <gamacdur@op.pl> wrote in message 
news:4d18675a$0$2499$65785112@news.neostrada.pl...
> n0 = 0
> n1 = 0 #liczba znalezionych duplikat�w
>
> codeblock = "uniqueList = []\n\
> def isDuplicate(inValue):\n\
>  if inValue in uniqueList:\n\
>      return 1\n\
>      n1=n1+1\n\
>  else:\n\
>    uniqueList.append(inValue)\n\
>    return 0\n\
>    n0=n0+1"


Podejrzane jest to, że funkcja isDuplicate kończy
wykonanie (return 1 lub return 0) przed jakąkolwiek inkrementacją
liczników n1 lub n0. Inaczej, n1 i n0 są zawsze równe Zero.

Nigdy nie używałem skryptów w Pythonie wraz z ArcGIS, więc być
może problem jest specyficzny dla tego środowiska.

Pozdrawiam
-- 
Mateusz Loskot, http://mateusz.loskot.net
pl.comp.lang.c FAQ: http://pl.cpp.wikia.com/wiki/FAQ
C++ FAQ: http://parashift.com/c++-faq-lite 
Technical Details
Message-ID: <ig525u$qgr$1@inews.gazeta.pl>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.gazeta.pl!not-for-mail
References: <4d18675a$0$2499$65785112@news.neostrada.pl>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.gazeta.pl!not-for-mail
From: "Mateusz Loskot" <mateusz@loskot.net>
Newsgroups: pl.comp.gis
Subject: Re: [Python] problem z odczytaniem warto ci zmiennych
Date: Thu, 6 Jan 2011 18:41:27 -0000
Organization: "Portal Gazeta.pl -> http://www.gazeta.pl"
Lines: 29
Message-ID: <ig525u$qgr$1@inews.gazeta.pl>
References: <4d18675a$0$2499$65785112@news.neostrada.pl>
NNTP-Posting-Host: 82.110.183.162
Mime-Version: 1.0
X-Trace: inews.gazeta.pl 1294339070 27163 82.110.183.162 (6 Jan 2011 18:37:50 GMT)
X-Complaints-To: usenet@agora.pl
NNTP-Posting-Date: Thu, 6 Jan 2011 18:37:50 +0000 (UTC)
In-Reply-To: <4d18675a$0$2499$65785112@news.neostrada.pl>
X-MimeOLE: Produced By Microsoft MimeOLE V6.0.6002.18263
X-Priority: 3
X-Newsreader: Microsoft Windows Mail 6.0.6002.18197
X-User: mloskot
X-MSMail-Priority: Normal
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit