On Sat, 5 Aug 2017 06:17 am, Terry Reedy wrote:
[...]
> With 53 binary digits, all counts from 0 to 2**53 - 1 are exactly
> represented with a exponent of 0, 2**53 = 2**52 * 2, so it is exactly
> represented with an exponent of 1. Many other higher counts can be
> exactly represented with various
Am 05.08.17 um 01:45 schrieb Ulli Horlacher:
I have to transfer a python 2.7 CLI programm into one with a (simple) GUI.
The program must run on Linux and Windows and must be compilable with
pyinstall, because I have to ship a standalone windows.exe
Any kind of installer is not acceptable.
TkInt
On Saturday, August 5, 2017 at 6:55:09 AM UTC+5:30, Steve D'Aprano wrote:
> On Sat, 5 Aug 2017 12:43 pm, Ode Idoko wrote:
>
> > Can anyone help with the python code that can add 101, 102, 103...2033
> > please?
>
>
> Sounds like homework. Here are some hints for you to play around with and see
Iranna Mathapati writes:
> How to grep values from below out put string.
>
> pattern should include "Fabric Module".
One possible way would be to use a regular expression --
see the documentation for the "re" module.
--
https://mail.python.org/mailman/listinfo/python-list
Ho Yeung Lee writes:
> actually i am using python's kmeans library. it is relevant in python
I agree that it was not bad to ask the question here.
However, the provided answer (apart from the "off topic" -- i.e.
the reference to
"https://en.wikipedia.org/wiki/Determining_the_number_of_clusters_
On 08/04/2017 07:46 PM, Chris Angelico wrote:
On Sat, Aug 5, 2017 at 12:42 PM, Ethan Furman wrote:
pip freeze
will output a list of current packages and their requirements. I have one
package that falsely [1] lists another package as a requirement, which was
blocking installation as the f
On Sat, Aug 5, 2017 at 12:42 PM, Ethan Furman wrote:
> pip freeze
>
> will output a list of current packages and their requirements. I have one
> package that falsely [1] lists another package as a requirement, which was
> blocking installation as the false requirement wasn't available.
>
> Is
pip freeze
will output a list of current packages and their requirements. I have one package that falsely [1] lists another
package as a requirement, which was blocking installation as the false requirement wasn't available.
Is there a way to modify that output (which would be piped to, for
On 8/4/2017 7:11 PM, Jon Forrest wrote:
Consider the following Python shell session (Python 3.6.2, Win64):
>>> def givemetwo():
... x = 'two'
... print(id(x))
...
>>> givemetwo()
1578505988392
So far fine. My understanding of object existence made me
think that the object refe
On Sat, 5 Aug 2017 12:43 pm, Ode Idoko wrote:
> Can anyone help with the python code that can add 101, 102, 103...2033 please?
Sounds like homework. Here are some hints for you to play around with and see if
you can get the right answer:
sum([101, 102, 103])
range(101, 104)
sum(range(1, 4))
On Sat, 5 Aug 2017 09:11 am, Jon Forrest wrote:
> Consider the following Python shell session (Python 3.6.2, Win64):
>
> >>> def givemetwo():
> ... x = 'two'
> ... print(id(x))
> ...
> >>> givemetwo()
> 1578505988392
>
> So far fine. My understanding of object existence made me
On 08/04/2017 05:45 PM, Ulli Horlacher wrote:
> I have to transfer a python 2.7 CLI programm into one with a (simple) GUI.
> The program must run on Linux and Windows and must be compilable with
> pyinstall, because I have to ship a standalone windows.exe
> Any kind of installer is not acceptable.
On Sat, Aug 5, 2017 at 9:47 AM, Jon Forrest wrote:
> Perhaps the reason the variable isn't destroyed is
> shown by the following (again, in the same session):
>
import sys
sys.getrefcount(1578505988392)
> 3
>
> So, maybe it's not destroyed because there are still
> references to it. But,
On Sat, Aug 5, 2017 at 9:42 AM, Jon Forrest wrote:
> On 8/4/2017 4:34 PM, gst wrote:
>>
>> 'two' is a so called constant or literal value .. (of that
>> function).
>>
>> Why not attach it, as a const value/object, to the function itself ?
>> So that a new string object has not to be created each t
Perhaps the reason the variable isn't destroyed is
shown by the following (again, in the same session):
>>> import sys
>>> sys.getrefcount(1578505988392)
3
So, maybe it's not destroyed because there are still
references to it. But, what are these references?
Will the reference count ever go to z
I have to transfer a python 2.7 CLI programm into one with a (simple) GUI.
The program must run on Linux and Windows and must be compilable with
pyinstall, because I have to ship a standalone windows.exe
Any kind of installer is not acceptable.
Reading https://github.com/pyinstaller/pyinstaller/wi
On 8/4/2017 4:34 PM, gst wrote:
'two' is a so called constant or literal value .. (of that
function).
Why not attach it, as a const value/object, to the function itself ?
So that a new string object has not to be created each time the
function is called. Because anyway strings are immutable. So
'two' is a so called constant or literal value .. (of that function).
Why not attach it, as a const value/object, to the function itself ? So that a
new string object has not to be created each time the function is called.
Because anyway strings are immutable. So what would be the point to recre
Consider the following Python shell session (Python 3.6.2, Win64):
>>> def givemetwo():
... x = 'two'
... print(id(x))
...
>>> givemetwo()
1578505988392
So far fine. My understanding of object existence made me
think that the object referred to by x would be deleted when
the give
Lele Gaifax :
> leam hall writes:
>
>> Tracked down the GitHub repo (https://github.com/yaml/pyyaml) and it seems
>> to be gearing back up. I'll see what I can do to help.
>
> See also https://bitbucket.org/ruamel/yaml, a fork of PyYAML, it seems more
> actively maintained and already supports fo
On Aug 4, 2017 5:27 PM, "Ode Idoko via Python-list"
wrote:
>
> Can anyone help with the python code that can add 101, 102, 103...2033
please?
We are here to help but we don't have crystal balls to interpret your
request.
The best thing you can do is show us what attempts you have made to write
c
Can anyone help with the python code that can add 101, 102, 103...2033 please?
As I said before, I'm new to python and need assistance in this regard.
Thanks for always assisting.
Sent from my iPhone
--
https://mail.python.org/mailman/listinfo/python-list
leam hall writes:
> Tracked down the GitHub repo (https://github.com/yaml/pyyaml) and it seems
> to be gearing back up. I'll see what I can do to help.
See also https://bitbucket.org/ruamel/yaml, a fork of PyYAML, it seems more
actively maintained and already supports format 1.2.
ciao, lele.
--
On 8/4/2017 11:44 AM, Chris Angelico wrote:
On Sat, Aug 5, 2017 at 12:51 AM, Steve D'Aprano
wrote:
def isqrt_float(n):
"""Integer square root using floating point sqrt."""
return int(math.sqrt(n))
The operations in the integer version are well-defined and so the answer
should be th
On Sat, 5 Aug 2017 02:00 am, Ian Kelly wrote:
> On Fri, Aug 4, 2017 at 9:47 AM, Chris Angelico wrote:
>> On Sat, Aug 5, 2017 at 1:44 AM, Chris Angelico wrote:
>>> That gave me this result almost instantaneously:
>>>
>>> 4503599761588224
>>>
>>> which has been rounded up instead of down. I don't
On Fri, Aug 4, 2017 at 10:03 AM, Ian Kelly wrote:
> On Fri, Aug 4, 2017 at 10:00 AM, Ian Kelly wrote:
>> On Fri, Aug 4, 2017 at 9:47 AM, Chris Angelico wrote:
>>> On Sat, Aug 5, 2017 at 1:44 AM, Chris Angelico wrote:
That gave me this result almost instantaneously:
45035997615882
On Sat, Aug 5, 2017 at 4:03 AM, Ian Kelly wrote:
> On Fri, Aug 4, 2017 at 11:59 AM, Ian Kelly wrote:
>> On Fri, Aug 4, 2017 at 11:50 AM, Chris Angelico wrote:
>>> My logic was that floating point rounding is easiest to notice when
>>> you're working with a number that's very close to something,
On Sat, Aug 5, 2017 at 3:51 AM, Steve D'Aprano
wrote:
> On Sat, 5 Aug 2017 02:31 am, MRAB wrote:
>
>> Why would isqrt_float not give the correct answer? Probably because of
>> truncation (or rounding up?) of the floating point. I'd expect it to
>> fail first near a square.
>
> Assuming your math.s
On Sat, 5 Aug 2017 01:44 am, Chris Angelico wrote:
> Hmm. Thinking aloud a bit here. We know that isqrt_float(n) is not
> technically *exact* for any n that is not a square.
I got bogged down in answering that misapprehension, but it may not actually
have mattered. You then said:
> So what I'd
On Fri, Aug 4, 2017 at 11:59 AM, Ian Kelly wrote:
> On Fri, Aug 4, 2017 at 11:50 AM, Chris Angelico wrote:
>> My logic was that floating point rounding is easiest to notice when
>> you're working with a number that's very close to something, and since
>> we're working with square roots, "somethin
On Fri, Aug 4, 2017 at 11:50 AM, Chris Angelico wrote:
> My logic was that floating point rounding is easiest to notice when
> you're working with a number that's very close to something, and since
> we're working with square roots, "something" should be a perfect
> square. The integer square root
On Fri, Aug 4, 2017 at 11:44 AM, Steve D'Aprano
wrote:
> On Sat, 5 Aug 2017 01:47 am, Ian Kelly wrote:
>
>> Here's a much smaller upper bound:
>>
> n = 2 ** 53
> s = isqrt_newton(n)
> n
>> 9007199254740992
> s
>> 94906265
> m = (s+1)**2 - 1
> m
>> 9007199326062755
> isq
On Sat, 5 Aug 2017 02:31 am, MRAB wrote:
> Why would isqrt_float not give the correct answer? Probably because of
> truncation (or rounding up?) of the floating point. I'd expect it to
> fail first near a square.
Assuming your math.sqrt() is an IEEE-754 correctly-rounded square root, and that
int
On Sat, Aug 5, 2017 at 3:44 AM, Steve D'Aprano
wrote:
> On Sat, 5 Aug 2017 01:47 am, Ian Kelly wrote:
>
>> Here's a much smaller upper bound:
>>
> n = 2 ** 53
> s = isqrt_newton(n)
> n
>> 9007199254740992
> s
>> 94906265
> m = (s+1)**2 - 1
> m
>> 9007199326062755
> isqr
On Sat, Aug 5, 2017 at 3:37 AM, Steve D'Aprano
wrote:
> On Sat, 5 Aug 2017 01:44 am, Chris Angelico wrote:
>
>> On Sat, Aug 5, 2017 at 12:51 AM, Steve D'Aprano
>> wrote:
>>> def isqrt_float(n):
>>> """Integer square root using floating point sqrt."""
>>> return int(math.sqrt(n))
> [...]
>
On Sat, 5 Aug 2017 01:47 am, Ian Kelly wrote:
> Here's a much smaller upper bound:
>
n = 2 ** 53
s = isqrt_newton(n)
n
> 9007199254740992
s
> 94906265
m = (s+1)**2 - 1
m
> 9007199326062755
isqrt_newton(m) == isqrt_float(m)
> False
Oooh, interesting. How did you
On Sat, 5 Aug 2017 01:44 am, Chris Angelico wrote:
> On Sat, Aug 5, 2017 at 12:51 AM, Steve D'Aprano
> wrote:
>> def isqrt_float(n):
>> """Integer square root using floating point sqrt."""
>> return int(math.sqrt(n))
[...]
> Hmm. Thinking aloud a bit here. We know that isqrt_float(n) is
Does anyone have a really basic cython example where you create a dataframe
(pandas) of random numbers 1 to 5 for 100 rows and cythonize the code? Is it
already cythonized by the Pandas pd module?
--
https://mail.python.org/mailman/listinfo/python-list
On 2017-08-04 17:11, Robin Becker wrote:
> On 04/08/2017 15:12, Irmen de Jong wrote:
>> On 04/08/2017 15:44, Robin Becker wrote:
> ..
>> You can specify a CAcert using load_verify_locations on the ssl
>> context. Is that what
>> you meant? I figured out that if you set that to the peer's
>>
On 2017-08-04 15:51, Steve D'Aprano wrote:
This is a challenge for which I don't have a complete answer, only a partial
answer.
Here are two functions for calculating the integer square root of a non-negative
int argument. The first is known to be exact but may be a bit slow:
def isqrt_newton(n
On Fri, Aug 4, 2017 at 11:52 AM, Skip Montanaro
wrote:
> > Getting in to Ansible and back into Python. Ansible uses pyyaml which
> says
> > it parses yaml version 1.1. Is there a reason it doesn't do yaml version
> > 1.2?
>
> Nobody's done the work? Note that on the PyPI page:
>
> https://pypi.py
On Fri, Aug 4, 2017 at 9:47 AM, Chris Angelico wrote:
> On Sat, Aug 5, 2017 at 1:44 AM, Chris Angelico wrote:
>> That gave me this result almost instantaneously:
>>
>> 4503599761588224
>>
>> which has been rounded up instead of down. I don't know if that counts
>> as sufficiently wrong?
>
> Oh, a
On Fri, Aug 4, 2017 at 10:00 AM, Ian Kelly wrote:
> On Fri, Aug 4, 2017 at 9:47 AM, Chris Angelico wrote:
>> On Sat, Aug 5, 2017 at 1:44 AM, Chris Angelico wrote:
>>> That gave me this result almost instantaneously:
>>>
>>> 4503599761588224
>>>
>>> which has been rounded up instead of down. I do
Well I tried a handomatic binary search and this number seems to differ
33347481357698898183343210233857L
whereas this does not
33347481357698898183343210233856L
On 04/08/2017 15:51, Steve D'Aprano wrote:
This is a challenge for which I don't have a complete answer, only a partial
answer.
> Getting in to Ansible and back into Python. Ansible uses pyyaml which says
> it parses yaml version 1.1. Is there a reason it doesn't do yaml version
> 1.2?
Nobody's done the work? Note that on the PyPI page:
https://pypi.python.org/pypi/PyYAML
the last release was almost a year ago. That said
On Fri, Aug 4, 2017 at 8:51 AM, Steve D'Aprano
wrote:
> This is a challenge for which I don't have a complete answer, only a partial
> answer.
>
> Here are two functions for calculating the integer square root of a
> non-negative
> int argument. The first is known to be exact but may be a bit slo
On 04/08/17 15:51, Steve D'Aprano wrote:
Another hint: if you run this code:
for i in range(53, 1024):
n = 2**i
if isqrt_newton(n) != isqrt_float(n):
print(n)
break
you can find a much better upper bound for M:
2**53 < M <= 2**105
which is considerable small
On Sat, Aug 5, 2017 at 1:44 AM, Chris Angelico wrote:
> That gave me this result almost instantaneously:
>
> 4503599761588224
>
> which has been rounded up instead of down. I don't know if that counts
> as sufficiently wrong?
Oh, and I forgot to say: I have no actual *proof* that this is the
lowe
On Sat, Aug 5, 2017 at 12:51 AM, Steve D'Aprano
wrote:
> def isqrt_float(n):
> """Integer square root using floating point sqrt."""
> return int(math.sqrt(n))
>
>
>
> We know that:
>
> - for n <= 2**53, isqrt_float(n) is exact;
>
> - for n >= 2**1024, isqrt_float(n) will raise OverflowErro
Getting in to Ansible and back into Python. Ansible uses pyyaml which says
it parses yaml version 1.1. Is there a reason it doesn't do yaml version
1.2?
Thanks!
Leam
--
https://mail.python.org/mailman/listinfo/python-list
On 04/08/2017 15:12, Irmen de Jong wrote:
On 04/08/2017 15:44, Robin Becker wrote:
..
You can specify a CAcert using load_verify_locations on the ssl context. Is
that what
you meant? I figured out that if you set that to the peer's certificate it will
then be
yes I think so. Certain
This is a challenge for which I don't have a complete answer, only a partial
answer.
Here are two functions for calculating the integer square root of a non-negative
int argument. The first is known to be exact but may be a bit slow:
def isqrt_newton(n):
"""Integer sqrt using Newton's Method.
On Friday, August 4, 2017 at 10:08:56 PM UTC+8, Ho Yeung Lee wrote:
> i had changed to use kmeans
>
> https://gist.github.com/hoyeunglee/2475391ad554e3d2b2a40ec24ab47940
>
> i do not know whether write it correctly
> but it seems can cluster to find words in window, but not perfect
>
>
> On Wed
On Wednesday, August 2, 2017 at 5:25:21 AM UTC+8, Piet van Oostrum wrote:
> Ho Yeung Lee writes:
>
> > which function should be used for this problem?
> >
> I think it is a kind if clustering, or a connectivity problem. There are
> special algorithms for that, not just a simple function. Maybe s
On 08/04/2017 01:52 AM, Peter Otten wrote:
> It looks like Python is fairly competetive:
>
> $ wc -l hugequote.txt
> 100 hugequote.txt612250
> $ cat unquote.py
> import csv
>
> with open("hugequote.txt") as instream:
> for field, in csv.reader(instream):
> print(field)
>
> $
i use number of clusters = 120
https://drive.google.com/file/d/0Bxs_ao6uuBDUZFByNVgzd0Jrdm8/view?usp=sharing
seems better, but still has a long distance to be perfect
On Friday, August 4, 2017 at 10:09:59 PM UTC+8, Ho Yeung Lee wrote:
> actually i am using python's kmeans library. it is relevant
On 04/08/2017 15:44, Robin Becker wrote:
> ..
>>
>> Hi Robin
>>
>> I am not sure how this is any benefit over the self-signed root certs that I
>> now use?
>>
>> Except for the fact that these are a root cert as well and don't use any CA
>> trust chain.
>> To be able to validate this cert
actually i am using python's kmeans library. it is relevant in python
i had changed to use kmeans
https://gist.github.com/hoyeunglee/2475391ad554e3d2b2a40ec24ab47940
i do not know whether write it correctly
but it seems can cluster to find words in window, but not perfect
On Friday, August 4,
i had changed to use kmeans
https://gist.github.com/hoyeunglee/2475391ad554e3d2b2a40ec24ab47940
i do not know whether write it correctly
but it seems can cluster to find words in window, but not perfect
On Wednesday, August 2, 2017 at 3:06:40 PM UTC+8, Peter Otten wrote:
> Glenn Linderman wrote
On 2017-08-04, Peter Otten <__pete...@web.de> wrote:
> What we won't do is write a program for you ready to present to your
> teacher.
Or if we do, it will be subtly sabotaged in a manner that will make it
obvious to an experienced Python programmer that you didn't write it.
My favorite is to u
..
Hi Robin
I am not sure how this is any benefit over the self-signed root certs that I
now use?
Except for the fact that these are a root cert as well and don't use any CA
trust chain.
To be able to validate this cert, I have to load it as a CA cert on the
validating side.
Which i
On 03/08/2017 20:30, Irmen de Jong wrote:
> Alternatively, is there a cheap way to get an 'official' SSL certificate for
> testing
> purposes. I don't think letsencrypt can help here because it is only for web
> sites?
> (and their certs are only valid for a very short period)
With some host f
On Fri, 4 Aug 2017 10:33 pm, Iranna Mathapati wrote:
> Hi Team,
>
> How to grep values from below out put string.
>
> pattern should include "Fabric Module".
>
> grepping Fabric module values only
>
> str = '''
> 22 0Fabric Module J8N-C9508-FM ok
> 24
Hi Team,
How to grep values from below out put string.
pattern should include "Fabric Module".
grepping Fabric module values only
str = '''
22 0Fabric Module J8N-C9508-FM ok
24 0Fabric ModuleJ8N-C9508-FM ok
26 0
Ho Yeung Lee writes:
> i find kmeans has to input number of cluster
[...]
https://en.wikipedia.org/wiki/Determining_the_number_of_clusters_in_a_data_set
Completely off-topic on this group/list, please direct your questions
elsewhere.
-- Alain.
--
https://mail.python.org/mailman/listinfo/pytho
i find kmeans has to input number of cluster
but i do not know how many words in photo before recognization in application
of robots vision recognition
if separate high, will it become letters instead of word?
from pylab import plot,show
from numpy import vstack,array
from numpy.random import r
a écrit dans le message de
news:f705c092-de18-4c37-bde1-42316e8de...@googlegroups.com...
On Friday, August 4, 2017 at 12:27:02 PM UTC+3, ast wrote:
a écrit dans le message de
news:b6cc4ee5-71be-4550-be3e-59ebeee7a...@googlegroups.com...
thanks man! that works
I hope it is not a school h
On Fri, 4 Aug 2017 06:21 pm, Ben Finney wrote about the unbinding of exception
variable on leaving the except block:
> I think this is a terrible idea.
I agree it is a terrible idea. I'd go so far as to say it is the worst possible
way for dealing with the program of exception reference loops, e
On 04/08/2017 10:26, Robin Becker wrote:
> On 03/08/2017 19:30, Irmen de Jong wrote:
> .
>>
>> I wonder if any current (or new) users of Pyro4 want to check this out? The
>> biggest
>> concern I have is that I only have dummy (self-signed) certificates so I
>> can't test it
>> with "real"
On Friday, August 4, 2017 at 12:27:02 PM UTC+3, ast wrote:
> a écrit dans le message de
> news:b6cc4ee5-71be-4550-be3e-59ebeee7a...@googlegroups.com...
> > Hi, I'm new to thing forum and to this programming in python!
> >
> > can someone help me and write me how to write a program that do:
> > -
Peter Otten wrote:
> What we won't do is write a program for you ready to present to your
> teacher.
I should have known better :(
--
https://mail.python.org/mailman/listinfo/python-list
alon.naj...@gmail.com wrote:
> Hi, I'm new to thing forum and to this programming in python!
>
> can someone help me and write me how to write a program that do:
> - search for a string in certain text file and if it founds the string it
> delete the file? and print something?
Programming is mos
"Ben Finney" a écrit dans le message de
news:mailman.55.1501834898.28999.python-l...@python.org...
"ast" writes:
Ok, ty
--
https://mail.python.org/mailman/listinfo/python-list
a écrit dans le message de
news:b6cc4ee5-71be-4550-be3e-59ebeee7a...@googlegroups.com...
Hi, I'm new to thing forum and to this programming in python!
can someone help me and write me how to write a program that do:
- search for a string in certain text file and if it founds the string it del
On 03/08/2017 19:30, Irmen de Jong wrote:
.
I wonder if any current (or new) users of Pyro4 want to check this out? The
biggest
concern I have is that I only have dummy (self-signed) certificates so I can't
test it
with "real" certs to see if the validation works correctly.
..
I'
"ast" writes:
> Why variable ex doesn't exist ?
Because of a deliberate decision made to delete it. Silently.
This is documented:
When an exception has been assigned using as target, it is cleared
at the end of the except clause. This is as if
except E as N:
foo
Hi, I'm new to thing forum and to this programming in python!
can someone help me and write me how to write a program that do:
- search for a string in certain text file and if it founds the string it
delete the file? and print something?
thanks.
--
https://mail.python.org/mailman/listinfo/pyth
Hello
try:
a = 1 / 0
except ZeroDivisionError as ex:
pass
ex
Traceback (most recent call last):
File "", line 1, in
ex
NameError: name 'ex' is not defined
Why variable ex doesn't exist ?
--
https://mail.python.org/mailman/listinfo/python-list
78 matches
Mail list logo