Re: any suggestion on this code

2017-04-23 Thread Steve D'Aprano
On Sun, 23 Apr 2017 06:21 pm, Ganesh Pal wrote: > 1. Any better suggestion to optimize the code and any other > observations around use of assert, generators and are exception handled > correctly in return_matched_owner() When to use assert: http://import-that.dreamwidth.org/676.html

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

2017-04-23 Thread Mikhail V
On 23 April 2017 at 05:03, MRAB wrote: > 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

Re: any suggestion on this code

2017-04-23 Thread MRAB
On 2017-04-23 09:21, Ganesh Pal wrote: Hello Team, I have a sample code that runs through the list of dictionary and return a dictionary if the search value matched *Sample Program:* #!/usr/bin/python def return_matched_owner(dict_list,search_block): """Accepts a list of dictionar

Re: In Python and Windows environment how to supress certain key press and send some other key event for it

2017-04-23 Thread J. Clarke
In article , i.am.song...@gmail.com says... > > Hi All, > > I was trying to build a VIM like shortcuts in windows. For example, > > IF i press CAPSLOCK & h: It should "{Left}" move one to left. If CAPSLOCK & > b: It should "{Ctrl Down}{Left}{Ctrl Up}" move one word left etc. > > I was successf

any suggestion on this code

2017-04-23 Thread Ganesh Pal
Hello Team, I have a sample code that runs through the list of dictionary and return a dictionary if the search value matched *Sample Program:* #!/usr/bin/python def return_matched_owner(dict_list,search_block): """Accepts a list of dictionary with owners and returns a dict if th

Re: Turtle window not closing

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