Re: Turtle window not closing

2017-04-22 Thread Terry Reedy
On 4/22/2017 3:52 AM, Peter Otten wrote: Harshika Varadhan via Python-list wrote: Are you running your script from within IDLE? Try starting it from the command line instead. Like turtle IDLE itself is a program written in tkinter, and the separation between editer and user code is not alwa

Re: OrderedDict with kwds

2017-04-22 Thread Ben Finney
Albert-Jan Roskam writes: > The basic problem is that kwds is a regular, unordered dict […] (Albert, you are probably aware that the above passage is not what you wrote. But your message shows it indistinguishable from your other text. Please teach your email client to compose quoted material u

Re: OrderedDict with kwds

2017-04-22 Thread Ben Finney
INADA Naoki writes: > On Sat, Apr 22, 2017 at 10:41 PM, Ben Finney > wrote: > > So, I would recommend continuing to code as though ‘dict’ is not > > ordered, at least until a Python version is released with a clear > > statement that ordering can be relied upon. > > While dict's order is implem

Re: String escaping utility for Python (was: Rawest raw string literals)

2017-04-22 Thread MRAB
On 2017-04-22 23:30, Mikhail V wrote: On 20 April 2017 at 23:54, MRAB wrote: > On 2017-04-20 22:03, Mikhail V wrote: >> >> On 20 April 2017 at 22:43, Random832 wrote: >>> [snip] >>> >>> The best solution I can think of is to have a text editor designed to >>> parse a string literal, spawn a nes

Re: String escaping utility for Python (was: Rawest raw string literals)

2017-04-22 Thread Chris Angelico
On Sun, Apr 23, 2017 at 12:30 PM, eryk sun wrote: > The X terminals that I've used make it easy to copy text to the > clipboard. For Windows, it's a pain prior to Windows 10 since the > legacy console only does rectangular selection. The Windows 10 console > does line-wrapped selection. This is t

Re: String escaping utility for Python (was: Rawest raw string literals)

2017-04-22 Thread eryk sun
On Sun, Apr 23, 2017 at 2:06 AM, Mikhail V wrote: > > But are you joking, right? Even if it worked, how can this be convinient, > e.g. in console one cannot even select and copy paste easily. The X terminals that I've used make it easy to copy text to the clipboard. For Windows, it's a pain prior

Re: String escaping utility for Python (was: Rawest raw string literals)

2017-04-22 Thread Chris Angelico
On Sun, Apr 23, 2017 at 12:06 PM, Mikhail V wrote: > Don't know, all I see is "SyntaxError: invalid syntax" if I paste > there some text. > Try to paste e.g. this: > "ffmpeg -i "D:\VIDEO\exp\intro.mp4" -vf "crop=1280:720:0:40, > scale=640:360" -pix_fmt yuv420p "D:\ART\0MASTER_UMST\yt_pico.mp4""

Re: String escaping utility for Python (was: Rawest raw string literals)

2017-04-22 Thread Mikhail V
On 23 April 2017 at 02:33, Chris Angelico wrote: > On Sun, Apr 23, 2017 at 10:19 AM, Mikhail V wrote: >> On 23 April 2017 at 00:48, Chris Angelico wrote: >>> On Sun, Apr 23, 2017 at 8:30 AM, Mikhail V wrote: The purpose is simple: reduce manual work to escape special characters in str

Re: String escaping utility for Python (was: Rawest raw string literals)

2017-04-22 Thread Chris Angelico
On Sun, Apr 23, 2017 at 10:19 AM, Mikhail V wrote: > On 23 April 2017 at 00:48, Chris Angelico wrote: >> On Sun, Apr 23, 2017 at 8:30 AM, Mikhail V wrote: >>> The purpose is simple: reduce manual work to escape special >>> characters in string literals (and escape non-ASCII characters). >>> >>>

Re: String escaping utility for Python (was: Rawest raw string literals)

2017-04-22 Thread Mikhail V
On 23 April 2017 at 00:48, Chris Angelico wrote: > On Sun, Apr 23, 2017 at 8:30 AM, Mikhail V wrote: >> The purpose is simple: reduce manual work to escape special >> characters in string literals (and escape non-ASCII characters). >> >> Simple usage scenario: >> - I have a long command-line stri

Re: String escaping utility for Python (was: Rawest raw string literals)

2017-04-22 Thread Chris Angelico
On Sun, Apr 23, 2017 at 8:30 AM, Mikhail V wrote: > The purpose is simple: reduce manual work to escape special > characters in string literals (and escape non-ASCII characters). > > Simple usage scenario: > - I have a long command-line string in some text editor. > - Copy this string and paste in

String escaping utility for Python (was: Rawest raw string literals)

2017-04-22 Thread Mikhail V
On 20 April 2017 at 23:54, MRAB wrote: > On 2017-04-20 22:03, Mikhail V wrote: >> >> On 20 April 2017 at 22:43, Random832 wrote: >>> [snip] >>> >>> The best solution I can think of is to have a text editor designed to >>> parse a string literal, spawn a nested editor with the unescaped >>> conten

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

2017-04-22 Thread Matěj Cepl
On 2017-04-22, 18:33 GMT, Peter Otten wrote: > Yes, the documentation should warn about the limitations of > textwrap's notion of width -- but still, the line you > complained about Perhaps, I have screwed up somewhere, but I am glad we were able to figure it out. Thank you for your patience,

Re: Rawest raw string literals

2017-04-22 Thread Tim Chase
On 2017-04-22 23:13, Mikhail V wrote: > k = r"abc > def" > > gives an error: > > k = r"abc > ^ > SyntaxError: EOL while scanning string literal > > So one could define a rule, that a raw string *must* > be terminated by the sequence quote + newline. > In theory. Though one

Re: How to get Buttons to work

2017-04-22 Thread Albert-Jan Roskam
(sorry for top-posting). UpdateRecords and the other functions need to be nested so they fall under your class. Right now they are functions, not methods. AJ From: Python-list on behalf of horgan.ant...@gmail.com Sent: Saturday, April 22, 2017 12:45:09 PM To: p

Re: Rawest raw string literals

2017-04-22 Thread Chris Angelico
On Sun, Apr 23, 2017 at 7:13 AM, Mikhail V wrote: > So one could define a rule, that a raw string *must* > be terminated by the sequence quote + newline. > In theory. Then how would you pass one as a function parameter? func(r"" ) Ugh. Ugly. ChrisA -- https://mail.python.org/mailman/listi

Re: Metaclass conundrum - binding value from an outer scope

2017-04-22 Thread Peter Otten
Skip Montanaro wrote: >> Another round, this time with a metaclass. As you have found partial() >> does not work as a method because it's not a descriptor (i. e. no >> __get__() method). Instead you can try a closure: >> >> def make_method(a): >> underlying = getattr(SomeOtherClass, a) >>

Re: Rawest raw string literals

2017-04-22 Thread Mikhail V
On 20 April 2017 at 18:40, Grant Edwards wrote: > On 2017-04-20, Mikhail V wrote: >> On 20 April 2017 at 17:59, Grant Edwards wrote: >>> On 2017-04-20, Mikhail V wrote: Quite often I need raw string literals for concatenating console commands. I want to input them exactly as they are

Re: Metaclass conundrum - binding value from an outer scope

2017-04-22 Thread Skip Montanaro
> Another round, this time with a metaclass. As you have found partial() does > not work as a method because it's not a descriptor (i. e. no __get__() > method). Instead you can try a closure: > > def make_method(a): > underlying = getattr(SomeOtherClass, a) > @functools.wraps(underlying) >

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

2017-04-22 Thread Peter Otten
Matěj Cepl wrote: > On 2017-04-22, 01:01 GMT, Gregory Ewing wrote: >> I don't know what vim is doing, but if you tell Python you >> want lines no longer than 65 characters, it takes you at >> your word. > > Oh, I’ve got it. textwrap.fill() (only in Python 2.*?) completely > sucks with bytes, beca

Re: Bigotry (you win, I give up)

2017-04-22 Thread Rurpy via Python-list
On 04/22/2017 05:17 AM, Rustom Mody wrote: > On Friday, April 21, 2017 at 2:38:08 PM UTC+5:30, 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

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

2017-04-22 Thread Matěj Cepl
On 2017-04-22, 01:01 GMT, Gregory Ewing wrote: > I don't know what vim is doing, but if you tell Python you > want lines no longer than 65 characters, it takes you at > your word. Oh, I’ve got it. textwrap.fill() (only in Python 2.*?) completely sucks with bytes, because of course it counts every

Re: OrderedDict with kwds

2017-04-22 Thread INADA Naoki
On Sat, Apr 22, 2017 at 10:41 PM, Ben Finney wrote: > INADA Naoki writes: > >> From Python 3.6, keyword arguments are ordered. So the docstring is >> outdated. > > (Thank you, Inada-san, for the implementation!) > > The announcement of the change specifies that we should not rely on > ordered ‘di

Re: OrderedDict with kwds

2017-04-22 Thread Albert-Jan Roskam
From: eryk sun Sent: Saturday, April 22, 2017 7:59 AM To: Python Main Cc: Albert-Jan Roskam Subject: Re: OrderedDict with kwds   On Fri, Apr 21, 2017 at 6:08 PM, Albert-Jan Roskam wrote: > Would the insertion order be preserved if the last line were to be > replaced with: > > if kwds: > fo

Re: Turtle window not closing

2017-04-22 Thread Harshika Varadhan via Python-list
Thank you for your response. I apologize for that, this is my first time posting so I wasn't sure how to copy my code!  I figured out that using the clear() method works for clearing the turtle window after drawing the game board, but now I am trying to figure out how to make the program wait a

Re: Microsoft now ships Python with SQL Server

2017-04-22 Thread justin walters
On Sat, Apr 22, 2017 at 5:05 AM, Steve D'Aprano wrote: > https://blogs.technet.microsoft.com/dataplatforminsider/2017/04/ > 19/python-in-sql-server-2017-enhanced-in-database-machine-learning/ > > Quote: > > We are excited to share the preview release of in-database analytics and > machine learnin

Gephi development references

2017-04-22 Thread tommy yama
Hey there Pythoners, Hope you guys are all well. I am actually very interested in learning the gephi, a platform which is capable of easily developing a variety of awesome graphs. Dose anyone give me some code samples and resources which relates the gephi? Appreciated for reading this! T --

Re: OrderedDict with kwds

2017-04-22 Thread Ben Finney
INADA Naoki writes: > From Python 3.6, keyword arguments are ordered. So the docstring is > outdated. (Thank you, Inada-san, for the implementation!) The announcement of the change specifies that we should not rely on ordered ‘dict’: The order-preserving aspect of this new implementation i

Re: How to get Buttons to work

2017-04-22 Thread Peter Otten
horgan.ant...@gmail.com wrote: > I am busy learning Python and I want to make a simple program that > connects to a database to locate the information of Doctors. Now the as > far as I can see everything works fine, database connects, info gets > displayed, but the buttons don't want to work. Plea

How to get Buttons to work

2017-04-22 Thread horgan . anton5
I am busy learning Python and I want to make a simple program that connects to a database to locate the information of Doctors. Now the as far as I can see everything works fine, database connects, info gets displayed, but the buttons don't want to work. Please see code and error below. Any hel

Microsoft now ships Python with SQL Server

2017-04-22 Thread Steve D'Aprano
https://blogs.technet.microsoft.com/dataplatforminsider/2017/04/19/python-in-sql-server-2017-enhanced-in-database-machine-learning/ Quote: We are excited to share the preview release of in-database analytics and machine learning with Python in SQL Server. Python is one of the most popular languag

Re: Bigotry (you win, I give up)

2017-04-22 Thread Rustom Mody
On Friday, April 21, 2017 at 2:38:08 PM UTC+5:30, 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 wi

Re: OrderedDict with kwds

2017-04-22 Thread Peter Otten
Albert-Jan Roskam wrote: > For regular dicts I like to use the dict() function because the code is > easier to write and read. But OrderedDict() is not equivalent to dict(): > In the docstring of collections.OrderedDict it says "keyword arguments are > not recommended because their insertion order

Re: OrderedDict with kwds

2017-04-22 Thread INADA Naoki
On Sat, Apr 22, 2017 at 3:08 AM, Albert-Jan Roskam wrote: > For regular dicts I like to use the dict() function because the code is > easier to write and read. But OrderedDict() is not equivalent to dict(): > In the docstring of collections.OrderedDict it says "keyword arguments are > not recomm

Re: OrderedDict with kwds

2017-04-22 Thread eryk sun
On Fri, Apr 21, 2017 at 6:08 PM, Albert-Jan Roskam wrote: > Would the insertion order be preserved if the last line were to be > replaced with: > > if kwds: > for k, v in kwds.items(): > self[k] = v > if args: > self.__update(*args) # no **kwds! The basic problem is that kwds is

Re: Turtle window not closing

2017-04-22 Thread Peter Otten
Harshika Varadhan via Python-list wrote: > 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 t

OrderedDict with kwds

2017-04-22 Thread Albert-Jan Roskam
For regular dicts I like to use the dict() function because the code is easier to write and read. But OrderedDict() is not equivalent to dict(): In the docstring of collections.OrderedDict it says "keyword arguments are not recommended because their insertion order is arbitrary" (https://github.