Re: My backwards logic

2014-09-06 Thread Mark Lawrence
This is top posted and makes it extremely difficult to follow long threads with many replies. This is heavily frowned upon here. On 06/09/2014 02:54, Juan Christian wrote: @Mark Lawrence: Sorry to ask, but what do you mean by "don't top post here, thanks.", I'm not familiar with mailing lists,

Re: My backwards logic

2014-09-06 Thread Denis McMahon
On Fri, 05 Sep 2014 12:48:56 -0400, Seymore4Head wrote: > But, what this instructions want printed is "This is a prime number" > So how to I use this code logic NOT print (not prime) and have the logic > print "This number is prime" This is an algorithmic question, not a python question, so the a

Re: Posting style: interleaved responses

2014-09-06 Thread Mark Lawrence
On 06/09/2014 05:04, Zachary Ware wrote: It's at least a step up from a certain other Google interface to this list, and I think I speak for everyone in saying "thank you for being willing to learn proper etiquette" :) +1 :) -- My fellow Pythonistas, ask not what our language can do for you,

[OT?]cpython pull from hg

2014-09-06 Thread Mark Lawrence
The following doesn't make any sense to me as I've very limited knowledge of Mercurial so can someone explain why it says "added 12 changesets with 26 changes to 22 files" but then "3 files updated, 0 files merged, 0 files removed, 0 files unresolved". I'd expect to see 22 files updated. The

Re: How to turn a string into a list of integers?

2014-09-06 Thread Peter Otten
Steven D'Aprano wrote: > import sys > sys.getdefaultencoding() >> 'ascii' > > That's technically known as a "lie", since if it were *really* ASCII it > would refuse to deal with characters with the high-bit set. But it > doesn't, it treats them in an unpredictable and implementation-depen

Re: [OT?]cpython pull from hg

2014-09-06 Thread Peter Otten
Mark Lawrence wrote: > The following doesn't make any sense to me as I've very limited > knowledge of Mercurial so can someone explain why it says "added 12 > changesets with 26 changes to 22 files" but then "3 files updated, 0 > files merged, 0 files removed, 0 files unresolved". I'd expect to s

Re: [OT?]cpython pull from hg

2014-09-06 Thread Terry Reedy
On 9/6/2014 4:42 AM, Peter Otten wrote: Mark Lawrence wrote: The following doesn't make any sense to me as I've very limited knowledge of Mercurial so can someone explain why it says "added 12 changesets with 26 changes to 22 files" but then "3 files updated, 0 files merged, 0 files removed, 0

Prime testing [was Re: My backwards logic]

2014-09-06 Thread Steven D'Aprano
Denis McMahon wrote: > Note also that when searching for factors of a number n, and starting at > 2, you can generally stop at somewhere around n/3, The largest factor of N you actually need to check is sqrt(n). Every factor of n below the square root has a corresponding factor above it, e.g. if

Re: Prime testing [was Re: My backwards logic]

2014-09-06 Thread Chris Angelico
On Sat, Sep 6, 2014 at 8:38 PM, Steven D'Aprano wrote: > 3, 5, 7, 9 is a waste of time, 11, 13, 15 is a waste of time, ... I love this sequence. ChrisA -- https://mail.python.org/mailman/listinfo/python-list

Re: How to turn a string into a list of integers?

2014-09-06 Thread Steven D'Aprano
Peter Otten wrote: > Steven D'Aprano wrote: > >> import sys >> sys.getdefaultencoding() >>> 'ascii' >> >> That's technically known as a "lie", since if it were *really* ASCII it >> would refuse to deal with characters with the high-bit set. But it >> doesn't, it treats them in an unpredi

Re: How to turn a string into a list of integers?

2014-09-06 Thread Kurt Mueller
Am 06.09.2014 um 07:47 schrieb Steven D'Aprano : > Kurt Mueller wrote: >> Could someone please explain the following behavior to me: >> Python 2.7.7, MacOS 10.9 Mavericks [snip] Thanks for the detailed explanation. I think I understand a bit better now. Now the part of the two Python builds is

Re: How to turn a string into a list of integers?

2014-09-06 Thread Chris Angelico
On Sat, Sep 6, 2014 at 10:15 PM, Kurt Mueller wrote: > I understand: narrow build is UCS2, wide build is UCS4 > - In a UCS2 build each character of an Unicode string uses 16 Bits and has > code points from U-..U- (0..65535) > - In a UCS4 build each character of an Unicode string uses 32

Re: comparing alternatives to py2exe

2014-09-06 Thread daniel . e . rossy
I found this: https://pypi.python.org/pypi/py2exe/0.9.2.0 Also, thanks for the spreadsheet, it's very useful. -- https://mail.python.org/mailman/listinfo/python-list

__qualname__ in python 3.3

2014-09-06 Thread ISE Development
Hi, When a class is defined within a function, the class generation function's '__qualname__' attrbute is not qualified a name. For instance: def test(): class T: def method(self): pass t = T() t.method() When tracing a call to 'test()' u

Re: Storing instances using jsonpickle

2014-09-06 Thread MRAB
On 2014-09-06 01:20, Chris Angelico wrote: On Sat, Sep 6, 2014 at 3:04 AM, MRAB wrote: JSON has 'true' and 'false'. Python has 'True' and 'False'. Therefore, if you want it to be able to drop it into Python's REPL, it won't be compatible with JSON anyway! (Well, not unless you define 'true' a

Re: __qualname__ in python 3.3

2014-09-06 Thread Peter Otten
ISE Development wrote: > Hi, > > When a class is defined within a function, the class generation function's > '__qualname__' attrbute is not qualified a name. > > For instance: > > def test(): > class T: > def method(self): > pass > t = T() >

Re: Storing instances using jsonpickle

2014-09-06 Thread Ned Batchelder
On 9/6/14 12:32 PM, MRAB wrote: On 2014-09-06 01:20, Chris Angelico wrote: On Sat, Sep 6, 2014 at 3:04 AM, MRAB wrote: JSON has 'true' and 'false'. Python has 'True' and 'False'. Therefore, if you want it to be able to drop it into Python's REPL, it won't be compatible with JSON anyway! (Wel

Re: __qualname__ in python 3.3

2014-09-06 Thread ISE Development
Peter Otten wrote: > ISE Development wrote: > >> Hi, >> >> When a class is defined within a function, the class generation >> function's '__qualname__' attrbute is not qualified a name. >> >> For instance: >> >> def test(): >> class T: >> def method(self): >>

Re: Prime testing [was Re: My backwards logic]

2014-09-06 Thread Manolo Martínez
On 09/06/14 at 08:38pm, Steven D'Aprano wrote: > But even that's not how the specialists do it. If you want to check whether > (say) 2**3000+1 is prime, you don't want to use trial division at all... When I was interested in these things, specialists would use the [number field sieve](https://en.w

Re: urllib2 redirect error

2014-09-06 Thread Sumit Ray
Steven, Thank you! User advice was on point. Sumit On Tue, Sep 2, 2014 at 11:29 PM, dieter wrote: > Steven D'Aprano writes: > > ... > > I'm not an expert, but that sounds like a fault at the server end. I just > > tried it in Chrome, and it worked, and then with wget, and I get the same > >

Re: __qualname__ in python 3.3

2014-09-06 Thread Peter Otten
ISE Development wrote: > Peter Otten wrote: > >> ISE Development wrote: >> >>> Hi, >>> >>> When a class is defined within a function, the class generation >>> function's '__qualname__' attrbute is not qualified a name. >>> >>> For instance: >>> >>> def test(): >>> class T: >>>

Re: How to turn a string into a list of integers?

2014-09-06 Thread Steven D'Aprano
Kurt Mueller wrote: [...] > Now the part of the two Python builds is still somewhat unclear to me. [...] > In Python 2.7: > > As I learned from the ord() manual: > If a unicode argument is given and Python was built with UCS2 Unicode, Where does the manual mention UCS-2? As far as I know, no ver

Re: Storing instances using jsonpickle

2014-09-06 Thread Terry Reedy
On 9/6/2014 12:32 PM, MRAB wrote: On 2014-09-06 01:20, Chris Angelico wrote: On Sat, Sep 6, 2014 at 3:04 AM, MRAB wrote: JSON has 'true' and 'false'. Python has 'True' and 'False'. Therefore, if you want it to be able to drop it into Python's REPL, it won't be compatible with JSON anyway! (W

Re: ANN: binario - simple work with binary files

2014-09-06 Thread Tim Roberts
Rustom Mody wrote: >On Tuesday, September 2, 2014 6:05:19 AM UTC+5:30, Tim Roberts wrote: >> Rustom Mody wrote: > >> >On Tuesday, August 26, 2014 6:58:42 AM UTC+5:30, Tim Roberts wrote: > >> >> To the equivalent code with struct: >> >> import struct >> >> dscrp = "H?fs5B" >> >> f = open('fi

Re: How to turn a string into a list of integers?

2014-09-06 Thread Kurt Mueller
Am 06.09.2014 um 20:19 schrieb Steven D'Aprano : > Kurt Mueller wrote: > [...] >> Now the part of the two Python builds is still somewhat unclear to me. > [...] >> In Python 2.7: >> As I learned from the ord() manual: >> If a unicode argument is given and Python was built with UCS2 Unicode, > Wher

[ANN] pyspread 0.3.3

2014-09-06 Thread Martin Manns
== pyspread 0.3.3 == Pyspread 0.3.3 is released. This is a wxPython 3.x related bugfix release that fixes a segfault when initially creating and choosing GPG keys. About pyspread == Pyspread is a non-traditional spreadsheet application that is based on and

Re: How to turn a string into a list of integers?

2014-09-06 Thread Steven D'Aprano
Kurt Mueller wrote: > Processing any Unicode string will work with small and wide > python 2.7 builds and also with python >3.3? > ( parts of small build python will not work with values over 0x ) > ( strings with surrogate pairs will not work correctly on small build > python ) If you limit

pip install PyOpenGL have problem

2014-09-06 Thread วรรณพงษ์ ภัททิยไพบูลย์
I using Windows 8.1 64 Bit. Python 3.4.1 32 Bit. I want to install the PyOpenGL. By http://pyopengl.sourceforge.net/. pip install PyOpenGL have problem I using pip but have problem. pip Log https://gist.github.com/wannaphongcom/aa037e92368b61495be6 -- https://mail.python.org/mailman/listinfo/p

Re: pip install PyOpenGL have problem

2014-09-06 Thread วรรณพงษ์ ภัททิยไพบูลย์
เมื่อ วันอาทิตย์ที่ 7 กันยายน ค.ศ. 2014, 12 นาฬิกา 8 นาที 34 วินาที UTC+7, วรรณพงษ์ ภัททิยไพบูลย์ เขียนว่า: > I using Windows 8.1 64 Bit. Python 3.4.1 32 Bit. > > I want to install the PyOpenGL. By http://pyopengl.sourceforge.net/. > > > > pip install PyOpenGL have problem > > > > I using