ANN: eGenix PyRun - One file Python Runtime 2.0.1

2014-08-27 Thread eGenix Team: M.-A. Lemburg
ANNOUNCING eGenix PyRun - One file Python Runtime Version 2.0.1 An easy-to-use single file relocatable Python run-time - available for Linux, Mac OS X and

Re: Reading from sys.stdin reads the whole file in

2014-08-27 Thread Chris Angelico
On Wed, Aug 27, 2014 at 3:19 PM, Steven D'Aprano st...@pearwood.info wrote: When I pipe one to the other, I expect each line to be printed as they arrive, but instead they all queue up and happen at once: You're seeing two different problems here. One is the flushing of stdout in out.py, as

Re: Reading from sys.stdin reads the whole file in

2014-08-27 Thread Naoki INADA
I recommend Python 3. On Python 2, iterating lines without buffering is slow, tricky and ugly. for line in iter(sys.stdin.readline(), ''):     print line — Sent from Mailbox On Wed, Aug 27, 2014 at 3:03 PM, Chris Angelico ros...@gmail.com wrote: On Wed, Aug 27, 2014 at 3:19 PM, Steven

Re: Python vs C++

2014-08-27 Thread Ian Kelly
On Tue, Aug 26, 2014 at 11:43 PM, alex23 wuwe...@gmail.com wrote: On 26/08/2014 6:12 PM, Amirouche Boubekki wrote: 2014-08-26 6:02 GMT+02:00 Ian Kelly ian.g.ke...@gmail.com mailto:ian.g.ke...@gmail.com: It would be just as easy or easier in Python, or one could save a lot more

Re: Python vs C++

2014-08-27 Thread Ian Kelly
On Wed, Aug 27, 2014 at 12:23 AM, Ian Kelly ian.g.ke...@gmail.com wrote: On Tue, Aug 26, 2014 at 11:43 PM, alex23 wuwe...@gmail.com wrote: On 26/08/2014 6:12 PM, Amirouche Boubekki wrote: 2014-08-26 6:02 GMT+02:00 Ian Kelly ian.g.ke...@gmail.com mailto:ian.g.ke...@gmail.com: It would be

Re: Reading from sys.stdin reads the whole file in

2014-08-27 Thread Steven D'Aprano
On Wed, 27 Aug 2014 08:29:20 +0300, Marko Rauhamaa wrote: Steven D'Aprano st...@pearwood.info: When I pipe one to the other, I expect each line to be printed as they arrive, but instead they all queue up and happen at once: Try flushing after each print. Doesn't help. Here is an update

Re: Reading from sys.stdin reads the whole file in

2014-08-27 Thread Chris Angelico
On Wed, Aug 27, 2014 at 4:37 PM, Steven D'Aprano st...@pearwood.info wrote: On Wed, 27 Aug 2014 08:29:20 +0300, Marko Rauhamaa wrote: Try flushing after each print. Doesn't help. It does, but insufficiently. If slurp.py is run under Py3, it works fine; or take Naoki's suggestion (although

Re: This formating is really tricky

2014-08-27 Thread Larry Hudson
On 08/25/2014 08:14 PM, Seymore4Head wrote: [snip] There is lots of help built in. Trying to read all the options makes me realize the stuff I am working on is just the tip of the iceberg. When checking the help function, it is clear I will never get to about 90% of the features. Thanks

Re: This formating is really tricky

2014-08-27 Thread Peter Otten
Seymore4Head wrote: On Mon, 25 Aug 2014 18:22:35 -0400, Terry Reedy tjre...@udel.edu wrote: On 8/25/2014 4:14 PM, Seymore4Head wrote: import random sets=3 for x in range(0, sets): pb2=random.choice([1-53]) You want random.randint(1, 53) ... alist = sorted([pb1, pb2, pb3, pb4,

ANN: eGenix PyRun - One file Python Runtime 2.0.1

2014-08-27 Thread eGenix Team: M.-A. Lemburg
ANNOUNCING eGenix PyRun - One file Python Runtime Version 2.0.1 An easy-to-use single file relocatable Python run-time - available for Linux, Mac OS X and

Re: Python vs C++

2014-08-27 Thread Ian Kelly
On Tue, Aug 26, 2014 at 2:12 AM, Amirouche Boubekki amirouche.boube...@gmail.com wrote: 2014-08-26 6:02 GMT+02:00 Ian Kelly ian.g.ke...@gmail.com: On Mon, Aug 25, 2014 at 4:52 AM, Amirouche Boubekki amirouche.boube...@gmail.com wrote: - I am a big fan of Final Fantasy games, it seems to be

Re: Reading from sys.stdin reads the whole file in

2014-08-27 Thread Steven D'Aprano
On Tue, 26 Aug 2014 23:07:36 -0700, Naoki INADA wrote: for line in iter(sys.stdin.readline(), ''): Thanks for that. Removing the parens after readline seems to do the trick. -- Steven -- https://mail.python.org/mailman/listinfo/python-list

Re: Reading from sys.stdin reads the whole file in

2014-08-27 Thread Peter Otten
Steven D'Aprano wrote: I'm trying to read from stdin. Here I simulate a process that slowly outputs data to stdout: steve@runes:~$ cat out.py import time print Hello... time.sleep(10) print World! time.sleep(10) print Goodbye! In addition to what already has been said: you can

Re: What is acceptable as 'open-source'? [was Python vs C++]

2014-08-27 Thread Frank Millman
Ian Kelly ian.g.ke...@gmail.com wrote in message news:calwzidkro_hryamwxbk0go-w1oj6ty6myb_c5vhxb6okgol...@mail.gmail.com... Ugh. There seems to be no public repository, and the only source to be found is from release-versioned tarballs, so there's apparently no collaboration other than some

Re: What is acceptable as 'open-source'? [was Python vs C++]

2014-08-27 Thread Chris Angelico
On Wed, Aug 27, 2014 at 5:50 PM, Frank Millman fr...@chagford.com wrote: This is quite a timely message for me. I am inching closer to releasing a version of my accounting software, and a lot of the above comments apply to me as well. At present I am the only developer, and my project is not

Re: Python conquors the BBC [was Re: IDLE has suddenly become FAWLTY - so should I be hitting it with a big stick, or what?]

2014-08-27 Thread Chris “Kwpolska” Warrick
On Wed, Aug 27, 2014 at 2:58 AM, Twirlip2 ahr...@googlemail.com wrote: It just pulls a lot of HTML and XML from the website, and extracts the addresses of various other pages, and eventually *.WMA streams, and hands the stream URLs over to XMPlay http://www.un4seen.com/. It 'knows' what pages

Re: Reading from sys.stdin reads the whole file in

2014-08-27 Thread Marko Rauhamaa
Peter Otten __pete...@web.de: In addition to what already has been said: you can switch off output buffering of stdout/stderr with python -u out.py or by setting the PYTHONUNBUFFERED environment variable. Very often such externalities are not in the control of the application developer.

Re: Python conquors the BBC [was Re: IDLE has suddenly become FAWLTY - so should I be hitting it with a big stick, or what?]

2014-08-27 Thread Twirlip2
On Wednesday, 27 August 2014 05:55:28 UTC+1, Chris Angelico wrote: On Wed, Aug 27, 2014 at 1:13 PM, Rustom Mody rus...@gmail.com wrote: On Wednesday, August 27, 2014 8:06:24 AM UTC+5:30, Chris Angelico wrote: On Wed, Aug 27, 2014 at 10:58 AM, Twirlip2 wrote: So, please give me a few

Re: Python conquors the BBC [was Re: IDLE has suddenly become FAWLTY - so should I be hitting it with a big stick, or what?]

2014-08-27 Thread Twirlip2
On Wednesday, 27 August 2014 09:12:07 UTC+1, Chris Kwpolska Warrick wrote: On Wed, Aug 27, 2014 at 2:58 AM, Twirlip2 ahr...@googlemail.com wrote: I have plenty of ideas for improving the program, but first I have to re-organise the present spaghetti code in a more logical fashion. I

Re: IDLE has suddenly become FAWLTY - so should I be hitting it with a big stick, or what?

2014-08-27 Thread Twirlip2
On Wednesday, 27 August 2014 05:03:10 UTC+1, Terry Reedy wrote: On 8/26/2014 9:11 PM, Twirlip2 wrote: Firefox can't find the server at news.gmane.com. sorry. .org This is gmane.comp.python.general Found it now, thanks. I'll take my time and learn how to use it. I hope it's OK if I

Re: Reading from sys.stdin reads the whole file in

2014-08-27 Thread Peter Otten
Marko Rauhamaa wrote: Peter Otten __pete...@web.de: In addition to what already has been said: you can switch off output buffering of stdout/stderr with python -u out.py or by setting the PYTHONUNBUFFERED environment variable. Very often such externalities are not in the control of

PyDev 3.7.0 Released

2014-08-27 Thread Fabio Zadrozny
What is PyDev? --- PyDev is an open-source Python IDE on top of Eclipse for Python, Jython and IronPython development. It comes with goodies such as code completion, syntax highlighting, syntax analysis, code analysis, refactor, debug, interactive console, etc. Details

Re: What is acceptable as 'open-source'? [was Python vs C++]

2014-08-27 Thread Ned Batchelder
On 8/27/14 3:50 AM, Frank Millman wrote: Ian Kelly ian.g.ke...@gmail.com wrote in message news:calwzidkro_hryamwxbk0go-w1oj6ty6myb_c5vhxb6okgol...@mail.gmail.com... Ugh. There seems to be no public repository, and the only source to be found is from release-versioned tarballs, so there's

Re: Python vs C++

2014-08-27 Thread Amirouche Boubekki
2014-08-27 8:06 GMT+02:00 Ian Kelly ian.g.ke...@gmail.com: On Tue, Aug 26, 2014 at 2:12 AM, Amirouche Boubekki amirouche.boube...@gmail.com wrote: 2014-08-26 6:02 GMT+02:00 Ian Kelly ian.g.ke...@gmail.com: On Mon, Aug 25, 2014 at 4:52 AM, Amirouche Boubekki amirouche.boube...@gmail.com

Re: Python vs C++

2014-08-27 Thread Amirouche Boubekki
2014-08-27 8:23 GMT+02:00 Ian Kelly ian.g.ke...@gmail.com: On Tue, Aug 26, 2014 at 11:43 PM, alex23 wuwe...@gmail.com wrote: On 26/08/2014 6:12 PM, Amirouche Boubekki wrote: 2014-08-26 6:02 GMT+02:00 Ian Kelly ian.g.ke...@gmail.com mailto:ian.g.ke...@gmail.com: It would be just

Re: This formating is really tricky

2014-08-27 Thread Seymore4Head
On Tue, 26 Aug 2014 23:46:58 -0700, Larry Hudson org...@yahoo.com wrote: On 08/25/2014 08:14 PM, Seymore4Head wrote: [snip] There is lots of help built in. Trying to read all the options makes me realize the stuff I am working on is just the tip of the iceberg. When checking the help

Re: This formating is really tricky

2014-08-27 Thread Seymore4Head
On Wed, 27 Aug 2014 09:16:43 +0200, Peter Otten __pete...@web.de wrote: Seymore4Head wrote: On Mon, 25 Aug 2014 18:22:35 -0400, Terry Reedy tjre...@udel.edu wrote: On 8/25/2014 4:14 PM, Seymore4Head wrote: import random sets=3 for x in range(0, sets): pb2=random.choice([1-53]) You

running a python program

2014-08-27 Thread ngangsia akumbo
i have written a small scripts in python that inputs two values and prints out the sum. Ok i want to be able to install this program on a windows 8 machine and run it as a normal program. i want to be able to run it to any windows machine without necessarily installing python on that machine.

Re: running a python program

2014-08-27 Thread ngangsia akumbo
please i need some help -- https://mail.python.org/mailman/listinfo/python-list

Python programming

2014-08-27 Thread Jake
Jake-- https://mail.python.org/mailman/listinfo/python-list

Re: running a python program

2014-08-27 Thread William Ray Wing
On Aug 27, 2014, at 9:42 AM, ngangsia akumbo ngang...@gmail.com wrote: i have written a small scripts in python that inputs two values and prints out the sum. Ok i want to be able to install this program on a windows 8 machine and run it as a normal program. i want to be able to run it

Re: running a python program

2014-08-27 Thread Chris Angelico
On Wed, Aug 27, 2014 at 11:46 PM, ngangsia akumbo ngang...@gmail.com wrote: please i need some help You could try a search engine. Type what you want into it, and start reading the results. In the three minutes between your first post and your context-free and content-free nudge, you probably

Re: PyPI password rules

2014-08-27 Thread Skip Montanaro
On Tue, Aug 26, 2014 at 11:05 AM, Skip Montanaro s...@pobox.com wrote: I guess I could write a little program that listens to my incoming email via IMAP. I'll have to see what that generates. Lots of Python and bike references, no doubt. I should have something to show the world in a day or

Re: Python programming

2014-08-27 Thread Neil D. Cerutti
On 8/27/2014 9:40 AM, Jake wrote: Jake I disagree! -- Neil Cerutti -- https://mail.python.org/mailman/listinfo/python-list

Re: Python programming

2014-08-27 Thread MRAB
On 2014-08-27 15:36, Neil D. Cerutti wrote: On 8/27/2014 9:40 AM, Jake wrote: Jake I disagree! True. Too confusing. Should be Bruce. -- https://mail.python.org/mailman/listinfo/python-list

Problem with pexpect when executing a command on a remote machine

2014-08-27 Thread Kiran kumar Venkumahanti
Hi, I am trying to execute a command on a remote machine for which I am using Python pexpect module. Iam able to connect and copy files to the remote machine but getting the following error when trying to execute commands on the remote machine. Please find the below error. ''Error sending

Re: IDLE has suddenly become FAWLTY - so should I be hitting it with a big stick, or what?

2014-08-27 Thread Twirlip2
On Tuesday, 26 August 2014 23:55:51 UTC+1, Twirlip2 wrote: It doesn't seem immediately obvious how to get a definitive list of which names to avoid using (and therefore, inadvertently 'shadowing', as I did today). For example,

Re: running a python program

2014-08-27 Thread Grant Edwards
On 2014-08-27, ngangsia akumbo ngang...@gmail.com wrote: i have written a small scripts in python that inputs two values and prints out the sum. Ok i want to be able to install this program on a windows 8 machine and run it as a normal program. I use py2exe for that. When I want to bundle

Re: Python programming

2014-08-27 Thread Grant Edwards
On 2014-08-27, MRAB pyt...@mrabarnett.plus.com wrote: On 2014-08-27 15:36, Neil D. Cerutti wrote: On 8/27/2014 9:40 AM, Jake wrote: Jake I disagree! True. Too confusing. Should be Bruce. Well, it's spelled Jake, but it's pronounced throat warbler mangrove -- Grant Edwards

Re: Problem with pexpect when executing a command on a remote machine

2014-08-27 Thread Chris Angelico
On Thu, Aug 28, 2014 at 1:27 AM, Kiran kumar Venkumahanti leo.cool...@gmail.com wrote: ''Error sending command: cluster config -r -a Timeout exceeded in read_nonblocking().\nscp_ssh_lib.eSSH object at 0xa60cd0\nversion: 2.4 ($Revision: 516 $)\ncommand: /usr/bin/ssh\nargs: [\'/usr/bin/ssh\',

Re: Python programming

2014-08-27 Thread mm0fmf
On 27/08/2014 16:41, Grant Edwards wrote: Well, it's spelled Jake, but it's pronounced throat warbler mangrove You're a very silly man and I'm not going to interview you. -- https://mail.python.org/mailman/listinfo/python-list

Re: [SciPy-User] Convert 3d NumPy array into 2d

2014-08-27 Thread Maximilian Albert
[source] http://github.com/numpy/numpy/blob/v1.8.1/numpy/core/fromnumeric.py#L1072 http://docs.scipy.org/doc/numpy/reference/generated/numpy.squeeze.html#numpy.squeeze 2014-08-27 16:08 GMT+01:00 phinn stuart dphinnstu...@gmail.com: Hi everyone, how can I convert (1L, 480L, 1440L) shaped numpy

Re: What is acceptable as 'open-source'?

2014-08-27 Thread Paul Rubin
Frank Millman fr...@chagford.com writes: I could stick to hg (or git) but I have recently come across fossil, and it seems ideal for my needs. Has anyone used it? I've played with it. It's incredibly impressive for such a comparatively small program. But, it's kind of niche, and even hg has

Re: Python programming

2014-08-27 Thread Mark Lawrence
On 27/08/2014 16:09, MRAB wrote: On 2014-08-27 15:36, Neil D. Cerutti wrote: On 8/27/2014 9:40 AM, Jake wrote: Jake I disagree! True. Too confusing. Should be Bruce. How about Dolores after the first word of the Hardy book that was never published? -- My fellow Pythonistas, ask not

Re: What is acceptable as 'open-source'?

2014-08-27 Thread Marko Rauhamaa
Paul Rubin no.email@nospam.invalid: Frank Millman fr...@chagford.com writes: I could stick to hg (or git) but I have recently come across fossil, and it seems ideal for my needs. Has anyone used it? I've played with it. It's incredibly impressive for such a comparatively small program.

Re: What is acceptable as 'open-source'? [was Python vs C++]

2014-08-27 Thread Rustom Mody
On Wednesday, August 27, 2014 5:24:40 PM UTC+5:30, Ned Batchelder wrote: On 8/27/14 3:50 AM, Frank Millman wrote: Ian Kelly wrote in message Ugh. There seems to be no public repository, and the only source to be found is from release-versioned tarballs, so there's apparently no

Convert 3d NumPy array into 2d

2014-08-27 Thread phinn stuart
Hi everyone, how can I convert (1L, 480L, 1440L) shaped numpy array into (480L, 1440L)? Thanks in the advance. phinn -- https://mail.python.org/mailman/listinfo/python-list

Re: What is acceptable as 'open-source'?

2014-08-27 Thread Rustom Mody
On Wednesday, August 27, 2014 10:44:37 PM UTC+5:30, Marko Rauhamaa wrote: Paul Rubin : Frank Millman writes: I could stick to hg (or git) but I have recently come across fossil, and it seems ideal for my needs. Has anyone used it? I've played with it. It's incredibly impressive for such

The transition to multilingual programming (Nick Coughlin)

2014-08-27 Thread Terry Reedy
http://www.curiousefficiency.org/posts/2014/08/multilingual-programming.html I think this is one of the best explanations for 'why Python 3' at least as regards the unicode change. -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list

hg, git, fossil, ... [was Re: What is acceptable as 'open-source'? [was Python vs C++]]

2014-08-27 Thread Ethan Furman
On 08/27/2014 10:29 AM, Rustom Mody wrote: Git has won the battle Good thing there's room for more than one technology. I use hg because 1) python-dev uses hg; and 2) I understand the simple hg commands. I find git confusing, and my main uses are commit, pull, update, an occasional merge,

Thread terminate

2014-08-27 Thread Ervin Hegedüs
Hi, what's the correct way to terminate a thread by itself? I mean: class MyThread(threading.Thread): def __init__(self, queueitem): threading.Thread.__init__(self) ... def run(self): pseudo code below try: self.connect_to_database()

Re: hg, git, fossil, ... [was Re: What is acceptable as 'open-source'? [was Python vs C++]]

2014-08-27 Thread Ethan Furman
On 08/27/2014 11:51 AM, Skip Montanaro wrote: Thank God for StackOverflow. :-) +1 QotW -- https://mail.python.org/mailman/listinfo/python-list

Re: hg, git, fossil, ... [was Re: What is acceptable as 'open-source'? [was Python vs C++]]

2014-08-27 Thread Skip Montanaro
On Wed, Aug 27, 2014 at 1:26 PM, Ethan Furman et...@stoneleaf.us wrote: I use hg because 1) python-dev uses hg; and 2) I understand the simple hg commands. I find git confusing, and my main uses are commit, pull, update, an occasional merge, and a rare rollback -- not complicated stuff. The

Re: Convert 3d NumPy array into 2d

2014-08-27 Thread Gary Herron
On 08/27/2014 08:08 AM, phinn stuart wrote: Hi everyone, how can I convert (1L, 480L, 1440L) shaped numpy array into (480L, 1440L)? Thanks in the advance. phinn A simple assignment into the arrays shape does it: a = numpy.zeros((1,480,1440)) a.shape (1, 480, 1440) a.shape = (480,1440)

Re: What is acceptable as 'open-source'? [was Python vs C++]

2014-08-27 Thread Christian Gollwitzer
Am 27.08.14 09:50, schrieb Frank Millman: This is quite a timely message for me. I am inching closer to releasing a version of my accounting software, and a lot of the above comments apply to me as well. At present I am the only developer, and my project is not hosted anywhere, so I have to

Re: Thread terminate

2014-08-27 Thread Chris Kaynor
On Wed, Aug 27, 2014 at 11:55 AM, Ervin Hegedüs airw...@gmail.com wrote: what's the correct way to terminate a thread by itself? To terminate the thread, the run function must exit. This can be either from an exception or a return statement. I mean: class MyThread(threading.Thread):

python string, best way to concat

2014-08-27 Thread dennisearlevans
Hi, Sorry about the simple question but I am very new to Python. Anyway, I have a function that will be used to call a stored procedure and I need to format the string with the correct number of parameter markers for the ODBC driver, fairly standard stuff. What I have works but

iterating over strings seems to be really slow?

2014-08-27 Thread Rodrick Brown
*I'm confused why the former function runs significantly faster when wc1() builds the hash on a single pass and doesn't waste memory of returning an array of strings? * *I would think wc2() to be slower what's going on here? * #!/usr/bin/env python s = The black cat jump over the bigger black

Re: iterating over strings seems to be really slow?

2014-08-27 Thread Tim Chase
On 2014-08-27 16:53, Rodrick Brown wrote: *I'm confused why the former function runs significantly faster when wc1() builds the hash on a single pass and doesn't waste memory of returning an array of strings? * *I would think wc2() to be slower what's going on here? * #!/usr/bin/env

Re: iterating over strings seems to be really slow?

2014-08-27 Thread Chris Kaynor
On Wed, Aug 27, 2014 at 1:53 PM, Rodrick Brown rodrick.br...@gmail.com wrote: def wc1(): word= m={} for c in s: if c != : word += c else: if m.has_key(word): m[word] += 1 else: m[word] = 1

Re: print to screen and file with one print statement

2014-08-27 Thread KS
Hi Mike/Ami, Can you please let me know where do I add flush(self) and get sys.stdout.flush() to work? Thanks, KS -- https://mail.python.org/mailman/listinfo/python-list

Re: python string, best way to concat

2014-08-27 Thread Dan Stromberg
On Wed, Aug 27, 2014 at 1:31 PM, dennisearlev...@gmail.com wrote: Hi, Sorry about the simple question but I am very new to Python. Anyway, I have a function that will be used to call a stored procedure and I need to format the string with the correct number of parameter markers for

Re: python string, best way to concat

2014-08-27 Thread Peter Otten
dennisearlev...@gmail.com wrote: Hi, Sorry about the simple question but I am very new to Python. Anyway, I have a function that will be used to call a stored procedure and I need to format the string with the correct number of parameter markers for the ODBC driver, fairly

importlib.util.find_spec()

2014-08-27 Thread Twirlip2
I want to write a function (preferably not very complicated, nor requiring deep understanding of the innards of Python) that will tell me whether a given string name can be used as the name of a module (filename name.py), which can be placed in the search path, without conflicting with some other

Re: Installing Problems - 'Key not valid for use in specified state.'

2014-08-27 Thread djhorton46
I had a problem installing Java 8 update. Got two different messages: Error 1603 and Key not valid for use in specified state. I had checked for malware and viruses beforehand and found nothing. I renamed User/Appdata/roaming/Microsoft/crypto/RSA to RSAcorrupt and tried installing again. It

Re: python string, best way to concat

2014-08-27 Thread MRAB
On 2014-08-27 21:31, dennisearlev...@gmail.com wrote: Hi, Sorry about the simple question but I am very new to Python. Anyway, I have a function that will be used to call a stored procedure and I need to format the string with the correct number of parameter markers for the ODBC

Re: python string, best way to concat

2014-08-27 Thread Tim Chase
On 2014-08-27 23:42, MRAB wrote: How many parameters are there? len(self.param) Make that many placeholders and then join them together with commas: ', '.join(['?'] * len(self.param)) I prefer the clarity of Peter Otten's suggestion of ', '.join('?' * len(self.param)) over the mild

Re: What is acceptable as 'open-source'?

2014-08-27 Thread Chris Angelico
On Thu, Aug 28, 2014 at 3:14 AM, Marko Rauhamaa ma...@pacujo.net wrote: Thanks for the tip. I've been looking for the magic bullet since I had to abandon Sun's TeamWare years back. Unfortunately, fossil seems to suffer from the same problem as git and hg: they all consider the whole repository

Re: print to screen and file with one print statement

2014-08-27 Thread Chris Angelico
On Thu, Aug 28, 2014 at 8:23 AM, KS sen.kusum...@gmail.com wrote: Can you please let me know where do I add flush(self) and get sys.stdout.flush() to work? Check the dates. You're responding to a 2013 response to a 2003 post. If you have a question about something this old, it's probably best

Re: python string, best way to concat

2014-08-27 Thread Chris Angelico
On Thu, Aug 28, 2014 at 8:44 AM, Tim Chase python.l...@tim.thechases.com wrote: On 2014-08-27 23:42, MRAB wrote: How many parameters are there? len(self.param) Make that many placeholders and then join them together with commas: ', '.join(['?'] * len(self.param)) I prefer the clarity of

Re: python string, best way to concat

2014-08-27 Thread Peter Otten
Tim Chase wrote: On 2014-08-27 23:42, MRAB wrote: How many parameters are there? len(self.param) Make that many placeholders and then join them together with commas: ', '.join(['?'] * len(self.param)) I prefer the clarity of Peter Otten's suggestion of ', '.join('?' *

Re: iterating over strings seems to be really slow?

2014-08-27 Thread Chris Angelico
On Thu, Aug 28, 2014 at 6:53 AM, Rodrick Brown rodrick.br...@gmail.com wrote: def wc1(): word= m={} for c in s: if c != : word += c else: if m.has_key(word): m[word] += 1 else: m[word] = 1 word= return(m) Your code is all buried behind HTML formatting, which makes it hard to read.

Re: hg, git, fossil, ... [was Re: What is acceptable as 'open-source'? [was Python vs C++]]

2014-08-27 Thread Chris Angelico
On Thu, Aug 28, 2014 at 4:51 AM, Skip Montanaro s...@pobox.com wrote: The simple hg commands are generally not all that different (in my limited experience) than the simple git commands, for some definition of simple. Stuff like clone, init, push, pull, commit, the small number of commands you

Re: Working with decimals part 2

2014-08-27 Thread Seymore4Head
On Tue, 26 Aug 2014 10:46:56 +1000, alex23 wuwe...@gmail.com wrote: On 26/08/2014 3:55 AM, Seymore4Head wrote: I changed the program just a little to give myself a little practice with number formats. The main thing I wanted to do was make the decimal points line up. The problem I am having

Re: PyPI password rules

2014-08-27 Thread Skip Montanaro
On Wed, Aug 27, 2014 at 9:23 AM, Skip Montanaro s...@pobox.com wrote: I should have something to show the world in a day or two. Here's my first crack at it. https://github.com/smontanaro/polly Thanks to Chris for the idea and the name. The README.md file should have enough to get started.

Re: PyPI password rules

2014-08-27 Thread Chris Angelico
On Thu, Aug 28, 2014 at 12:53 PM, Skip Montanaro s...@pobox.com wrote: On Wed, Aug 27, 2014 at 9:23 AM, Skip Montanaro s...@pobox.com wrote: I should have something to show the world in a day or two. Here's my first crack at it. https://github.com/smontanaro/polly Thanks to Chris for the

Re: PyPI password rules

2014-08-27 Thread Skip Montanaro
On Wed, Aug 27, 2014 at 10:32 PM, Chris Angelico ros...@gmail.com wrote: I'm not sure I understand how your 'common' value works, though. Does the default 0.6 mean you take the 60% most common words? Those above the 60th percentile of frequency? Something else? Yes, basically. A word has to

Re: PyPI password rules

2014-08-27 Thread Chris Angelico
On Thu, Aug 28, 2014 at 2:28 PM, Skip Montanaro s...@pobox.com wrote: On Wed, Aug 27, 2014 at 10:32 PM, Chris Angelico ros...@gmail.com wrote: I'm not sure I understand how your 'common' value works, though. Does the default 0.6 mean you take the 60% most common words? Those above the 60th

Re: What is acceptable as 'open-source'?

2014-08-27 Thread Marko Rauhamaa
Chris Angelico ros...@gmail.com: On Thu, Aug 28, 2014 at 3:14 AM, Marko Rauhamaa ma...@pacujo.net wrote: parallel changes always result in a conflict that requires merging. This is a feature, not a problem. As far as most version control systems are concerned, files aren't independent.

Re: PyPI password rules

2014-08-27 Thread Skip Montanaro
On Thu, Aug 28, 2014 at 12:08 AM, Chris Angelico ros...@gmail.com wrote: Interesting. I suspect this may have issues, as you're doing these checks progressively; something that's common in the early posts will be weighted without regard to subsequent posts (you're requiring 100 unique words

Re: What is acceptable as 'open-source'?

2014-08-27 Thread Chris Angelico
On Thu, Aug 28, 2014 at 3:31 PM, Marko Rauhamaa ma...@pacujo.net wrote: I'd venture to say files are quite independent most of the time. That's why such merges have been facilitated to the point that negates the feature you mentioned. Nobody cares to take the trouble of analyzing the validity

[issue22090] Decimal and float formatting treat '%' differently for infinities and nans.

2014-08-27 Thread R. David Murray
R. David Murray added the comment: Well, we have a goal of keeping the stable buildbots green. If something turns one or more red, it should either be fixed promptly, or the changeset that turned it red backed out until a fix is ready. The reason for keeping them green is so we know right

[issue22065] Update turtledemo menu creation

2014-08-27 Thread Terry J. Reedy
Terry J. Reedy added the comment: Since the menu argument was the 'opposite' of the stop argument, both in theory and practice, it was never needed as a parameter/argument. configGUI could have had the following first line to create it. menu = NORMAL if stop == DISABLED else DISABLED

[issue12067] Doc: remove errors about mixed-type comparisons.

2014-08-27 Thread Martin Panter
Changes by Martin Panter vadmium...@gmail.com: -- nosy: +vadmium ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12067 ___ ___ Python-bugs-list

[issue21965] Add support for Memory BIO to _ssl

2014-08-27 Thread Geert Jansen
Geert Jansen added the comment: Adding small patch (incremental to patch #4) to fix a test failure. -- Added file: http://bugs.python.org/file36483/ssl-memory-bio-4-incr1.patch ___ Python tracker rep...@bugs.python.org

[issue22282] ipaddress module accepts octal formatted IPv4 addresses in IPv6 addresses

2014-08-27 Thread Fabian
New submission from Fabian: The ipaddress module accepts IPv6 addresses if the IPv4 address is formatted as an octal number, but http://tools.ietf.org/html/rfc3986#section-3.2.2 doesn't allow leading zeroes in the IPv4 address. This is the current behaviour (in 3.4.1):

[issue22283] AMD64 FreeBSD 9.0 3.x fails to build the _decimal module: #error libmpdec version = 2.4.1 required

2014-08-27 Thread STINNER Victor
New submission from STINNER Victor: http://buildbot.python.org/all/builders/AMD64%20FreeBSD%209.0%203.x/builds/7213/steps/test/logs/stdio building '_decimal' extension gcc -pthread -fPIC -fno-strict-aliasing -Wsign-compare -g -O0 -Wall -Wstrict-prototypes -Werror=declaration-after-statement

[issue22281] ProcessPoolExecutor/ThreadPoolExecutor should provide introspection APIs

2014-08-27 Thread Ram Rachum
Ram Rachum added the comment: I'd definitely consolidate. First of all, I'd put a few useful numbers in `Executor.__repr__`. Something like ThreadPoolExecutor(7), 3 workers busy, 0 work items queued. That already makes to easy to get a general picture of how the executor is doing without

[issue22283] AMD64 FreeBSD 9.0 3.x fails to build the _decimal module: #error libmpdec version = 2.4.1 required

2014-08-27 Thread Stefan Krah
Stefan Krah added the comment: Yeah, I know -- I have to release libmpdec-2.4.1. The bot is currently testing the supported configuration that if _decimal fails to build, decimal.py should be used automatically. The tests fail due to #22280, otherwise the bot would be green even with the

[issue22284] decimal module contains less symbols when the _decimal module is missing

2014-08-27 Thread STINNER Victor
New submission from STINNER Victor: While investigation issue #22283, I noticed that when the _decimal is present, the decimal looses its __all__ attribute. dir(decimal) contains 5 more symbols than decimal.__all__: {'ConversionSyntax', 'DecimalTuple', 'DivisionImpossible',

[issue22285] The Modules/ directory should not be added to sys.path

2014-08-27 Thread STINNER Victor
New submission from STINNER Victor: When Python is built from source, the Modules/ subdirectory is added to sys.path on UNIX. I don't understand why: it does not contain .py files nor .so dynamic modules. Dynamic modules are built in build/lib.linux-x86_64-3.5-pydebug. A side effect of

[issue22284] decimal module contains less symbols when the _decimal module is missing

2014-08-27 Thread Stefan Krah
Stefan Krah added the comment: I agree. I plan to fix this as part of #19232. If decimal.py and _decimal are split properly, these things show up immediately. -- nosy: +mark.dickinson ___ Python tracker rep...@bugs.python.org

[issue22284] decimal module contains less symbols when the _decimal module is missing

2014-08-27 Thread Stefan Krah
Changes by Stefan Krah stefan-use...@bytereef.org: -- dependencies: +Speed up _decimal import ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22284 ___

[issue22285] The Modules/ directory should not be added to sys.path

2014-08-27 Thread STINNER Victor
STINNER Victor added the comment: A side effect of this issue is that when the _decimal cannot be build (ex: #22283), the Python implementation of the decimal cannot be used. Extract of buildbot test logs related to #22283: --- Failed to build these modules: _decimal (...) File

[issue22280] _decimal: successful import despite build failure

2014-08-27 Thread STINNER Victor
STINNER Victor added the comment: Oh, it looks like I opened a similar issue: #22285 (with a patch). -- nosy: +haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22280 ___

[issue22285] The Modules/ directory should not be added to sys.path

2014-08-27 Thread STINNER Victor
STINNER Victor added the comment: See also issue #22280 for the case of the wrong _decimal package. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22285 ___

[issue22280] _decimal: successful import despite build failure

2014-08-27 Thread Stefan Krah
Stefan Krah added the comment: Ah nice, let's continue with your issue then. -- resolution: - duplicate stage: - resolved status: open - closed superseder: - The Modules/ directory should not be added to sys.path ___ Python tracker

[issue22285] The Modules/ directory should not be added to sys.path

2014-08-27 Thread Martin v . Löwis
Martin v. Löwis added the comment: The motivation for this feature is that modules built as shared libraries through Modules/Setup end up in Modules, so Modules is added so that they are found. I'd like to preserve support for building dynamic extension modules through Modules/Setup, but

[issue22277] webbrowser.py add parameters to suppress output on stdout and stderr

2014-08-27 Thread Cristian Consonni
Cristian Consonni added the comment: Hi David, at the moment the other parameters used by the open()[1] - 'new' and 'autoraise' - have no direct mapping to other subprocess.Popen(), they are passed as options to the call for the specific browsers. (e.g. firefox -new-tab

[issue22222] dtoa.c: remove custom memory allocator

2014-08-27 Thread STINNER Victor
STINNER Victor added the comment: A modified version of telco.py (using floats instead of decimals) runs about 5-6% slower with the change here. Would it be possible to optimize the pymalloc allocator to reduce this slow-down? -- ___ Python

  1   2   >