Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #99414
| Path | csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail |
|---|---|
| From | Scott Montreuil <scott@zml.ca> |
| Newsgroups | comp.lang.python |
| Subject | if else python |
| Date | Wed, 25 Nov 2015 03:45:37 +0000 |
| Lines | 31 |
| Message-ID | <mailman.51.1448431821.20593.python-list@python.org> (permalink) |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset="us-ascii" |
| Content-Transfer-Encoding | quoted-printable |
| X-Trace | news.uni-berlin.de Wu0EHuOMKHS8THN5Wk6tAQocC5Biht1ZJNM0qUcdlaCg== |
| Return-Path | <scott@zml.ca> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.041 |
| X-Spam-Evidence | '*H*': 0.92; '*S*': 0.00; 'else:': 0.03; '40,': 0.09; 'subject:python': 0.14; '"%s': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'true:': 0.16; 'skip:l 30': 0.18; 'why.': 0.18; '%s"': 0.22; 'seems': 0.23; 'figure': 0.27; 'statement': 0.32; 'run': 0.33; 'skip:j 20': 0.33; 'skip:d 20': 0.34; 'unknown': 0.35; 'something': 0.35; 'url:org': 0.36; 'to:addr :python-list': 0.36; 'received:10': 0.37; 'missing': 0.37; 'url :rec-html40': 0.37; 'charset:us-ascii': 0.37; 'received:66': 0.38; 'hi,': 0.38; 'data': 0.39; 'to:addr:python.org': 0.40; 'url:schemas': 0.40; 'url:office': 0.40; 'skip:u 10': 0.61; 'received:10.10': 0.76; 'received:10.10.10': 0.84; 'subject:else': 0.84 |
| Thread-Topic | if else python |
| Thread-Index | AdEnMz5crHJYK4QgRP+dY+xy443jIw== |
| Accept-Language | en-US |
| Content-Language | en-US |
| X-MS-Has-Attach | |
| X-MS-TNEF-Correlator | |
| x-originating-ip | [10.10.10.96] |
| X-Mailman-Approved-At | Wed, 25 Nov 2015 01:10:20 -0500 |
| X-Content-Filtered-By | Mailman/MimeDel 2.1.20+ |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.20+ |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <https://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 | <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Xref | csiph.com comp.lang.python:99414 |
Show key headers only | View raw
Hi,
I have an if statement which seems to run both commands and I cannot figure out why. (just learning so I may be missing something obvious) Any ideas?
while True:
global latit,longt,jlatit,jlongt,mlongt,mlatit
response = urllib.urlopen(url)
data = json.loads(response.read())
latit = data['Data'][0]['Latitude']
longt = data['Data'][0]['Longitude']
jlatit = data['Data'][1]['Latitude']
jlongt = data['Data'][1]['Longitude']
mlatit = data['Data'][2]['Latitude']
mlongt = data['Data'][2]['Longitude']
for i in user1locat:
if float(i[2]) <= float(latit) <= float(i[3]) and float(i[4]) >= float(longt) >= float(i[5]):
newlocation = int(i[1])
screen.addstr(7, 40, "%s at %s" %(user1, i[0]))
motor1thread = threading.Thread(target=motor1)
motor1thread.start()
screen.refresh()
else:
screen.addstr(5, 40, "%s is at an unknown location %f %f\n" % (user1, latit, longt))
newlocation = 200
motor1thread = threading.Thread(target=motor1)
motor1thread.start()
screen.refresh()
time.sleep(10)
Back to comp.lang.python | Previous | Next — Next in thread | Find similar | Unroll thread
if else python Scott Montreuil <scott@zml.ca> - 2015-11-25 03:45 +0000 Re: if else python Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-11-25 11:10 +0000 Re: if else python John Gordon <gordon@panix.com> - 2015-11-26 13:25 +0000
csiph-web