locale.getlocale() in cmd.exe vs. Idle

2014-11-10 Thread Albert-Jan Roskam
Hi, Why do I get different output for locale.getlocale() in Idle vs. cmd.exe? # IDLE Python 2.7.1 (r271:86832, Nov 27 2010, 18:30:46) [MSC v.1500 32 bit (Intel)] on win32 Type "copyright", "credits" or "license()" for more information. >>> import locale >>> locale.getdefaultlocale() ('nl_NL', 'c

ssl error with the python mac binary

2014-11-10 Thread Paul Wiseman
Hey, I've been using the latest mac ppc/i386 binaries from python.org (https://www.python.org/ftp/python/2.7.8/python-2.7.8-macosx10.5.dmg). >From what I can tell this version is linked against a pretty old version of OpenSSL (OpenSSL 0.9.7l 28 Sep 2006) which doesn't seem to be able to handle new

Re: Booksigning Party at PyCon This Year!

2014-11-10 Thread michel88
My kids want to celebrate Halloween party at one of the best party venue. Can you please help us and recommend me best Halloween party nyc with good food supplies arrangements? -- View this message in context: http://python.6

A syntax question

2014-11-10 Thread Mok-Kong Shen
I don't understand the following phenomenon. Could someone kindly explain it? Thanks in advance. M. K. Shen - count=5 def test(): print(count) if count==5: count+=0 ### Error message if this line is active, otherwise ok. print(cou

Re: A syntax question

2014-11-10 Thread alister
On Mon, 10 Nov 2014 12:07:58 +0100, Mok-Kong Shen wrote: > I don't understand the following phenomenon. Could someone kindly > explain it? Thanks in advance. > > M. K. Shen > > - > > count=5 > > def test(): >print(count) >if count==5: >

Re: Python script that does batch find and replace in txt files

2014-11-10 Thread alister
On Sun, 09 Nov 2014 17:49:29 -0800, Syed Khalid wrote: > Albert, > > Code is not removing empty lines containing blank characters and not > removing leading and trailing spaces present in each line. > > > > > import glob, codecs, re, os > > regex = re.compile(r"Age: |Sex: |House No: ") # e

Re: A syntax question

2014-11-10 Thread David Palao
> My crystal ball is currently in for repair and is not expected back in > the foreseeable future. Without a crystal ball, this prediction might be not well founded. -- https://mail.python.org/mailman/listinfo/python-list

Re: A syntax question

2014-11-10 Thread Wolfgang Maier
You may want to read: https://docs.python.org/3/faq/programming.html?highlight=global#why-am-i-getting-an-unboundlocalerror-when-the-variable-has-a-value from the Python docs Programming FAQ section. It explains your problem pretty well. As others have hinted at, always provide concrete Python

Re: Python modules

2014-11-10 Thread Roy Smith
In article , Steve Hayes wrote: > I have a book on Python that advocates dividing programs into modules, and > importing them when needed. Yes, this is a good idea. Breaking your program down into modules, each of which does a small set of closely related things, makes it easier to manage.

Re: Python modules

2014-11-10 Thread Chris Angelico
On Tue, Nov 11, 2014 at 12:36 AM, Roy Smith wrote: > Yes, exactly. When you deploy your application someplace, you need to > include all the things it depends on. In the simple case of a few > python files (say, a main program and a few modules that you're > written), the easiest thing to do mig

Re: A syntax question

2014-11-10 Thread Joel Goldstick
On Mon, Nov 10, 2014 at 6:39 AM, Wolfgang Maier wrote: > You may want to read: > > https://docs.python.org/3/faq/programming.html?highlight=global#why-am-i-getting-an-unboundlocalerror-when-the-variable-has-a-value > > from the Python docs Programming FAQ section. > It explains your problem pretty

Re: A syntax question

2014-11-10 Thread Grant Edwards
On 2014-11-10, David Palao wrote: >> My crystal ball is currently in for repair and is not expected back >> in the foreseeable future. > > Without a crystal ball, this prediction might be not well founded. That isn't a prediction. It's an explicit statement of no prediction. He said that it is

Re: A syntax question

2014-11-10 Thread Chris Angelico
On Tue, Nov 11, 2014 at 1:35 AM, Joel Goldstick wrote: > Your problem is that count is not local. You are reading count from > an outer scope. When you try to increment count in your function, it > can't because it doesn't exist. > Don't use globals. False analysis, I'm afraid. The problem is t

Re: A syntax question

2014-11-10 Thread alister
On Mon, 10 Nov 2014 14:44:53 +, Grant Edwards wrote: > On 2014-11-10, David Palao wrote: > >>> My crystal ball is currently in for repair and is not expected back in >>> the foreseeable future. >> >> Without a crystal ball, this prediction might be not well founded. > > That isn't a predict

Re: A syntax question

2014-11-10 Thread alister
On Mon, 10 Nov 2014 14:54:55 +, alister wrote: > On Mon, 10 Nov 2014 14:44:53 +, Grant Edwards wrote: > >> On 2014-11-10, David Palao wrote: >> My crystal ball is currently in for repair and is not expected back in the foreseeable future. >>> >>> Without a crystal ball, this p

Re: A syntax question

2014-11-10 Thread Peter Otten
Joel Goldstick wrote: > On Mon, Nov 10, 2014 at 6:39 AM, Wolfgang Maier > wrote: >> You may want to read: >> >> https://docs.python.org/3/faq/programming.html?highlight=global#why-am-i-getting-an-unboundlocalerror-when-the-variable-has-a-value >> >> from the Python docs Programming FAQ section. >

Re: A syntax question

2014-11-10 Thread Joel Goldstick
On Mon, Nov 10, 2014 at 9:54 AM, Chris Angelico wrote: > On Tue, Nov 11, 2014 at 1:35 AM, Joel Goldstick > wrote: >> Your problem is that count is not local. You are reading count from >> an outer scope. When you try to increment count in your function, it >> can't because it doesn't exist. >>

Re: A syntax question

2014-11-10 Thread Grant Edwards
On 2014-11-10, alister wrote: > On Mon, 10 Nov 2014 14:44:53 +, Grant Edwards wrote: > >> On 2014-11-10, David Palao wrote: >> My crystal ball is currently in for repair and is not expected back in the foreseeable future. >>> >>> Without a crystal ball, this prediction might be not

Re: A syntax question

2014-11-10 Thread Chris Angelico
On Tue, Nov 11, 2014 at 3:11 AM, Grant Edwards wrote: > I know, but in c.l.p, even jokes get nicely pednatic answers. And in c.l.p, odd jokes get even more pedantic spelling corrections. ChrisA -- https://mail.python.org/mailman/listinfo/python-list

RE: [Distutils] Call for information - What assumptions can I make about Unix users' access to Windows?

2014-11-10 Thread Steve Dower
Ben Finney wrote: > Steve Dower writes: >> Ben Finney wrote: >> > The restrictions of the license terms make MS Windows an >> > unacceptable risk on any machine I'm responsible for. >> >> Just out of interest, which restrictions would those be? > > It has been a long time since I bothered to read

Re: What does zip mean?

2014-11-10 Thread giacomo boffi
On 11/09/2014 11:44 AM, satishmlm...@gmail.com wrote: What does zip return in the following piece of code? To help you understanding what is the `zip` builtin, please forget about PKZip etc and think about the _zip fastener_ or _zipper_ in your bag or in your trousers In the bag you have two s

Re: What does zip mean?

2014-11-10 Thread Grant Edwards
On 2014-11-10, giacomo boffi wrote: > On 11/09/2014 11:44 AM, satishmlm...@gmail.com wrote: >> What does zip return in the following piece of code? > > To help you understanding what is the `zip` builtin, please forget > about PKZip etc and think about the _zip fastener_ or _zipper_ in > your bag

"Natural" use of cmp= in sort

2014-11-10 Thread Paddy
Hi, I do agree with Raymond H. about the relative merits of cmp= and key= in sort/sorted, but I decided to also not let natural uses of cmp= pass silently. In answering this question, http://stackoverflow.com/a/26850434/105

I don't read docs and don't know how to use Google. What does the print function do?

2014-11-10 Thread sohcahtoa82
Please help me this assignment is due in an hour. Don't give me hints, just give me the answer because I only want a grade. I'm not actually interested in learning how to program, but I know software engineers make lots of money so I want to be one. -- https://mail.python.org/mailman/listinfo

Re: "Natural" use of cmp= in sort

2014-11-10 Thread Peter Otten
Paddy wrote: > Hi, I do agree with > Raymond H. about the relative merits of cmp= and key= in > sort/sorted, but I decided to also not let natural uses of cmp= pass > silently. > > In answering this question, http://stackove

Re: I don't read docs and don't know how to use Google. What does the print function do?

2014-11-10 Thread Peter Otten
sohcahto...@gmail.com wrote: > Please help me this assignment is due in an hour. Don't give me hints, > just give me the answer because I only want a grade. I'm not actually > interested in learning how to program, but I know software engineers make > lots of money so I want to be one. I'm sorr

Re: "Natural" use of cmp= in sort

2014-11-10 Thread Ian Kelly
On Mon, Nov 10, 2014 at 12:19 PM, Peter Otten <__pete...@web.de> wrote: > I'm not sure this works. I tried: Here's a simpler failure case. >>> ineq = """f2 > f3 ... f3 > f1""" [Previously posted code elided] >>> greater_thans set([('f3', 'f1'), ('f2', 'f3')]) >>> sorted(all_f, cmp=lambda t1, t2

Re: A syntax question

2014-11-10 Thread Roy Smith
In article , Chris Angelico wrote: > On Tue, Nov 11, 2014 at 3:11 AM, Grant Edwards > wrote: > > I know, but in c.l.p, even jokes get nicely pednatic answers. > > And in c.l.p, odd jokes get even more pedantic spelling corrections. > > ChrisA a n d i m a g i n a r y j o k e s g e t r o

Re: I don't read docs and don't know how to use Google. What does the print function do?

2014-11-10 Thread Roy Smith
In article , sohcahto...@gmail.com wrote: > Please help me this assignment is due in an hour. Don't give me hints, just > give me the answer because I only want a grade. I'm not actually interested > in learning how to program, but I know software engineers make lots of money > so I want to

Design and Build Software Engineer Opportunity

2014-11-10 Thread Charles Weitzer
My name is Charles Weitzer. I do recruiting for machine learning teams worldwide. One of my clients is a startup quantitative hedge fund located in Northern, California. The founders previous worked together at one of the most successful quantitative hedge funds in the world in New York City. No

Re: I don't read docs and don't know how to use Google. What does the print function do?

2014-11-10 Thread Larry Martell
On Mon, Nov 10, 2014 at 2:49 PM, Roy Smith wrote: > In article , > sohcahto...@gmail.com wrote: > >> Please help me this assignment is due in an hour. Don't give me hints, just >> give me the answer because I only want a grade. I'm not actually interested >> in learning how to program, but I kn

Re: I don't read docs and don't know how to use Google. What does the print function do?

2014-11-10 Thread Mark Lawrence
On 10/11/2014 19:24, Peter Otten wrote: sohcahto...@gmail.com wrote: Please help me this assignment is due in an hour. Don't give me hints, just give me the answer because I only want a grade. I'm not actually interested in learning how to program, but I know software engineers make lots of m

Re: A syntax question

2014-11-10 Thread Mark Lawrence
On 10/11/2014 11:31, David Palao wrote: My crystal ball is currently in for repair and is not expected back in the foreseeable future. Without a crystal ball, this prediction might be not well founded. Especially in the future when sombody asks "Who the hell was he replying to?". -- My fe

Re: I don't read docs and don't know how to use Google. What does the print function do?

2014-11-10 Thread Ethan Furman
On 11/10/2014 11:59 AM, Larry Martell wrote: On Mon, Nov 10, 2014 at 2:49 PM, Roy Smith wrote: In article , sohcahto...@gmail.com wrote: Please help me this assignment is due in an hour. Don't give me hints, just give me the answer because I only want a grade. I'm not actually interested

Re: A syntax question

2014-11-10 Thread Tim Chase
On 2014-11-10 20:08, Mark Lawrence wrote: > On 10/11/2014 11:31, David Palao wrote: > >> My crystal ball is currently in for repair and is not expected > >> back in the foreseeable future. > > > > Without a crystal ball, this prediction might be not well founded. > > > > Especially in the future w

Re: locale.getlocale() in cmd.exe vs. Idle

2014-11-10 Thread Terry Reedy
On 11/10/2014 4:22 AM, Albert-Jan Roskam wrote: Hi, Why do I get different output for locale.getlocale() in Idle vs. cmd.exe? # IDLE Python 2.7.1 (r271:86832, Nov 27 2010, 18:30:46) [MSC v.1500 32 bit (Intel)] on win32 Type "copyright", "credits" or "license()" for more information. import lo

Re: What does zip mean?

2014-11-10 Thread Gregory Ewing
Grant Edwards wrote: What the zipper on a coat does is convert two separate sequences into a single sequence where the members alternate between the two input sequences. True, the zipper analogy isn't quite accurate. It's hard to think of an equally concise and suggestive name, however. -- Gr

Re: I don't read docs and don't know how to use Google. What does the print function do?

2014-11-10 Thread Grant Edwards
On 2014-11-10, sohcahto...@gmail.com wrote: > Please help me this assignment is due in an hour. Don't give me > hints, just give me the answer because I only want a grade. I'm not > actually interested in learning how to program, but I know software > engineers make lots of money so I want to b

Re: What does zip mean?

2014-11-10 Thread Cameron Simpson
On 10Nov2014 17:19, Grant Edwards wrote: On 2014-11-10, giacomo boffi wrote: To help you understanding what is the `zip` builtin, please forget about PKZip etc and think about the _zip fastener_ or _zipper_ in your bag or in your trousers In the bag you have two sequences of teeth that the zi

Re: I don't read docs and don't know how to use Google. What does the print function do?

2014-11-10 Thread Denis McMahon
On Mon, 10 Nov 2014 10:56:18 -0800, sohcahtoa82 wrote: > ... I know software engineers > make lots of money so I want to be one. I hear that pretty boy male escorts can make even more money than software engineers. They also don't need to learn how to program, which is something software engin

Re: I don't read docs and don't know how to use Google. What does the print function do?

2014-11-10 Thread sohcahtoa82
On Monday, November 10, 2014 1:01:05 PM UTC-8, Grant Edwards wrote: > On 2014-11-10, sohcahtoa82 wrote: > > > Please help me this assignment is due in an hour. Don't give me > > hints, just give me the answer because I only want a grade. I'm not > > actually interested in learning how to progra

Re: I don't read docs and don't know how to use Google. What does the print function do?

2014-11-10 Thread Ian Kelly
On Mon, Nov 10, 2014 at 2:45 PM, wrote: > On Monday, November 10, 2014 1:01:05 PM UTC-8, Grant Edwards wrote: >> On 2014-11-10, sohcahtoa82 wrote: >> >> > Please help me this assignment is due in an hour. Don't give me >> > hints, just give me the answer because I only want a grade. I'm not >>

Re: ssl error with the python mac binary

2014-11-10 Thread Ned Deily
In article , Paul Wiseman wrote: > I've been using the latest mac ppc/i386 binaries from python.org > (https://www.python.org/ftp/python/2.7.8/python-2.7.8-macosx10.5.dmg). > From what I can tell this version is linked against a pretty old > version of OpenSSL (OpenSSL 0.9.7l 28 Sep 2006) which

Re: I don't read docs and don't know how to use Google. What does the print function do?

2014-11-10 Thread MRAB
On 2014-11-10 20:16, Ethan Furman wrote: On 11/10/2014 11:59 AM, Larry Martell wrote: On Mon, Nov 10, 2014 at 2:49 PM, Roy Smith wrote: In article , sohcahto...@gmail.com wrote: Please help me this assignment is due in an hour. Don't give me hints, just give me the answer because I only w

What does (?P) pattern syntax do?

2014-11-10 Thread satishmlmlml
What does ?P and match in the following piece of code? re.search('(?P\w*)/(?P\w*)', '...aaa/bbb/ccc]').groups() -- https://mail.python.org/mailman/listinfo/python-list

Re: What does (?P) pattern syntax do?

2014-11-10 Thread Ben Finney
satishmlm...@gmail.com writes: > What does ?P and match in the following piece of code? Learn about Python's regular expression features from the documentation https://docs.python.org/3/library/re.html>. Experiment with regular expressions using online tools such as https://pythex.org/>. --

Re: What does zip mean?

2014-11-10 Thread Terry Reedy
On 11/10/2014 3:36 PM, Cameron Simpson wrote: On 10Nov2014 17:19, Grant Edwards wrote: On 2014-11-10, giacomo boffi wrote: To help you understanding what is the `zip` builtin, please forget about PKZip etc and think about the _zip fastener_ or _zipper_ in your bag or in your trousers In the

Re: "Natural" use of cmp= in sort

2014-11-10 Thread Paddy
On Monday, 10 November 2014 19:44:39 UTC, Ian wrote: > On Mon, Nov 10, 2014 at 12:19 PM, Peter Otten wrote: > > I'm not sure this works. I tried: > > Here's a simpler failure case. > > >>> ineq = """f2 > f3 > ... f3 > f1""" > > [Previously posted code elided] > > >>> greater_thans > set([('f3

Re: "Natural" use of cmp= in sort

2014-11-10 Thread Paddy
On Monday, 10 November 2014 18:45:15 UTC, Paddy wrote: > Hi, I do agree with >Raymond H. about the relative merits of cmp= and key= in > sort/sorted, but I decided to also not let natural uses of cmp= pass silently. > > I

Re: "Natural" use of cmp= in sort

2014-11-10 Thread Ian Kelly
On Mon, Nov 10, 2014 at 8:09 PM, Paddy wrote: > On Monday, 10 November 2014 18:45:15 UTC, Paddy wrote: >> Hi, I do agree with >> Raymond H. about the relative merits of cmp= and key= in >> sort/sorted, but I decided to als

Re: [Python-Dev] Dinamically set __call__ method

2014-11-10 Thread Ian Kelly
On Sat, Nov 8, 2014 at 3:31 PM, Gregory Ewing wrote: > (BTW, I'm actually surprised that this technique makes c callable. > There must be more going on that just "look up __call__ in the class > object", because evaluating C.__call__ just returns the descriptor > and doesn't invoking the descripto

Re: "Natural" use of cmp= in sort

2014-11-10 Thread Paddy
On Tuesday, 11 November 2014 06:37:18 UTC, Ian wrote: > On Mon, Nov 10, 2014 at 8:09 PM, Paddy wrote: > > On Monday, 10 November 2014 18:45:15 UTC, Paddy wrote: > >> Hi, I do agree with > >> Raymond H. about the relative m