Turtle window not closing

2017-04-21 Thread Harshika Varadhan via Python-list
Hi everyone, I am creating a game where the user inputs a coordinate to place their piece on a chess board. My code then draws the chess board with a turtle and fills in the squares in with green where the user can place their next piece. After the user inputs their first coordinate, the turtle

Re: combine if filter terms from list

2017-04-21 Thread Ben Finney
Rory Schramm writes: > I'm trying to use python list comprehensions to combine multiple terms > for use by a for loop if condition. Thank you for a small code example. It doesn't have enough to illustrate the problem you're describing; we can't run it and see what you're seeing. > filters = [ '

Re: textwrap.fill algorithm? (Difference with vim)

2017-04-21 Thread Gregory Ewing
Matěj Cepl wrote: On 2017-04-21, 21:54 GMT, Peter Otten wrote: It's not the algorithm, it's the width. Try textwrap.fill(text, 72). I don’t understand. Why 72? Because the first line including those words is 72 characters long. I don't know what vim is doing, but if you tell Python you wan

Re: combine if filter terms from list

2017-04-21 Thread MRAB
On 2017-04-22 01:17, Rory Schramm wrote: Hi, I'm trying to use python list comprehensions to combine multiple terms for use by a for loop if condition. filters = [ 'one', 'two', 'three'] for line in other_list: if ' and '.join([item for item in filters]) not in line[2]: print lin

Re: Basics of pythons 🐍

2017-04-21 Thread tommy yama
Hi there, For what, you want to learn? On Sat, Apr 22, 2017 at 1:10 AM, Thomas Nyberg wrote: > On 04/21/2017 08:06 AM, harounelyaako...@gmail.com wrote: > > Hey everyone, I'm willing to learn python , ant advices ? > > Thanks in advance > > > Here is a tutorial: > > https://docs.python.org/

Re: textwrap.fill algorithm? (Difference with vim)

2017-04-21 Thread MRAB
On 2017-04-21 23:17, Matěj Cepl wrote: On 2017-04-21, 21:54 GMT, Peter Otten wrote: It's not the algorithm, it's the width. Try textwrap.fill(text, 72). I don’t understand. Why 72? I have set tw=65 in vim. textwrap.fill counts characters. It won't put "grown so" on the first line because tha

combine if filter terms from list

2017-04-21 Thread Rory Schramm
Hi, I'm trying to use python list comprehensions to combine multiple terms for use by a for loop if condition. filters = [ 'one', 'two', 'three'] for line in other_list: if ' and '.join([item for item in filters]) not in line[2]: print line The list comp returns one and two and thr

Re: textwrap.fill algorithm? (Difference with vim)

2017-04-21 Thread Matěj Cepl
On 2017-04-21, 21:54 GMT, Peter Otten wrote: > It's not the algorithm, it's the width. Try > textwrap.fill(text, 72). I don’t understand. Why 72? I have set tw=65 in vim. Matěj -- https://matej.ceplovi.cz/blog/, Jabber: mc...@ceplovi.cz GPG Finger: 3C76 A027 CA45 AD70 98B5 BC1D 7920 5802 880B

Re: textwrap.fill algorithm? (Difference with vim)

2017-04-21 Thread Peter Otten
Matěj Cepl wrote: > I have a gedit Python plugin which should do line wrap using > textwrap.fill() function. However, even when I have set the > length of line to the same number as in vim (65), the result is > substantially different (textwrap.fill paragraphs are > significantly narrower). See f

textwrap.fill algorithm? (Difference with vim)

2017-04-21 Thread Matěj Cepl
Hi, I have a gedit Python plugin which should do line wrap using textwrap.fill() function. However, even when I have set the length of line to the same number as in vim (65), the result is substantially different (textwrap.fill paragraphs are significantly narrower). See for example this diff

Re: Write a function sorting(L).

2017-04-21 Thread Tim Chase
On 2017-04-21 12:58, Mohammed Ahmed wrote: > Write a function sorting(L) that takes a list of numbers and > returns the list with all elements sorted in ascending order. > Note: do not use the sort built in function > > it is a python question No "sort" functions here... >>> lst=[3,1,4,1,5,9,2

Re: Write a function sorting(L).

2017-04-21 Thread bartc
On 21/04/2017 21:04, Mohammed Ahmed wrote: On Friday, April 21, 2017 at 10:02:55 PM UTC+2, Chris Angelico wrote: On Sat, Apr 22, 2017 at 5:58 AM, Mohammed Ahmed wrote: Write a function sorting(L) that takes a list of numbers and returns the list with all elements sorted in ascending order. No

Re: Write a function group(L).

2017-04-21 Thread Gary Herron
On 04/21/2017 01:01 PM, Mohammed Ahmed wrote: Write a function group(L) that takes a list of integers. The function returns a list of two lists one containing the even values and another containing the odd values. it is a python question In fact, this is *not* a question, Python or otherwise.

Re: Write a function group(L).

2017-04-21 Thread Ian Kelly
On Fri, Apr 21, 2017 at 2:01 PM, Mohammed Ahmed wrote: > Write a function group(L) that takes a list of integers. The function returns > a list of > two lists one containing the even values and another containing the odd > values. > > it is a python question This group will be happy to help you

Re: Write a function sorting(L).

2017-04-21 Thread Michael Torrie
On 04/21/2017 01:58 PM, Mohammed Ahmed wrote: > Write a function sorting(L) that takes a list of numbers and returns the list > with all > elements sorted in ascending order. > Note: do not use the sort built in function > > it is a python question Sounds like a basic homework question. Which p

Re: Write a function sorting(L).

2017-04-21 Thread Rob Gaddi
On 04/21/2017 01:04 PM, Mohammed Ahmed wrote: On Friday, April 21, 2017 at 10:02:55 PM UTC+2, Chris Angelico wrote: On Sat, Apr 22, 2017 at 5:58 AM, Mohammed Ahmed wrote: Write a function sorting(L) that takes a list of numbers and returns the list with all elements sorted in ascending order.

Re: Write a function sorting(L).

2017-04-21 Thread Chris Angelico
On Sat, Apr 22, 2017 at 6:04 AM, Mohammed Ahmed wrote: > On Friday, April 21, 2017 at 10:02:55 PM UTC+2, Chris Angelico wrote: >> On Sat, Apr 22, 2017 at 5:58 AM, Mohammed Ahmed >> wrote: >> > Write a function sorting(L) that takes a list of numbers and returns the >> > list with all >> > eleme

Re: Write a function sorting(L).

2017-04-21 Thread Mohammed Ahmed
On Friday, April 21, 2017 at 10:02:55 PM UTC+2, Chris Angelico wrote: > On Sat, Apr 22, 2017 at 5:58 AM, Mohammed Ahmed wrote: > > Write a function sorting(L) that takes a list of numbers and returns the > > list with all > > elements sorted in ascending order. > > Note: do not use the sort built

Re: Write a function sorting(L).

2017-04-21 Thread Mohammed Ahmed
On Friday, April 21, 2017 at 10:01:40 PM UTC+2, alister wrote: > On Fri, 21 Apr 2017 12:58:52 -0700, Mohammed Ahmed wrote: > > > Write a function sorting(L) that takes a list of numbers and returns the > > list with all elements sorted in ascending order. > > Note: do not use the sort built in fun

Write a function group(L).

2017-04-21 Thread Mohammed Ahmed
Write a function group(L) that takes a list of integers. The function returns a list of two lists one containing the even values and another containing the odd values. it is a python question -- https://mail.python.org/mailman/listinfo/python-list

Re: Write a function sorting(L).

2017-04-21 Thread alister
On Fri, 21 Apr 2017 12:58:52 -0700, Mohammed Ahmed wrote: > Write a function sorting(L) that takes a list of numbers and returns the > list with all elements sorted in ascending order. > Note: do not use the sort built in function > > it is a python question & the reason for this question is wha

Re: Write a function sorting(L).

2017-04-21 Thread Chris Angelico
On Sat, Apr 22, 2017 at 5:58 AM, Mohammed Ahmed wrote: > Write a function sorting(L) that takes a list of numbers and returns the list > with all > elements sorted in ascending order. > Note: do not use the sort built in function > > it is a python question Yes, it is. It looks like the sort of

Write a function sorting(L).

2017-04-21 Thread Mohammed Ahmed
Write a function sorting(L) that takes a list of numbers and returns the list with all elements sorted in ascending order. Note: do not use the sort built in function it is a python question -- https://mail.python.org/mailman/listinfo/python-list

Re: Direct Download Movies - No Download Limits - Download DivX DVD Movies

2017-04-21 Thread pradawalker
On Saturday, December 5, 2009 at 11:52:52 PM UTC-5, hussain dandan wrote: > Movie Download Reviews offers Free Online Movie Download,Hollywood > Movie Download,Free Full Movie Download,Download Latest Hollywood > Movies,Free Movie > > http://hollywood-moives.blogspot.com/ > http://hollywood-moives

Re: Basics of pythons 🐍

2017-04-21 Thread Thomas Nyberg
On 04/21/2017 08:06 AM, harounelyaako...@gmail.com wrote: > Hey everyone, I'm willing to learn python , ant advices ? > Thanks in advance > Here is a tutorial: https://docs.python.org/3/tutorial/ -- https://mail.python.org/mailman/listinfo/python-list

Re: Bigotry (you win, I give up)

2017-04-21 Thread Ethan Furman
On 04/21/2017 06:33 AM, Ethan Furman wrote: On 04/21/2017 03:38 AM, breamore...@gmail.com wrote: Talking of signatures another of Robert L's beauties landed three or so hours ago. He really is a right little charmer :-( Not on the Python Mailing List. I see one of them made it through.

Re: Bigotry (you win, I give up)

2017-04-21 Thread breamoreboy
On Friday, April 21, 2017 at 2:33:03 PM UTC+1, Ethan Furman wrote: > On 04/21/2017 03:38 AM, breamoreboy wrote: > > > Talking of signatures another of Robert L's beauties landed three or so > > hours ago. He really is a right little charmer :-( > > Not on the Python Mailing List. > > -- > ~Eth

Basics of pythons 🐍

2017-04-21 Thread harounelyaakoubi
Hey everyone, I'm willing to learn python , ant advices ? Thanks in advance -- https://mail.python.org/mailman/listinfo/python-list

Re: Bigotry (you win, I give up)

2017-04-21 Thread Ethan Furman
On 04/21/2017 03:38 AM, breamore...@gmail.com wrote: Talking of signatures another of Robert L's beauties landed three or so hours ago. He really is a right little charmer :-( Not on the Python Mailing List. -- ~Ethan~ -- https://mail.python.org/mailman/listinfo/python-list

Re: Bigotry (you win, I give up)

2017-04-21 Thread breamoreboy
On Friday, April 21, 2017 at 10:08:08 AM UTC+1, Antoon Pardon wrote: > Op 20-04-17 om 17:25 schreef Rustom Mody: > > But more importantly thank you for your polite and consistent pointing out > > to > > Ben Finney that his religion-bashing signature lines [many of them] and his > > claims to wish

Re: Metaclass conundrum - binding value from an outer scope

2017-04-21 Thread Peter Otten
Skip Montanaro wrote: > On Thu, Apr 20, 2017 at 3:19 PM, Peter Otten <__pete...@web.de> wrote: > >> If being helpful really is the only purpose of the metaclass you can >> implement a SomeClass.__dir__() method instead: >> >> def __dir__(self): >> names = dir(self._instance) >>

Re: Metaclass conundrum - binding value from an outer scope

2017-04-21 Thread Skip Montanaro
2017-04-20 15:55 GMT-05:00 Lele Gaifax : > Does > > underlying = getattr(SomeOtherClass, a) > def _meth(self, *args, _underlying=underlying): > return _underlying(self._instance, *args) > > help? > Hi, Lele. Long time no chat... I thought of that, but with _underlying declared af

Re: Metaclass conundrum - binding value from an outer scope

2017-04-21 Thread Skip Montanaro
On Thu, Apr 20, 2017 at 3:19 PM, Peter Otten <__pete...@web.de> wrote: > If being helpful really is the only purpose of the metaclass you can > implement a SomeClass.__dir__() method instead: > > def __dir__(self): > names = dir(self._instance) > # > return names >

Re: Rawest raw string literals

2017-04-21 Thread Jussi Piitulainen
Tim Chase writes: > On 2017-04-21 08:23, Jussi Piitulainen wrote: >> Tim Chase writes: >>> Bash: >>> cat <>> "single and double" with \ and / >>> EOT >>> >>> PS: yes, bash's does interpolate strings, so you still need to do >>> escaping within, but the arbitrary-user-specified-delimiter ide

Re: Rawest raw string literals

2017-04-21 Thread Tim Chase
On 2017-04-21 08:23, Jussi Piitulainen wrote: > Tim Chase writes: >> Bash: >> cat <> "single and double" with \ and / >> EOT >> >> PS: yes, bash's does interpolate strings, so you still need to do >> escaping within, but the arbitrary-user-specified-delimiter idea >> still holds. > > If you

Re: Bigotry (you win, I give up)

2017-04-21 Thread Antoon Pardon
Op 20-04-17 om 17:25 schreef Rustom Mody: > But more importantly thank you for your polite and consistent pointing out to > Ben Finney that his religion-bashing signature lines [many of them] and his > claims to wish this list be welcoming are way out of sync. I don't know. I think a concept like

.Re: scanf string in python

2017-04-21 Thread Robert L.
> > I have a string which is returned by a C extension. > > > > mystring = '(1,2,3)' > > > > HOW can I read the numbers in python ? > > re.findall seems the safest and easiest solution: > > >>> re.findall(r'(\d+)', '(1, 2, 3)') > ['1', '2', '3'] > >>> map(int, re.findall(r'(\d+)', '(1, 2, 3)')) >