Re: is it possible to adjust convex hull to draw blue line instead of green line?

2016-09-16 Thread meInvent bbird
On Saturday, September 17, 2016 at 2:31:59 PM UTC+8, meInvent bbird wrote: > On Saturday, September 17, 2016 at 9:35:35 AM UTC+8, Steve D'Aprano wrote: > > On Sat, 17 Sep 2016 10:20 am, meInvent bbird wrote: > > > > > i succeed to use code to draw green line, but green line not draw the > > > larg

Re: Where is the documentation for ','?

2016-09-16 Thread Steve D'Aprano
On Sat, 17 Sep 2016 12:05 pm, Peng Yu wrote: > Hi, > > I'm wondering where is the documentation for ',' as in the following > usage. > > x = 1 > y = 2 > x, y = y, x > > I tried help(','). But there are too many ',' in it and I don't see in > which section ',' is documented. Could anybody let me

Re: Is there something similar to `set -v` of bash in python

2016-09-16 Thread Steve D'Aprano
On Sat, 17 Sep 2016 12:31 pm, Peng Yu wrote: > Hi, `set -v` in bash allows the print of the command before print the > output of the command. > > I want to do the similar thing --- print a python command and then > print the output of the command. Is it possible with python? There is no built-i

Re: is it possible to adjust convex hull to draw blue line instead of green line?

2016-09-16 Thread meInvent bbird
On Saturday, September 17, 2016 at 9:35:35 AM UTC+8, Steve D'Aprano wrote: > On Sat, 17 Sep 2016 10:20 am, meInvent bbird wrote: > > > i succeed to use code to draw green line, but green line not draw the > > large area, expect second uploaded picture, the blue line connect > > the bottom of red l

Re: Where is the documentation for ','?

2016-09-16 Thread eryk sun
On Sat, Sep 17, 2016 at 2:05 AM, Peng Yu wrote: > > I'm wondering where is the documentation for ',' as in the following usage. > > x = 1 > y = 2 > x, y = y, x > > I tried help(','). But there are too many ',' in it and I don't see in > which section ',' is documented. Could anybody let me know? T

Re: Where is the documentation for ','?

2016-09-16 Thread Terry Reedy
On 9/16/2016 10:05 PM, Peng Yu wrote: Hi, I'm wondering where is the documentation for ',' as in the following usage. x = 1 y = 2 x, y = y, x I tried help(','). But there are too many ',' in it and I don't see in which section ',' is documented. Could anybody let me know? Thanks. It should b

array.itemsize: Documentation Versus Reality

2016-09-16 Thread Lawrence D’Oliveiro
>>> a = array.array("I", (0,)) >>> a.itemsize 4 >>> a = array.array("L", (0,)) >>> a.itemsize 8 According to , the “minimum size” should be 2 and 4 respectively. It further says: The actual representation of values is dete

Re: Where is the documentation for ','?

2016-09-16 Thread Ben Finney
Peng Yu writes: > help(tuple) gives me this Yes. That's the API definition for the ‘tuple’ type. You were advised to search the documentation, not the interactive help. You'll find the descriptions of “tuple” and even “tuple unpacking” are what you want. -- \ “When I turned two I was rea

Re: Where is the documentation for ','?

2016-09-16 Thread Nathan Ernst
The grammar and what it represents is defined at https://docs.python.org/3/reference/expressions.html#expression-lists Regards On Sep 16, 2016 9:59 PM, "Peng Yu" wrote: > OK. But it is documented somewhere in python doc? > > On Fri, Sep 16, 2016 at 9:48 PM, Lawrence D’Oliveiro > wrote: > > On

Re: Where is the documentation for ','?

2016-09-16 Thread Peng Yu
OK. But it is documented somewhere in python doc? On Fri, Sep 16, 2016 at 9:48 PM, Lawrence D’Oliveiro wrote: > On Saturday, September 17, 2016 at 2:05:49 PM UTC+12, Peng Yu wrote: >> x, y = y, x > > It’s just syntactic sugar for > > (x, y) = (y, x) > -- > https://mail.python.org/mailman/list

Re: Where is the documentation for ','?

2016-09-16 Thread Lawrence D’Oliveiro
On Saturday, September 17, 2016 at 2:05:49 PM UTC+12, Peng Yu wrote: > x, y = y, x It’s just syntactic sugar for (x, y) = (y, x) -- https://mail.python.org/mailman/listinfo/python-list

Is there something similar to `set -v` of bash in python

2016-09-16 Thread Peng Yu
Hi, `set -v` in bash allows the print of the command before print the output of the command. I want to do the similar thing --- print a python command and then print the output of the command. Is it possible with python? -- Regards, Peng -- https://mail.python.org/mailman/listinfo/python-list

Re: Where is the documentation for ','?

2016-09-16 Thread Peng Yu
help(tuple) gives me this, which does not mention ',' either. Help on class tuple in module __builtin__: class tuple(object) | tuple() -> empty tuple | tuple(iterable) -> tuple initialized from iterable's items | | If the argument is a tuple, the return value is the same object. | | Met

Re: Where is the documentation for ','?

2016-09-16 Thread MRAB
On 2016-09-17 03:05, Peng Yu wrote: Hi, I'm wondering where is the documentation for ',' as in the following usage. x = 1 y = 2 x, y = y, x I tried help(','). But there are too many ',' in it and I don't see in which section ',' is documented. Could anybody let me know? Thanks. Search for 't

Where is the documentation for ','?

2016-09-16 Thread Peng Yu
Hi, I'm wondering where is the documentation for ',' as in the following usage. x = 1 y = 2 x, y = y, x I tried help(','). But there are too many ',' in it and I don't see in which section ',' is documented. Could anybody let me know? Thanks. -- Regards, Peng -- https://mail.python.org/mailma

Re: is it possible to adjust convex hull to draw blue line instead of green line?

2016-09-16 Thread MRAB
On 2016-09-17 01:20, meInvent bbird wrote: i succeed to use code to draw green line, but green line not draw the large area, expect second uploaded picture, the blue line connect the bottom of red line graph [snip] Here's the code with the commented code and print statements removed and the i

Re: how to automate java application in window using python

2016-09-16 Thread Lawrence D’Oliveiro
On Friday, September 16, 2016 at 10:22:34 PM UTC+12, Christian Gollwitzer wrote: > "How do I automate a Java application using Python?" Which is really a meaningless question. “Automation” is what computer programs do. (Assuming “application” is just another word for “program”.) If the program d

Re: is it possible to adjust convex hull to draw blue line instead of green line?

2016-09-16 Thread Steve D'Aprano
On Sat, 17 Sep 2016 10:20 am, meInvent bbird wrote: > i succeed to use code to draw green line, but green line not draw the > large area, expect second uploaded picture, the blue line connect > the bottom of red line graph Please don't waste our time with dead code that has been commented out or

is it possible to adjust convex hull to draw blue line instead of green line?

2016-09-16 Thread meInvent bbird
i succeed to use code to draw green line, but green line not draw the large area, expect second uploaded picture, the blue line connect the bottom of red line graph im = img.copy() cntcounter = 0 for cnt in contours: #epsilon = 0.1*cv2.arcLength(cnt,True) #approx = cv2.approxPolyD

Re: why this code loop forever after a draw a rectangle

2016-09-16 Thread meInvent bbird
after succeed to draw lines in graph, however, https://drive.google.com/file/d/0Bxs_ao6uuBDUWVBFZzVIVGotRlk/view?usp=sharing expected the blue line connect the bottom of red line graph https://drive.google.com/file/d/0Bxs_ao6uuBDUNGZFS2F3WnJERzA/view?usp=sharing how can convex hull be adjusted

Re: why this code loop forever after a draw a rectangle

2016-09-16 Thread meInvent bbird
img is the image im is a new memory of image using img.copy() On Saturday, September 17, 2016 at 7:46:42 AM UTC+8, meInvent bbird wrote: > thank you very much, > it out of the loop now. > because drawLine function return things > > i just change drawLine to rectangle, > have not thought that r

Re: why this code loop forever after a draw a rectangle

2016-09-16 Thread meInvent bbird
thank you very much, it out of the loop now. because drawLine function return things i just change drawLine to rectangle, have not thought that rectangle not return thing, just edit the parameter On Saturday, September 17, 2016 at 5:26:53 AM UTC+8, MRAB wrote: > On 2016-09-16 20:14, Gary Herron

Looking for tips and gotchas for working with Python 3.5 zipapp feature

2016-09-16 Thread Malcolm Greene
Looking for tips or edge case gotchas associated with using Python 3.5's new zipapp feature. For those of you wondering what this feature is, see the end of this post for a brief background [1]. Two questions in particular: 1. Are there any issues with deploying scripts that sit in sub- folder

Re: Discover all non-standard library modules imported by a script

2016-09-16 Thread Malcolm Greene
Thanks for your suggestions Chris and Terry. The answer I was looking for is the modulefinder module which is part of the standard lib. Works like a charm! Quote: This module provides a ModuleFinder class that can be used to determine the set of modules imported by a script. modulefinder.py can a

Re: How to get the source code of python function being decorated?

2016-09-16 Thread Peter Otten
Peng Yu wrote: > Hi, See the following example, I am not able to get the source code of > the actual function that does the calculation of partial_ratio. Does > anybody know what is the correct way of getting the source? > > /tmp$ ./main.py > @functools.wraps(func) > def decorator(*args,

Re: How to get the source code of python function being decorated?

2016-09-16 Thread Ned Batchelder
On Friday, September 16, 2016 at 3:20:15 PM UTC-4, Peng Yu wrote: > Hi, See the following example, I am not able to get the source code of > the actual function that does the calculation of partial_ratio. Does > anybody know what is the correct way of getting the source? > > /tmp$ ./main.py >

Re: why this code loop forever after a draw a rectangle

2016-09-16 Thread MRAB
On 2016-09-16 20:14, Gary Herron wrote: On 09/16/2016 04:24 AM, meInvent bbird wrote: im = img.copy() cntcounter = 0 for cnt in contours: epsilon = 0.1*cv2.arcLength(cnt,True) approx = cv2.approxPolyDP(cnt,epsilon,True) #peri = cv2.arcLength(cnt, True) #ap

Re: Discover all non-standard library modules imported by a script

2016-09-16 Thread Terry Reedy
On 9/16/2016 7:29 AM, Malcolm Greene wrote: Looking for suggestions on how, given a main script, discover all the non-standard library modules imported across all modules, eg. the modules that other modules import, etc. I'm not looking to discover dynamic imports or other edge cases, just the lis

Re: why this code loop forever after a draw a rectangle

2016-09-16 Thread Gary Herron
On 09/16/2016 05:18 AM, meInvent bbird wrote: i follow this post to give some time it to operate, wait a long time still looping http://answers.opencv.org/question/60094/libpng-warning-image-width-is-zero-in-ihdr/ i can not stand this Ninja coding life any more, i have to open my code for ask

How to install Python.h on FreeBSD 10.0-RELEASE?

2016-09-16 Thread Don Kuenz
The installed python packages are shown below. Searches lead me to believe that a PTH option make play a role. $ uname -v FreeBSD 10.0-RELEASE #0 r260789: Thu Jan 16 22:34:59 UTC 2014 r...@snap.freebsd.org:/usr/obj/usr/

Re: why this code loop forever after a draw a rectangle

2016-09-16 Thread Gary Herron
On 09/16/2016 04:24 AM, meInvent bbird wrote: im = img.copy() cntcounter = 0 for cnt in contours: epsilon = 0.1*cv2.arcLength(cnt,True) approx = cv2.approxPolyDP(cnt,epsilon,True) #peri = cv2.arcLength(cnt, True) #approx = cv2.approxPolyDP(c, 0.5 * peri, Tr

How to get the source code of python function being decorated?

2016-09-16 Thread Peng Yu
Hi, See the following example, I am not able to get the source code of the actual function that does the calculation of partial_ratio. Does anybody know what is the correct way of getting the source? /tmp$ ./main.py @functools.wraps(func) def decorator(*args, **kwargs): if args[0]

Re: how to automate java application in window using python

2016-09-16 Thread vern . muhr
On Thursday, September 15, 2016 at 11:57:04 PM UTC-7, meInvent bbird wrote: > On Friday, September 16, 2016 at 2:26:47 AM UTC+8, bream...@gmail.com wrote: > > On Thursday, September 15, 2016 at 8:13:05 AM UTC+1, meInvent bbird wrote: > > > how to automate java application in window using python > >

Re: how to automate java application in window using python

2016-09-16 Thread Fabio Zadrozny
Take a look at https://pyautogui.readthedocs.io/en/latest/ On Fri, Sep 16, 2016 at 9:24 AM, meInvent bbird wrote: > you are right, english is not my first language > > i just talk as simple as i can, i do not know previous talking is mean > > > On Friday, September 16, 2016 at 6:22:34 PM UTC+8,

Re: how to automate java application in window using python

2016-09-16 Thread meInvent bbird
you are right, english is not my first language i just talk as simple as i can, i do not know previous talking is mean On Friday, September 16, 2016 at 6:22:34 PM UTC+8, Christian Gollwitzer wrote: > Am 16.09.16 um 09:01 schrieb Lawrence D’Oliveiro: > > On Friday, September 16, 2016 at 6:55:07 P

Re: why this code loop forever after a draw a rectangle

2016-09-16 Thread meInvent bbird
i follow this post to give some time it to operate, wait a long time still looping http://answers.opencv.org/question/60094/libpng-warning-image-width-is-zero-in-ihdr/ i can not stand this Ninja coding life any more, i have to open my code for ask this error import cv2 import numpy as np #from

Re: Discover all non-standard library modules imported by a script

2016-09-16 Thread Chris Angelico
On Fri, Sep 16, 2016 at 9:29 PM, Malcolm Greene wrote: > Looking for suggestions on how, given a main script, discover all the > non-standard library modules imported across all modules, eg. the > modules that other modules import, etc. I'm not looking to discover > dynamic imports or other edge c

Re: why this code loop forever after a draw a rectangle

2016-09-16 Thread Joonas Liik
On 16 September 2016 at 14:24, meInvent bbird wrote: > im = img.copy() > cntcounter = 0 > for cnt in contours: > epsilon = 0.1*cv2.arcLength(cnt,True) > approx = cv2.approxPolyDP(cnt,epsilon,True) > #peri = cv2.arcLength(cnt, True) > #approx = cv2.approxPolyDP(c, 0.

Discover all non-standard library modules imported by a script

2016-09-16 Thread Malcolm Greene
Looking for suggestions on how, given a main script, discover all the non-standard library modules imported across all modules, eg. the modules that other modules import, etc. I'm not looking to discover dynamic imports or other edge cases, just the list modules loaded via "import " and "from impo

why this code loop forever after a draw a rectangle

2016-09-16 Thread meInvent bbird
im = img.copy() cntcounter = 0 for cnt in contours: epsilon = 0.1*cv2.arcLength(cnt,True) approx = cv2.approxPolyDP(cnt,epsilon,True) #peri = cv2.arcLength(cnt, True) #approx = cv2.approxPolyDP(c, 0.5 * peri, True) #print("len(approx)="+str(len(approx)))

Re: how to automate java application in window using python

2016-09-16 Thread Christian Gollwitzer
Am 16.09.16 um 09:01 schrieb Lawrence D’Oliveiro: On Friday, September 16, 2016 at 6:55:07 PM UTC+12, meInvent bbird wrote: On Thursday, September 15, 2016 at 3:52:41 PM UTC+8, Lawrence D’Oliveiro wrote: On Thursday, September 15, 2016 at 7:13:05 PM UTC+12, meInvent bbird wrote: how to automat

Find Nested group in LDAP by this i mean group in group

2016-09-16 Thread Robert Clove
Hi, I was looking for search query in LDAP for nested group memebership. It would be great if someone can provide the python code for the same. Regards -- https://mail.python.org/mailman/listinfo/python-list

Re: Expected type 'optional[bytes]' got 'str' instead

2016-09-16 Thread Peter Otten
> Daiyue Weng wrote: [Please answer to the mailing list instead of sending private emails] > On 13 September 2016 at 12:37, Peter Otten <__pete...@web.de> wrote: >> Daiyue Weng wrote: >>> Hi, I have the following piece of code, >>> >>> rootPath = os.path.abspath(__file__) >>> >>> rootPath = (ro

Re: Requests for webbrowser module

2016-09-16 Thread Jamie Ansell
Thanks for your help, I realise that what I wanted was chromes default new tab page, not a blank page. 'about:blank' worked fine but it wasn't what I wanted sorry. I'll try the CTRL+4 later and see it that works. On 14 Sep 2016 21:11, "John Gordon" wrote: > In Jamie < > ja9...@my.bristol.ac.uk>

Re: how to automate java application in window using python

2016-09-16 Thread Lawrence D’Oliveiro
On Friday, September 16, 2016 at 6:55:07 PM UTC+12, meInvent bbird wrote: > On Thursday, September 15, 2016 at 3:52:41 PM UTC+8, Lawrence D’Oliveiro > wrote: >> On Thursday, September 15, 2016 at 7:13:05 PM UTC+12, meInvent bbird >> wrote: >>> how to automate java application in window using python

Re: how to automate java application in window using python

2016-09-16 Thread meInvent bbird
On Friday, September 16, 2016 at 2:26:47 AM UTC+8, bream...@gmail.com wrote: > On Thursday, September 15, 2016 at 8:13:05 AM UTC+1, meInvent bbird wrote: > > how to automate java application in window using python > > > > 1. scroll up or down of scroll bar > > 2. click button > > 3. type text in t