420chan now has a web-based IRC client available, right here
Leave these fields empty (spam trap):
Name
You can leave this blank to post anonymously, or you can create a Tripcode by using the float Name#Password
Comment
[*]Italic Text[/*]
[**]Bold Text[/**]
[~]Taimapedia Article[/~]
[%]Spoiler Text[/%]
>Highlight/Quote Text
[pre]Preformatted & Monospace text[/pre]
1. Numbered lists become ordered lists
* Bulleted lists become unordered lists
File

Sandwich


Community Updates

420chan now supports HTTPS! If you find any issues, you may report them in this thread
Python by Isabella Cupperham - Fri, 17 Mar 2017 08:11:58 EST ID:sIgWxmPi No.36612 Ignore Report Quick Reply
File: 1489752718854.jpg -(716829B / 700.03KB, 2000x1000) Thumbnail displayed, click image for full size. 716829
So I was helped here, a few month back, choosing a cartesian point from a list by some criteria. Now i need to know how I can select an entry in another list, the criteria being that it has the same index as the entry from the previous list.

Dunno if relevant but here is how i get the cartesian point from the first list:

for point in lista:
avstand = abs(math.hypot(krok[0] - point[0], krok[1] - point[1]) - redskapslengde1)
if avstand < solution[0]:
solution = (avstand, point)

return solution
answer = get_min_distance(krok, redskapslengde1, lista)

So I want to summon an entry in a different list, with the same index as this answer. The latter list consists of single numbers, not x,y pair like the former.

Whoever answers this gets to fuck me in the ass if you can find me :)
Or a cake, if you can find that.
>>
David Sillyshaw - Fri, 17 Mar 2017 13:48:27 EST ID:0Wz3cQnI No.36613 Ignore Report Quick Reply
from collections import deque
history = deque()
history.append(whatever_you_want_later)


And then just keep track of the index of whatever you're interested in. If this is for diagnostic purposes, use logging and write to a file.
>>
Phineas Wishchine - Sat, 18 Mar 2017 06:19:09 EST ID:+gXm3O1V No.36617 Ignore Report Quick Reply
1489832349567.jpg -(22134B / 21.62KB, 480x360) Thumbnail displayed, click image for full size.
>>36613
wot?
Forgot too mention I'm an amateur, if even that.

Keeping track of the index, how?

I thought it would be something like just:

listb [solution[1]]
>>
Phineas Wishchine - Sat, 18 Mar 2017 09:06:08 EST ID:+gXm3O1V No.36618 Ignore Report Quick Reply
1489842368567.jpg -(3025903B / 2.89MB, 2000x1333) Thumbnail displayed, click image for full size.
>>36617
But not that, obviously.

https://www.youtube.com/watch?v=COCmaZA3d08
>>
Frederick Murdgold - Sat, 18 Mar 2017 09:32:35 EST ID:rAGFRmkY No.36619 Ignore Report Quick Reply
1489843955950.png -(127549B / 124.56KB, 1366x768) Thumbnail displayed, click image for full size.
>>36618
>>
Nell Ceblingwitch - Sat, 18 Mar 2017 10:21:55 EST ID:WLOo3E7i No.36620 Ignore Report Quick Reply
>>36612

There are a few ways you could do it. You could keep track of the index yourself while looping through the list, or just use the index function:

listb[lista.index(solution[1])]
>>
Shitting Bozzletock - Sat, 18 Mar 2017 14:21:41 EST ID:0Wz3cQnI No.36623 Ignore Report Quick Reply
>>36617
Just post your code on pastebin and maybe someone will make it do what you want for you.
>>
Reuben Blackdale - Mon, 20 Mar 2017 18:49:24 EST ID:7WN4whBM No.36629 Ignore Report Quick Reply
1490050164640.png -(27060B / 26.43KB, 757x462) Thumbnail displayed, click image for full size.
>>36620
Yea bich!
That's exactly what I was looking for.


Report Post
Reason
Note
Please be descriptive with report notes,
this helps staff resolve issues quicker.