Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-04-04 Thread Mark H Harris
On 4/5/14 1:01 AM, Ben Finney wrote: Mark H Harris writes: On 4/5/14 12:02 AM, Ian Kelly wrote: A fork is undesirable because it fragments the community. I don't think "fear" or "panic" are the right words for it. Yes. I get that. So, you get that “fear” and “panic” are not the right

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-04-04 Thread Ben Finney
Mark H Harris writes: > On 4/5/14 12:02 AM, Ian Kelly wrote: > > A fork is undesirable because it fragments the community. I don't > > think "fear" or "panic" are the right words for it. > >Yes. I get that. So, you get that “fear” and “panic” are not the right words to characterise the unde

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-04-04 Thread Chris Angelico
On Sat, Apr 5, 2014 at 4:29 PM, Ben Finney wrote: > Chris Angelico writes: > >> I would suggest that the more prolific posters are going to be those >> who use Python more (and thus it's worth investing more time in), >> which is going to skew the post stats towards the professional end of >> the

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-04-04 Thread Chris Angelico
On Sat, Apr 5, 2014 at 4:23 PM, Mark H Harris wrote: > The only advantage of C++ over C is polymorphism, really. There are in my > view only three reasons to even use C++: 1) the iostream library, and 2) > polymorphism, and 3) operator overloading. If you need to do all three, then > C++ is a real

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-04-04 Thread Mark H Harris
On 4/5/14 12:02 AM, Ian Kelly wrote: A fork is undesirable because it fragments the community. I don't think "fear" or "panic" are the right words for it. Yes. I get that. I think what is desired (just thinking out loud from my own vantage point) is a unified community, but also a foundat

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-04-04 Thread Ben Finney
Chris Angelico writes: > I would suggest that the more prolific posters are going to be those > who use Python more (and thus it's worth investing more time in), > which is going to skew the post stats towards the professional end of > the spectrum. It's also plausible that the more prolific pos

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-04-04 Thread Mark H Harris
On 4/4/14 11:49 PM, Chris Angelico wrote: On Sat, Apr 5, 2014 at 3:31 PM, Mark H Harris wrote: Its has always seemed to me that Java or C++ would be better suited to creating python. I wonder will C always be the standard canonical PSF python interpreter base language? Has the C python comm

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-04-04 Thread Chris Angelico
On Sat, Apr 5, 2014 at 4:02 PM, Mark H Harris wrote: >I know its just a gut feel, and I know there are a lot of lurkers here > too, but it seems that there are *way* more folks from the professional camp > on comp.lang.python than otherwise. Do you have a gut feel for the % of > hobbyists vs.

Re: About threading.Thread

2014-04-04 Thread Chris Angelico
On Sat, Apr 5, 2014 at 4:02 PM, 张佩佩 wrote: > def fun(): > a = threading.Thread(target=hello(), name='hello') > It seems that threading.Thread() in file1 not create a new thread but use > MainThread. > Anyone can explain this ? > Thank you in advance. Suggestion: Cut the code down until

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-04-04 Thread Mark H Harris
On 4/4/14 11:40 PM, Chris Angelico wrote: If it's too much work to make the changes to move something from Python 2.7 to Python 3.3, it's *definitely* too much work to rewrite it in a different language. Totally, no doubt. There would have to be some strong other reason for shifting, espec

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-04-04 Thread Ian Kelly
On Fri, Apr 4, 2014 at 10:40 PM, Chris Angelico wrote: > On Sat, Apr 5, 2014 at 3:10 PM, Mark H Harris wrote: >> we don't want folks to be driven away from Cpython as a language, and we >> don't want them to fork the Cpython interpreter, so we'll take a very casual >> and methodically conservativ

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-04-04 Thread Mark H Harris
On 4/4/14 10:42 PM, Rustom Mody wrote: Computer-hobbyists and computer-professionals are quite different sets of people. I know its just a gut feel, and I know there are a lot of lurkers here too, but it seems that there are *way* more folks from the professional camp on comp.lang.python

About threading.Thread

2014-04-04 Thread 张佩佩
Hello guys: I have an question on threading.Thread My code is here: File1: a.py import threading import time def hello(): while True: print('hello') threads = threading.enumerate() for thread in threads: print(thread

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-04-04 Thread Ian Kelly
On Fri, Apr 4, 2014 at 10:10 PM, Mark H Harris wrote: > On 4/4/14 6:16 PM, Mark Lawrence wrote: >> >> Fear/panic of a fork, where did that come from? It's certainly the >> first I've ever heard of it. >> > > hi Mark, it came from Ian; or, my interpretation of Ian. It comes out on the > net too (f

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-04-04 Thread Chris Angelico
On Sat, Apr 5, 2014 at 3:31 PM, Mark H Harris wrote: >Its has always seemed to me that Java or C++ would be better suited to > creating python. I wonder will C always be the standard canonical PSF python > interpreter base language? Has the C python community considered making the > standard b

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-04-04 Thread Chris Angelico
On Sat, Apr 5, 2014 at 3:10 PM, Mark H Harris wrote: > we don't want folks to be driven away from Cpython as a language, and we > don't want them to fork the Cpython interpreter, so we'll take a very casual > and methodically conservative approach to nudging people towards a Cpython3 > migration r

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-04-04 Thread Mark H Harris
On 4/4/14 7:00 PM, Steven D'Aprano wrote: Berp, Brython, CLPython, CPython, CapPython, ChinesePython, Compyler, Copperhead, Cython, HoPe, HotPy, IronPython, Jython, Kivy, Mypy, Mython, Nuitka, Numba, Parakeet, Parallel Python, Perthon, Pippy, Psyco, Py4A, PyMite, PyMT, PyPad, PyPy, PyQNX, PyVM,

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-04-04 Thread Mark H Harris
On 4/4/14 10:04 PM, Terry Reedy wrote: I am a core developer and I am 99.99% sure that the core developers will not produce a CPython 2.8. For one thing we will likely do instead, see http://legacy.python.org/dev/peps/pep-0466/ Thanks Terry. The back-port sounds great; I find the "Rejected al

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-04-04 Thread Mark H Harris
On 4/4/14 6:16 PM, Mark Lawrence wrote: Fear/panic of a fork, where did that come from? It's certainly the first I've ever heard of it. hi Mark, it came from Ian; or, my interpretation of Ian. It comes out on the net too (from various places). Here is Ian's quote, then my comment: Eventua

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-04-04 Thread Terry Reedy
On 4/4/2014 11:22 PM, Chris Angelico wrote: On Sat, Apr 5, 2014 at 2:04 PM, Terry Reedy wrote: I am a core developer and I am 99.99% sure that the core developers will not produce a CPython 2.8. For one thing we will likely do instead, see http://legacy.python.org/dev/peps/pep-0466/ There's a

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-04-04 Thread Rustom Mody
On Saturday, April 5, 2014 2:28:29 AM UTC+5:30, Mark H. Harris wrote: > hi Mark, yes that's my point. I have heard rumors of python2.8? At some > point I would expect that the Cpython interpreter would 'freeze' and no > one would fix it any longer. I have a serious question, namely, why does > t

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-04-04 Thread Chris Angelico
On Sat, Apr 5, 2014 at 2:04 PM, Terry Reedy wrote: > I am a core developer and I am 99.99% sure that the core developers will not > produce a CPython 2.8. For one thing we will likely do instead, see > http://legacy.python.org/dev/peps/pep-0466/ There's also been talk of a potential compiler chan

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-04-04 Thread Terry Reedy
On 4/4/2014 6:07 PM, Mark H Harris wrote: On 4/4/14 4:50 PM, Mark Lawrence wrote: You could answer all of the above for yourself if you were to use your favourite search engine. hi Mark, yeah, condescending as that is, been there done that. Since there *are* people who use python-list as a

Re: process do not join?

2014-04-04 Thread xeon Mailinglist
This log came when I launched the command: python -m trace --trace myclass.py On Saturday, April 5, 2014 3:18:34 AM UTC+1, xeon Mailinglist wrote: > I am trying to debug my program that launch processes to run a function to > copy data between hosts located really far away from each other. The

process do not join?

2014-04-04 Thread xeon Mailinglist
I am trying to debug my program that launch processes to run a function to copy data between hosts located really far away from each other. The end of my function are in the orders.py and mergedirs.py. >From this point onwards, in is python code. The problem is that this code >hangs in the las

Re: Default mutable parameters in functions

2014-04-04 Thread Dave Angel
Dennis Lee Bieber Wrote in message: > On Fri, 04 Apr 2014 10:00:25 -0400, random...@fastmail.us declaimed the > following: > >> >>I can't imagine a language that would work that way. For one, it would >>also imply that passing a value would change the default for future >>calls even for non-mutab

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-04-04 Thread Chris Angelico
On Sat, Apr 5, 2014 at 11:00 AM, Steven D'Aprano wrote: > As I said, some of these may be abandoned, obsolete, experimental, or > even vapourware. Some are probably just ports of CPython to another > platform rather than completely independent implementations. Python for OS/2 is definitely just a

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-04-04 Thread Steven D'Aprano
On Fri, 04 Apr 2014 11:01:48 -0600, Ian Kelly wrote: > On Fri, Apr 4, 2014 at 4:08 AM, Steven D'Aprano > wrote: >> On Fri, 04 Apr 2014 02:13:13 -0600, Ian Kelly wrote: >> >>> On Fri, Apr 4, 2014 at 1:52 AM, Steven D'Aprano >>> wrote: py> from decimal import * py> getcontext().prec = 16

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-04-04 Thread Steven D'Aprano
On Fri, 04 Apr 2014 15:58:29 -0500, Mark H Harris wrote: > Oh, I have another serious question about implementations. I'm not sure > about (50) implementations, Here's a list. Which ones you count as actual implementations of Python and which are not may be a matter of opinion. (Do translators

Re: Default mutable parameters in functions

2014-04-04 Thread Roy Smith
In article , Dennis Lee Bieber wrote: > On Fri, 04 Apr 2014 10:00:25 -0400, random...@fastmail.us declaimed the > following: > > > > >I can't imagine a language that would work that way. For one, it would > >also imply that passing a value would change the default for future > >calls even for n

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-04-04 Thread Mark Lawrence
On 04/04/2014 23:52, Mark H Harris wrote: As Ian points out, you can't expect a complete migration on the PSF schedule (2->3), because of the fear|panic of a fork. So, comp.lang.python is the best place to find out where the Cpython community is, and where they expect to go (for that discussion

Re: converting strings to hex

2014-04-04 Thread Mark H Harris
On 4/4/14 5:36 PM, Chris Angelico wrote: If someone is asking for a hint, it's because s/he is trying to learn. I'm always willing to help someone learn, regardless of whether they're going through a course or currently employed or whatever. Sometimes a small hint can be obtained from the interpr

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-04-04 Thread Chris Angelico
On Sat, Apr 5, 2014 at 9:52 AM, Mark H Harris wrote: > On 4/4/14 5:39 PM, Chris Angelico wrote: >> >> Yes, because python-list responses are *so* much more reliable than >> official statements on python.org, > > > {/sarcasm off} > > ... from some responders. The discussion following such posts is

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-04-04 Thread Mark H Harris
On 4/4/14 5:39 PM, Chris Angelico wrote: Yes, because python-list responses are *so* much more reliable than official statements on python.org, {/sarcasm off} ... from some responders. The discussion following such posts is also *much* more valuable, too. IMHO Python.org is the political p

Re: Default mutable parameters in functions

2014-04-04 Thread Chris Angelico
On Sat, Apr 5, 2014 at 1:34 AM, Steven D'Aprano wrote: > But it's not hard to get that effect in Python, mutable or immutable > doesn't matter: > > > py> def spam(count, food="spam"): > ... spam.__defaults__ = (food,) > ... return food*count > ... > py> spam(5) > 'spamspamspamspamspam' > p

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-04-04 Thread Chris Angelico
On Sat, Apr 5, 2014 at 9:07 AM, Mark H Harris wrote: > On 4/4/14 4:50 PM, Mark Lawrence wrote: > >> You could answer all of the above for yourself if you were to use your >> favourite search engine. > > > hi Mark, yeah, condescending as that is, been there done that. > >Its always better to ge

Re: converting strings to hex

2014-04-04 Thread Chris Angelico
On Sat, Apr 5, 2014 at 8:33 AM, Mark H Harris wrote: > On 4/4/14 1:16 AM, James Harris wrote: >> >> YMMV but I thought the OP had done a good job before asking for help and >> then asked about only a tiny bit of it. Some just post a question! > > >Indeed they do. Its a little like negotiating

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-04-04 Thread Mark H Harris
On 4/4/14 4:50 PM, Mark Lawrence wrote: You could answer all of the above for yourself if you were to use your favourite search engine. hi Mark, yeah, condescending as that is, been there done that. See this link as just one example: http://blog.startifact.com/posts/python28-discussion-chann

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-04-04 Thread Mark Lawrence
On 04/04/2014 21:58, Mark H Harris wrote: On 4/4/14 3:20 AM, Mark Lawrence wrote: On 04/04/2014 03:29, Mark H Harris wrote: Now, about Python2. It has not died. It appears to be 'useful'. {snip} For a lot of people, if it ain't broke, don't fix it. hi Mark, yes that's my point. I h

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-04-04 Thread Ian Kelly
On Fri, Apr 4, 2014 at 2:58 PM, Mark H Harris wrote: > On 4/4/14 3:20 AM, Mark Lawrence wrote: >> >> On 04/04/2014 03:29, Mark H Harris wrote: >>> >>> >>> Now, about Python2. It has not died. It appears to be 'useful'. >>> {snip} >>> >> >> For a lot of people, if it ain't broke, don't fix it

Re: converting strings to hex

2014-04-04 Thread Mark H Harris
On 4/4/14 1:16 AM, James Harris wrote: YMMV but I thought the OP had done a good job before asking for help and then asked about only a tiny bit of it. Some just post a question! Indeed they do. Its a little like negotiating with terrorists. As soon as you negotiate with the first one, you

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-04-04 Thread Mark H Harris
On 4/4/14 3:20 AM, Mark Lawrence wrote: On 04/04/2014 03:29, Mark H Harris wrote: Now, about Python2. It has not died. It appears to be 'useful'. {snip} For a lot of people, if it ain't broke, don't fix it. hi Mark, yes that's my point. I have heard rumors of python2.8? At some poi

Re: Scoping rules for class definitions

2014-04-04 Thread Ian Kelly
On Fri, Apr 4, 2014 at 12:37 PM, Rotwang wrote: > Hi all. I thought I had a pretty good grasp of Python's scoping rules, but > today I noticed something that I don't understand. Can anyone explain to me > why this happens? > x = 'global' def f1(): > x = 'local' > class C: >

Scoping rules for class definitions

2014-04-04 Thread Rotwang
Hi all. I thought I had a pretty good grasp of Python's scoping rules, but today I noticed something that I don't understand. Can anyone explain to me why this happens? >>> x = 'global' >>> def f1(): x = 'local' class C: y = x return C.y >>> def f2(): x = 'local' cl

Re: Yet Another Switch-Case Syntax Proposal

2014-04-04 Thread Ian Kelly
On Fri, Apr 4, 2014 at 10:44 AM, Marko Rauhamaa wrote: > Consider: > > switch local_sabbath():# bad > case (1, 2, 3) as sabbath: > ... I'm not overly fond of that either. That's why I liked the OP's choice to put the first case in the switch statement. > Now Python "fram

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-04-04 Thread Ian Kelly
On Fri, Apr 4, 2014 at 4:08 AM, Steven D'Aprano wrote: > On Fri, 04 Apr 2014 02:13:13 -0600, Ian Kelly wrote: > >> On Fri, Apr 4, 2014 at 1:52 AM, Steven D'Aprano >> wrote: >>> py> from decimal import * >>> py> getcontext().prec = 16 >>> py> x = Decimal("0.77787516") py> y = >>> Decimal("

Re: Yet Another Switch-Case Syntax Proposal

2014-04-04 Thread Marko Rauhamaa
Ian Kelly : > On Apr 4, 2014 3:51 AM, "Marko Rauhamaa" wrote: >>switch: local_sabbath() >>case (1, 2, 3) as sabbath: >>... >>case 6: >>... >>else: >>... > [...] > > What's wrong with the much more natural "switch local_sabbath():"? Consider: switch lo

Re: Yet Another Switch-Case Syntax Proposal

2014-04-04 Thread Devin Jeanpierre
If one were to add switch into Python, wouldn't it be desirable to make a pattern matching switch (think the "match" or "case" construct from Haskell or ML)? Python currently has poor support for union/sum types in general, not just enumerations. It feels weird to add better support for enumeration

Re: Yet Another Switch-Case Syntax Proposal

2014-04-04 Thread Ian Kelly
On Apr 4, 2014 3:51 AM, "Marko Rauhamaa" wrote: > > >>> switch day casein ("Monday", "Thursday", "Wednesday", "Tuesday", > >>> "Friday"): > >>> gotowork = True > >>> continue > >>> casein ("Monday", "Thursday", "Wednesday", "Tuesday", "Friday"): > >>> daytype = "ferial" > >>> casein

Re: Default mutable parameters in functions

2014-04-04 Thread Steven D'Aprano
On Fri, 04 Apr 2014 10:00:25 -0400, random832 wrote: > On Thu, Apr 3, 2014, at 20:38, Mark Lawrence wrote: >> I just wish I had a quid for every time somebody expects something out >> of Python, that way I'd have retired years ago. At least here it's not >> accompanied by "as that's how it works

Jesus: an Islamic view

2014-04-04 Thread bv4bv4bv4
Jesus: an Islamic view In this pamphlet, the author shows the nature of the Prophet Jesus as Islam provides. He shows that the Prophet Jesus is a human prophet and does not have any divine nature as Christian believe. Did you know that it is obligatory for Muslims to believe in Jesus, or that

Re: Default mutable parameters in functions

2014-04-04 Thread random832
On Thu, Apr 3, 2014, at 20:38, Mark Lawrence wrote: > I just wish I had a quid for every time somebody expects something out > of Python, that way I'd have retired years ago. At least here it's not > accompanied by "as that's how it works in ". I can't imagine a language that would work that wa

CFP: MuCoCoS-2014, August, Porto, Portugal

2014-04-04 Thread SP
7th International Workshop on Multi/many-Core Computing Systems (MuCoCoS-2014) in conjunction with Euro-Par 2014 25-29 August, 2014, Porto, Portugal http://www.univie.ac.at/mucocos2014 AIMS AND SCOPE The pervasiveness

Re: segmentation fault, executable python file

2014-04-04 Thread Jurko Gospodnetić
Hi. On 4.4.2014. 11:17, Chris Angelico wrote: But from here you need someone more familiar with cxfreeze. All I can advise is to compare installed packages on each; maybe you have multiple versions of some library or something. From what little I know of it, it freezes as little as possibl

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-04-04 Thread Terry Reedy
On 4/4/2014 5:53 AM, Steven D'Aprano wrote: On Thu, 03 Apr 2014 11:38:13 -0500, Mark H Harris wrote: On 4/1/14 5:33 PM, Terry Reedy wrote: If you narrowly meant "The python interpreter only starting using unicode as the default text class in 3.0", then you are, in that narrow sense, correct.

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-04-04 Thread Rustom Mody
On Friday, April 4, 2014 3:23:31 PM UTC+5:30, Steven D'Aprano wrote: > On Thu, 03 Apr 2014 11:38:13 -0500, Mark H Harris wrote: > > > On 4/1/14 5:33 PM, Terry Reedy wrote: > > > > hi Terry, hope you are well today, despite gmane difficulties; > > > >> If you narrowly meant "The python interp

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-04-04 Thread Steven D'Aprano
On Fri, 04 Apr 2014 02:13:13 -0600, Ian Kelly wrote: > On Fri, Apr 4, 2014 at 1:52 AM, Steven D'Aprano > wrote: >> py> from decimal import * >> py> getcontext().prec = 16 >> py> x = Decimal("0.77787516") py> y = >> Decimal("0.77787518") py> (x + y) / 2 >> Decimal('0.777875

Re: converting strings to hex

2014-04-04 Thread alister
On Thu, 03 Apr 2014 21:38:38 -0500, Mark H Harris wrote: > On 4/3/14 9:10 PM, dave em wrote: >> >> I am taking a cryptography class and am having a tough time with an >> assignment similar to this. >> >> > hi Dave, if your instructor wanted you to work on this with other people > she would have ma

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-04-04 Thread Steven D'Aprano
On Thu, 03 Apr 2014 11:38:13 -0500, Mark H Harris wrote: > On 4/1/14 5:33 PM, Terry Reedy wrote: > > hi Terry, hope you are well today, despite gmane difficulties; > >> If you narrowly meant "The python interpreter only starting using >> unicode as the default text class in 3.0", then you ar

Re: Yet Another Switch-Case Syntax Proposal

2014-04-04 Thread Marko Rauhamaa
Instead of disabling fallthrough by default, why not disable it all together? >>> >>> I was tempted but there are cases in which it's useful. An example No, it is never useful, it never was. It came into being by accident, a design bug turned into an advertised feature. >>> switch day

Re: segmentation fault, executable python file

2014-04-04 Thread Chris Angelico
On Fri, Apr 4, 2014 at 8:06 PM, wrote: > the first one is ubuntu 12.04 64-bit (where i generate the executable file), > and the second one is the same. Any idea? I confused for days until today. > > Thanks for your replay That's a good start. Next thing to try is running your executable under g

Re: segmentation fault, executable python file

2014-04-04 Thread fanny
the first one is ubuntu 12.04 64-bit (where i generate the executable file), and the second one is the same. Any idea? I confused for days until today. Thanks for your replay On Friday, April 4, 2014 3:57:33 PM UTC+7, Chris Angelico wrote: > On Fri, Apr 4, 2014 at 7:36 PM, wrote: > > > Hello,

Re: segmentation fault, executable python file

2014-04-04 Thread Chris Angelico
On Fri, Apr 4, 2014 at 7:36 PM, wrote: > Hello, > I generated an executable python file using cxfreeze. > I run that file, it runs fine. > But when I run it on another PC, it don't run. I try to it via terminal, and > it says "Segmentation fault(core dump)". I try again run it with sudo, it > s

segmentation fault, executable python file

2014-04-04 Thread fanny
Hello, I generated an executable python file using cxfreeze. I run that file, it runs fine. But when I run it on another PC, it don't run. I try to it via terminal, and it says "Segmentation fault(core dump)". I try again run it with sudo, it says nothing and nothing happend. Could any of you

Re: Yet Another Switch-Case Syntax Proposal

2014-04-04 Thread Steven D'Aprano
On Thu, 03 Apr 2014 11:23:39 -0700, Ethan Furman wrote: > On 04/03/2014 09:02 AM, Lucas Malor wrote: >> >> In reply to Ian Kelly: >>> >>> Instead of disabling fallthrough by default, why not disable it all >>> together? >> >> I was tempted but there are cases in which it's useful. An example >> >>

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-04-04 Thread Mark Lawrence
On 04/04/2014 03:29, Mark H Harris wrote: Now, about Python2. It has not died. It appears to be 'useful'. The perceived reality is that Python2 is 'useful'. Or, is it as I perceive it, python2 is embedded in so many places that it must be maintained for a long time because so many code(s)

Re: converting strings to hex

2014-04-04 Thread Mark Lawrence
On 04/04/2014 04:22, dave em wrote: You haven't seen nothing yet, wait till M.L. catches you on the flip side for using gg. {running for cover} Who is ML? Good morning :) -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-04-04 Thread Ian Kelly
On Fri, Apr 4, 2014 at 1:52 AM, Steven D'Aprano wrote: > py> from decimal import * > py> getcontext().prec = 16 > py> x = Decimal("0.77787516") > py> y = Decimal("0.77787518") > py> (x + y) / 2 > Decimal('0.77787515') > > "Guido, why can't Python do maths???" Well, you nee

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-04-04 Thread Chris Angelico
On Fri, Apr 4, 2014 at 6:52 PM, Steven D'Aprano wrote: > py> x = Decimal("0.77787516") > py> y = Decimal("0.77787518") > py> (x + y) / 2 > Decimal('0.77787515') > > I've changed my mind about Python using Decimal as the default numeric > type. I think that would send a very

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-04-04 Thread Steven D'Aprano
On Fri, 04 Apr 2014 09:43:15 +1100, Chris Angelico wrote: > While I am interested in seeing a Decimal literal syntax in Python, and > I would support a shift to have "1.2" evaluate as a Decimal (but not > soon - it'd break backward compat *hugely*) I used to think the same thing, but have since l

Re: Yet Another Switch-Case Syntax Proposal

2014-04-04 Thread Steven D'Aprano
On Thu, 03 Apr 2014 15:11:38 -0400, Terry Reedy wrote: > On 4/3/2014 12:02 PM, Lucas Malor wrote: > >>> A more suitable place to propose this would be the python-ideas >>> mailing list. >> >> You're right. I posted here because this list was linked by PEP 1. But >> now that I read more there's al

Re: Unicode Chars in Windows Path

2014-04-04 Thread Lele Gaifax
Steven D'Aprano writes: > When working with Windows paths, you should make a habit of either > escaping every backslash: > > u"c:\\automation_common\\Python\\TestCases\\list_dir_script.txt" > > using a raw-string: > > ur"c:\automation_common\Python\TestCases\list_dir_script.txt" > > or j