[issue13299] namedtuple row factory for sqlite3

2015-01-11 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here is faster implementation. $ ./python -m timeit -s import sqlite3; con = sqlite3.connect(':memory:'); con.row_factory = sqlite3.NamedTupleRow; con.execute('create table t (a, b)') -s for i in range(100): con.execute('insert into t values (1, 2)') --

Re: Python : writing to a file

2015-01-11 Thread Dave Angel
You accidentally did a Reply instead of a Reply-List. So the email came to me and not to the list. if your mail program doesn't support reply-list, do a reply-all and remove the personal addresses. The list is what's important here. On 01/11/2015 12:20 AM, Ganesh Pal wrote: On Sat, Jan

Re: PyWart: Poor Documentation Examples

2015-01-11 Thread Steven D'Aprano
Ethan Furman wrote: On 01/10/2015 06:32 PM, Steven D'Aprano wrote: If you treat your readers as idiots, only idiots will read your writing. Or the morbidly curious, which I presume covers your case (along with a handful of others ;) . Reading Rick is like taking bad drugs. Every time

Re: Help running python tests on MIPS

2015-01-11 Thread Steven D'Aprano
Ramesh wrote: I am new to python. I downloaded python 2.7.8 tarball, successfully cross compiled it, to make sure that the subsystems are correctly built, I tried running the python test scripts on the MIPS based target board. I hit the below error while I do so, On second thoughts, how

Few Coding suggestions - resending

2015-01-11 Thread Ganesh Pal
Hello Team, Iam trying to generate a file which should have the contents in the below format # cat /root/schedule.conf Sunday 10:20 10:30 Sunday 10:30 10:40 Sunday 10:50 10:60 I have to build the above format on the local linux machine using python 2.7 version and then copy the file to the

[issue22932] email.utils.formatdate uses unreliable time.timezone constant

2015-01-11 Thread Dmitry Shachnev
Dmitry Shachnev added the comment: This patch adds a test case for formatdate() function. Before applying issue22932_v3.patch it fails, after applying that patch it succeeds. Sorry for the delay caused by holidays. -- Added file: http://bugs.python.org/file37675/issue22932_test.patch

[issue13583] sqlite3.Row doesn't support slice indexes

2015-01-11 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: May be just use PyObject_GetItem(self-data, idx)? -- nosy: +serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13583 ___

Re: Python : writing to a file

2015-01-11 Thread Peter Otten
Ganesh Pal wrote: On Sun, Jan 11, 2015 at 2:17 PM, Dave Angel da...@davea.name wrote: You chopped off the output there. It probably looked like this: node-1# cat test_2.txt Sundaynode-1# Your output is there, right before the prompt. Since you neglected the newline in your code,

Few coding suggestions

2015-01-11 Thread Ganesh Pal
Hello Team, Iam trying to generate a file which would will should the contents in the below format # cat /root/schedule.conf Sunday 10:20 10:30 Sunday 10:30 10:40 Sunday 10:50 10:60 I have to build the above format on the local linux machine using python 2.7 version and then copy the file

Re: Help running python tests on MIPS

2015-01-11 Thread Steven D'Aprano
Ramesh wrote: I am new to python. I downloaded python 2.7.8 tarball, successfully cross compiled it, to make sure that the subsystems are correctly built, I tried running the python test scripts on the MIPS based target board. I hit the below error while I do so, [...] I tried setting

Re: Python : writing to a file

2015-01-11 Thread Ganesh Pal
On Sun, Jan 11, 2015 at 2:17 PM, Dave Angel da...@davea.name wrote: You chopped off the output there. It probably looked like this: node-1# cat test_2.txt Sundaynode-1# Your output is there, right before the prompt. Since you neglected the newline in your code, that's what you'd

[issue23136] BUG in how _strptime() handles week 0

2015-01-11 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: Added file: http://bugs.python.org/file37674/strptime_julian_none_2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23136 ___

[issue23185] add inf and nan to math module

2015-01-11 Thread Mark Dickinson
Mark Dickinson added the comment: Committed. Thanks for all the helpful review comments! -- resolution: - fixed stage: needs patch - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23185

[issue22952] multiprocessing doc introduction not in affirmative tone

2015-01-11 Thread Antoine Pitrou
Antoine Pitrou added the comment: I've committed your patches, Davin. Thank you for contributing! -- nosy: +pitrou resolution: - fixed stage: patch review - resolved status: open - closed versions: -Python 3.6 ___ Python tracker

[issue23100] multiprocessing doc organization impedes understanding

2015-01-11 Thread Antoine Pitrou
Antoine Pitrou added the comment: I am happy to provide proposed patches but first can someone please clarify for me whether I should have those patches depend upon the patches from Issue 22952? This question is now moot :) -- nosy: +pitrou ___

[issue22932] email.utils.formatdate uses unreliable time.timezone constant

2015-01-11 Thread Akira Li
Akira Li added the comment: @mitya57: Please, combine the code changes, tests, docs into a single rietveld-compatible patch (hg diff); read devguide and http://bugs.python.org/issue13963 Make sure review link appears on the right near the patch. Example: http://bugs.python.org/issue22798

Re: Few Coding suggestions - resending

2015-01-11 Thread Dave Angel
On 01/11/2015 06:47 AM, Ganesh Pal wrote: Hello Team, Iam trying to generate a file which should have the contents in the below format # cat /root/schedule.conf Sunday 10:20 10:30 Sunday 10:30 10:40 Sunday 10:50 10:60 I have to build the above format on the local linux machine using

ANN: python-ldap 2.4.19

2015-01-11 Thread Michael Ströder
Find a new release of python-ldap: http://pypi.python.org/pypi/python-ldap/2.4.19 python-ldap provides an object-oriented API to access LDAP directory servers from Python programs. It mainly wraps the OpenLDAP 2.x libs for that purpose. Additionally it contains modules for other LDAP-related

[issue21902] Docstring of math.acosh, asinh, and atanh

2015-01-11 Thread Roundup Robot
Roundup Robot added the comment: New changeset d81cabb39de3 by Mark Dickinson in branch '2.7': Issue #21902: Replace incorrect 'hyperbolic arc sine' (etc.) with 'inverse hyperbolic sine' (etc.). Remove meaningless reference to radians. https://hg.python.org/cpython/rev/d81cabb39de3 --

DICOM to jpg

2015-01-11 Thread Abdul Abdul
Hello, Is there a way to convert a DICOM file to an image using Python? Thanks. -- https://mail.python.org/mailman/listinfo/python-list

[issue21092] json serializer implicitly stringifies non-string keys

2015-01-11 Thread Mark Dickinson
Mark Dickinson added the comment: Sorry; that last commit message should have been for #21902. -- nosy: +mark.dickinson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21092 ___

[issue21902] Docstring of math.acosh, asinh, and atanh

2015-01-11 Thread Mark Dickinson
Mark Dickinson added the comment: Closing as fixed. -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21902 ___

[issue21902] Docstring of math.acosh, asinh, and atanh

2015-01-11 Thread Mark Dickinson
Mark Dickinson added the comment: Roundup message copied from #21902 (bad issue number): New changeset 36099a05d76a by Mark Dickinson in branch 'default': Issue #21092: Merge from 3.4. https://hg.python.org/cpython/rev/36099a05d76a -- ___ Python

Re: PyWart: Poor Documentation Examples

2015-01-11 Thread Rustom Mody
On Sunday, January 11, 2015 at 10:56:11 AM UTC+5:30, Devin Jeanpierre wrote: On Sat, Jan 10, 2015 at 6:32 PM, Steven D'Aprano wrote: At the point you are demonstrating reduce(), if the reader doesn't understand or can't guess the meaning of n = 4, n+1 or range(), they won't understand

[issue23185] add inf and nan to math module

2015-01-11 Thread Roundup Robot
Roundup Robot added the comment: New changeset cf4bf577749c by Mark Dickinson in branch 'default': Issue #23185: add math.inf and math.nan constants. https://hg.python.org/cpython/rev/cf4bf577749c -- nosy: +python-dev ___ Python tracker

[issue23222] open doesn't provide traceback for int argument

2015-01-11 Thread Ievgen Aleinikov
New submission from Ievgen Aleinikov: HI, I was able to gat such behaviour on python version 3.4.2 and 3.2.3 for i in range(10): ... f = open(i, w) ... f.close() ... This will close interactive session without any output. On python 2 (2.7.9) it's not happening: for i in range(10): ...

[issue23222] open doesn't provide traceback for int argument

2015-01-11 Thread SilentGhost
SilentGhost added the comment: As explained in the docs[1] integer is a valid argument for the open function in the python3. It is also noted that the file descriptor is going to be closed, unless closefd argument to the open function was False, when f.close() is called. This is the behaviour

ANN: python-ldap 2.4.19

2015-01-11 Thread Michael Ströder
Find a new release of python-ldap: http://pypi.python.org/pypi/python-ldap/2.4.19 python-ldap provides an object-oriented API to access LDAP directory servers from Python programs. It mainly wraps the OpenLDAP 2.x libs for that purpose. Additionally it contains modules for other LDAP-related

[issue21902] Docstring of math.acosh, asinh, and atanh

2015-01-11 Thread Roundup Robot
Roundup Robot added the comment: New changeset 5edfc6c929f9 by Mark Dickinson in branch '3.4': Issue #21902: Replace incorrect 'hyperbolic arc sine' (etc.) with 'inverse hyperbolic sine' (etc.). Remove meaningless reference to radians. https://hg.python.org/cpython/rev/5edfc6c929f9 --

VipIMAGE 2015 - ANNOUNCEMENT CALL FOR CONTRIBUTIONS

2015-01-11 Thread tava...@fe.up.pt
Dear Colleague, We are pleased to announce the International Conference VipIMAGE 2015 - V ECCOMAS THEMATIC CONFERENCE ON COMPUTATIONAL VISION AND MEDICAL IMAGE PROCESSING (www.fe.up.pt/~vipimage) to be held October 19-21, 2015, in H10 Costa Adeje Palace, Costa Adeje, Tenerife, Spain. Possible

[issue22952] multiprocessing doc introduction not in affirmative tone

2015-01-11 Thread Roundup Robot
Roundup Robot added the comment: New changeset e7d03a33e675 by Antoine Pitrou in branch '2.7': Issue #22952: improve multiprocessing doc introduction and defer notes until appropriate. https://hg.python.org/cpython/rev/e7d03a33e675 -- ___ Python

[issue22952] multiprocessing doc introduction not in affirmative tone

2015-01-11 Thread Roundup Robot
Roundup Robot added the comment: New changeset a9a9c71f8e15 by Antoine Pitrou in branch '3.4': Issue #22952: improve multiprocessing doc introduction and defer notes until appropriate. https://hg.python.org/cpython/rev/a9a9c71f8e15 New changeset a65c23ea5f9e by Antoine Pitrou in branch

[issue21092] json serializer implicitly stringifies non-string keys

2015-01-11 Thread Roundup Robot
Roundup Robot added the comment: New changeset 36099a05d76a by Mark Dickinson in branch 'default': Issue #21092: Merge from 3.4. https://hg.python.org/cpython/rev/36099a05d76a -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org

Re: PyWart: Poor Documentation Examples

2015-01-11 Thread Dan Sommers
On Sun, 11 Jan 2015 06:20:34 -0800, Rustom Mody wrote: A favorite example of mine is automata-acceptance: If δ : Q × Σ → Q is a transition function F is the set of final states q₀ is the start state and s is a string then reduce(δ,q₀,s) ∈ F expresses automaton accepts string s

[issue23223] subprocess32 unable to be installed via pip

2015-01-11 Thread SilentGhost
Changes by SilentGhost ghost@gmail.com: -- components: +Library (Lib) -Installation nosy: +gregory.p.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23223 ___

[issue23206] json.dumps(ensure_ascii=False) is ~10x slower than json.dumps()

2015-01-11 Thread Antoine Pitrou
Antoine Pitrou added the comment: I get the following compile error: In file included from ./Include/Python.h:48:0, from /home/antoine/cpython/default/Modules/_json.c:1: /home/antoine/cpython/default/Modules/_json.c: In function ‘escape_unicode’:

[issue4395] Document auto __ne__ generation; provide a use case for non-trivial __ne__

2015-01-11 Thread Berker Peksag
Changes by Berker Peksag berker.pek...@gmail.com: -- nosy: +berker.peksag ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4395 ___ ___

[issue21902] Docstring of math.acosh, asinh, and atanh

2015-01-11 Thread Berker Peksag
Changes by Berker Peksag berker.pek...@gmail.com: -- stage: patch review - resolved ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21902 ___ ___

[issue23206] json.dumps(ensure_ascii=False) is ~10x slower than json.dumps()

2015-01-11 Thread Antoine Pitrou
Antoine Pitrou added the comment: The patch was committed in b312b256931e. Thank you! -- resolution: - fixed stage: patch review - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23206

[issue23216] IDLE grep/find/replace source code needs docstrings

2015-01-11 Thread Berker Peksag
Changes by Berker Peksag berker.pek...@gmail.com: -- nosy: +terry.reedy stage: - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23216 ___

[issue23218] Modernize the IDLE Find/Replace/Find in Files dialogs

2015-01-11 Thread Berker Peksag
Changes by Berker Peksag berker.pek...@gmail.com: -- nosy: +terry.reedy stage: - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23218 ___

Re: PyWart: Poor Documentation Examples

2015-01-11 Thread Chris Angelico
On Mon, Jan 12, 2015 at 3:04 AM, Grant Edwards invalid@invalid.invalid wrote: On 2015-01-10, Chris Angelico ros...@gmail.com wrote: 1) Why are you focusing on the /2/ docs, rather than /3/? 2) Why are you ranting, rather than submitting docs patches? 3) There are still people who read RR

Re: PyWart: Poor Documentation Examples

2015-01-11 Thread Michael Torrie
On 01/11/2015 09:04 AM, Grant Edwards wrote: 3) There are still people who read RR posts? The last post by RR helping someone with a tk problem was very helpful, and rather elucidating, as are most of his post on tk. It was rather refreshing to see several posts like this. I thought perhaps

[issue23223] subprocess32 unable to be installed via pip

2015-01-11 Thread gajdig
New submission from gajdig: The latest subprocess32, 3.2.6, is unable to be installed in Windows 7 via pip. The error messages: _posixsubprocess.c(10) : fatal error C1083: Cannot open include file: 'unistd.h': No such file or directory error: command

Re: PyWart: Poor Documentation Examples

2015-01-11 Thread Grant Edwards
On 2015-01-10, Chris Angelico ros...@gmail.com wrote: On Sun, Jan 11, 2015 at 5:05 AM, Rick Johnson rantingrickjohn...@gmail.com wrote: EXAMPLE 1: Reducing Comprehension

Re: PyWart: Poor Documentation Examples

2015-01-11 Thread Chris Angelico
On Mon, Jan 12, 2015 at 4:11 AM, Michael Torrie torr...@gmail.com wrote: The last post by RR helping someone with a tk problem was very helpful, and rather elucidating, as are most of his post on tk. ... Now perhaps there are two RRs, in some sort of conflict in the same person. Sad to see

extracting numbers with decimal places from a string

2015-01-11 Thread Store Makhzan
I have this script which can calculate the total of numbers given in a string script - total = 0 for c in '0123456789': total += int(c) print total script - How should I modify this script to find the total of if the numbers given in the string form have decimal places? That

Re: Generate jpg files using line length (pixels) and orientation (degrees)

2015-01-11 Thread semeon . risom
On Saturday, 10 January 2015 21:31:25 UTC-6, Denis McMahon wrote: On Fri, 09 Jan 2015 09:49:25 -0800, semeon.risom wrote: Thank you for the help btw. I think I'm close to a solution, but I'm having issue feeding the coordinates from my csv file into the formula. This is the error I

Re: Generate jpg files using line length (pixels) and orientation (degrees)

2015-01-11 Thread Denis McMahon
On Sun, 11 Jan 2015 11:41:28 -0800, semeon.risom wrote: The code is working correctly. Thank you! The only change I had to make was referring to it as a float instead of an integer. The images are generating, however I'm noticing that it's making an image for every possible pair in each

Re: extracting numbers with decimal places from a string

2015-01-11 Thread Joel Goldstick
On Sun, Jan 11, 2015 at 2:31 PM, Store Makhzan stor...@gmail.com wrote: I have this script which can calculate the total of numbers given in a string script - total = 0 for c in '0123456789': total += int(c) print total script - How should I modify this script to find

Re: PyWart: Poor Documentation Examples

2015-01-11 Thread Rustom Mody
On Sunday, January 11, 2015 at 10:49:11 PM UTC+5:30, Chris Angelico wrote: On Mon, Jan 12, 2015 at 4:11 AM, Michael Torrie wrote: The last post by RR helping someone with a tk problem was very helpful, and rather elucidating, as are most of his post on tk. ... Now perhaps there are two

Re: Few coding suggestions

2015-01-11 Thread Denis McMahon
On Sun, 11 Jan 2015 17:14:35 +0530, Ganesh Pal wrote: (a) How do I modify the output to have an another column with a difference of 5 mins I'm not sure I understand the problem you're trying to solve, and it seems to me that you are presenting your problem in terms of your partial solution.

Re: PyWart: Poor Documentation Examples

2015-01-11 Thread Mark Lawrence
On 11/01/2015 16:04, Grant Edwards wrote: On 2015-01-10, Chris Angelico ros...@gmail.com wrote: On Sun, Jan 11, 2015 at 5:05 AM, Rick Johnson rantingrickjohn...@gmail.com wrote: EXAMPLE 1: Reducing Comprehension

[issue23163] pdb docs need to contain a statement on threads/multithreaded debugging

2015-01-11 Thread Karl Richter
Karl Richter added the comment: Sorry, I mean #!/usr/bin/python import threading def debugging(): def __a_thread__(): print(2) a_thread = threading.Thread(target=__a_thread__) a_thread.start() a_thread.join() print(1) if

[issue23163] pdb docs need to contain a statement on threads/multithreaded debugging

2015-01-11 Thread Karl Richter
Karl Richter added the comment: My initial description was imprecise. Clearification: The fact that in #!/usr/bin/python import threading def debugging(): def __a_thread__(): print(2) a_thread = threading.Thread(target=__a_thread__) print(1)

Re: Using a ChangeLog as a canonical source of package metadata (was: Announce: PyPrimes 0.2.1a)

2015-01-11 Thread Steven D'Aprano
Ben Finney wrote: [...] The perils of duplicate sources of information: a Changelog makes claims about which version is latest, but the packaging metadata comes from somewhere else. This problem is addressed quite well, in my opinion, by the Debian packaging tools. The tools by default read

Re: Help running python tests on MIPS

2015-01-11 Thread rramesh1
On Sunday, January 11, 2015 at 1:45:33 AM UTC-8, Steven D'Aprano wrote: Ramesh wrote: I am new to python. I downloaded python 2.7.8 tarball, successfully cross compiled it, to make sure that the subsystems are correctly built, I tried running the python test scripts on the MIPS based

]beginer] what i need to code simple graphics?

2015-01-11 Thread fir
what i need to code simple graphic in python? Im totally new in python, though im moderately experienced in c 2d perpixel graphic probably, or other kind of graphic too -- https://mail.python.org/mailman/listinfo/python-list

Re: Help running python tests on MIPS

2015-01-11 Thread rramesh1
On Sunday, January 11, 2015 at 1:39:20 AM UTC-8, Steven D'Aprano wrote: Ramesh wrote: I am new to python. I downloaded python 2.7.8 tarball, successfully cross compiled it, to make sure that the subsystems are correctly built, I tried running the python test scripts on the MIPS based

[issue23220] IDLE does not display \b backspace correctly.

2015-01-11 Thread Carol Willing
Carol Willing added the comment: Ned, Thanks for the detailed example and confirming my gut instinct that Tk was the root cause of the differences seen between the IDLE's Python interactive shell (https://docs.python.org/3.4/library/idle.html) and the interactive interpreter invoked from the

Re: Generate jpg files using line length (pixels) and orientation (degrees)

2015-01-11 Thread Dave Angel
On 01/11/2015 02:41 PM, semeon.ri...@gmail.com wrote: On Saturday, 10 January 2015 21:31:25 UTC-6, Denis McMahon wrote: # using lists of values for length in a: for orientation in b: makeimg(length, orientation) -- Denis McMahon, denismfmcma...@gmail.com The code is working

Re: Using a ChangeLog as a canonical source of package metadata

2015-01-11 Thread Ben Finney
Steven D'Aprano steve+comp.lang.pyt...@pearwood.info writes: I currently read this metadata from the Python code itself. The advantages of putting the metadata into the source code include: - the source code is the definitive source of information about itself; The Changelog document should

Re: extracting numbers with decimal places from a string

2015-01-11 Thread Store Makhzan
On Sunday, January 11, 2015 at 2:06:54 PM UTC-6, Joel Goldstick wrote: On Sun, Jan 11, 2015 at 2:31 PM, Store Makhzan wrote: I have this script which can calculate the total of numbers given in a string script - total = 0 for c in '0123456789': total += int(c) print

Re: DICOM to jpg

2015-01-11 Thread Dan Stromberg
On Sun, Jan 11, 2015 at 5:01 AM, Abdul Abdul abdul.s...@gmail.com wrote: Hello, Is there a way to convert a DICOM file to an image using Python? Thanks. Does GDCM do what you need? http://gdcm.sourceforge.net/wiki/index.php/Main_Page -- https://mail.python.org/mailman/listinfo/python-list

[issue23180] Rename IDLE's Windows menu item to Window

2015-01-11 Thread Ned Deily
Ned Deily added the comment: Also, the IDLE help text file (Lib/idlelib/help.txt) and the IDLE documentation in the Standard Library Reference (Doc/library/idle.rst) refer to the Windows menu and would need to be updated. -- nosy: +ned.deily ___

Re: extracting numbers with decimal places from a string

2015-01-11 Thread Joel Goldstick
On Sun, Jan 11, 2015 at 6:12 PM, Thomas 'PointedEars' Lahn pointede...@web.de wrote: Joel Goldstick wrote: Thomas 'PointedEars' Lahn wrote: Joel Goldstick wrote: my_list = 1.23, 2.4, 3.123.split(,) that will give you ['1.23', '2.4', '3.123'] No, it gives […] | my_list = 1.23, 2.4,

[issue15955] gzip, bz2, lzma: add option to limit output size

2015-01-11 Thread Martin Panter
Martin Panter added the comment: We still need a patch for max_length in BZ2Decompressor, and to use it in BZ2File. Also, I think my GzipFile patch should be considered as a bug fix (rather than enhancement), e.g. the fix for Issue 16043 assumes GzipFile.read(size) is limited. I’m adding v4

[issue23180] Rename IDLE's Windows menu item to Window

2015-01-11 Thread Al Sweigart
Al Sweigart added the comment: Added another patch for the documentation changes for the menu renaming. -- Added file: http://bugs.python.org/file37679/idle_window_doc_rename.diff ___ Python tracker rep...@bugs.python.org

Re: MS-DOS Commands

2015-01-11 Thread Gary Herron
On 01/11/2015 02:13 PM, Jenacee Owens wrote: I'm new to python and every time i type a command into the MS-DOS Commands it looks like this. strings Tracebackmost recent call last: file stdin;line 1 in module name error:name strings'is not defined how can i fix this? What where you

Re: extracting numbers with decimal places from a string

2015-01-11 Thread Thomas 'PointedEars' Lahn
Joel Goldstick wrote: On Sun, Jan 11, 2015 at 6:12 PM, Thomas 'PointedEars' Lahn pointede...@web.de wrote: Joel Goldstick wrote: Am I missing something. ^ […] You are missing a leading space character because in the string the comma was followed by one. I see

Re: extracting numbers with decimal places from a string

2015-01-11 Thread Mark Lawrence
On 11/01/2015 23:07, Thomas 'PointedEars' Lahn wrote: Store Makhzan wrote: I have this script which can calculate the total of numbers given in a string […] total = 0 for c in '0123456789': total += int(c) print total […] How should I modify this script to find the total of if the numbers

Re: extracting numbers with decimal places from a string

2015-01-11 Thread Thomas 'PointedEars' Lahn
Mark Lawrence wrote: On 11/01/2015 23:07, Thomas 'PointedEars' Lahn wrote: I thought I had more than a fair grasp of regular expressions, but I am puzzled by | $ python3 | Python 3.4.2 (default, Dec 27 2014, 13:16:08) | [GCC 4.9.2] on linux | from re import findall | s = '1.32, 5.32,

List of python -m tools

2015-01-11 Thread Miki Tebeka
Greetings, I've compiled a list of python -m tools at pythonwise.blogspot.com/2015/01/python-m.html. Did I miss something? What are your favorite python -m tools? Thanks, -- Miki -- https://mail.python.org/mailman/listinfo/python-list

Re: extracting numbers with decimal places from a string

2015-01-11 Thread Chris Angelico
On Mon, Jan 12, 2015 at 11:09 AM, Peter Otten __pete...@web.de wrote: print(sum(map(lambda x: float(x), s.split(','))) Please trim your quotes to the relevant minimum. Hm, can you explain what this lambda x: float(x) is supposed to achieve? I mean other than to confuse a newbie...

[issue23224] LZMADecompressor object is only initialized in __init__

2015-01-11 Thread Martin Panter
New submission from Martin Panter: Noticed in a patch review around LZMModules/_lzmamodule.c:1055 that the C-level LZMADecompressor object is being initialized in an __init__() method. It crashes if you create the object with __new__() and never call __init__(): from lzma import

[issue23018] Add version info to python[w].exe

2015-01-11 Thread Steve Dower
Steve Dower added the comment: Anyone have any opinions on this? My only hesitation is adding the Windows 10 UUID, which will fix GetVersion but may cause other API problems, and we're certainly not testing against Windows 10 yet. (On the other hand, it's easy enough to remove that single

[issue18003] lzma module very slow with line-oriented reading.

2015-01-11 Thread Martin Panter
Martin Panter added the comment: I haven’t done any tests, but my LZMAFile patch to Issue 15955 uses BufferedReader, so it might satisfy this issue -- nosy: +vadmium ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18003

Re: extracting numbers with decimal places from a string

2015-01-11 Thread Thomas 'PointedEars' Lahn
Joel Goldstick wrote: my_list = 1.23, 2.4, 3.123.split(,) that will give you ['1.23', '2.4', '3.123'] No, it gives | $ python | Python 2.7.9 (default, Dec 11 2014, 08:58:12) | [GCC 4.9.2] on linux2 | Type help, copyright, credits or license for more information. | my_list = 1.23, 2.4,

[issue21896] Unexpected ConnectionResetError in urllib.request against a valid website

2015-01-11 Thread Ned Deily
Ned Deily added the comment: So it does. Thanks, Martin. -- resolution: - not a bug stage: - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21896 ___

[issue22495] merge large parts of test_binop.py and test_fractions.py

2015-01-11 Thread Martin Panter
Changes by Martin Panter vadmium...@gmail.com: -- nosy: +vadmium ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22495 ___ ___ Python-bugs-list

[issue20285] Improve object.__doc__ and help(object) output

2015-01-11 Thread Martin Panter
Changes by Martin Panter vadmium...@gmail.com: -- nosy: +vadmium ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20285 ___ ___ Python-bugs-list

Re: Few Coding suggestions - resending

2015-01-11 Thread Ganesh Pal
On Sun, Jan 11, 2015 at 7:57 PM, Dave Angel da...@davea.name wrote: No idea how that represents a difference of 5 minutes. So I'll take a totally wild guess that you meant: Sunday 23:50 23:55 Monday 00:00 00:05 Monday 00:10 00:15 Monday 00:20 00:25 Monday 00:30 00:35 which would have

MS-DOS Commands

2015-01-11 Thread Jenacee Owens
I'm new to python and every time i type a command into the MS-DOS Commands it looks like this. strings Tracebackmost recent call last: file stdin;line 1 in module name error:name strings'is not defined how can i fix this? -- https://mail.python.org/mailman/listinfo/python-list

Re: MS-DOS Commands

2015-01-11 Thread Ian Kelly
On Sun, Jan 11, 2015 at 3:13 PM, Jenacee Owens jenaceerow...@gmail.com wrote: I'm new to python and every time i type a command into the MS-DOS Commands it looks like this. strings Tracebackmost recent call last: file stdin;line 1 in module name error:name strings'is not defined That

Re: extracting numbers with decimal places from a string

2015-01-11 Thread Thomas 'PointedEars' Lahn
Joel Goldstick wrote: Thomas 'PointedEars' Lahn wrote: Joel Goldstick wrote: my_list = 1.23, 2.4, 3.123.split(,) that will give you ['1.23', '2.4', '3.123'] No, it gives […] | my_list = 1.23, 2.4, 3.123.split(,) | my_list | ['1.23', ' 2.4', ' 3.123'] ^ ^ |

Re: extracting numbers with decimal places from a string

2015-01-11 Thread MRAB
On 2015-01-12 00:04, Mark Lawrence wrote: On 11/01/2015 23:07, Thomas 'PointedEars' Lahn wrote: Store Makhzan wrote: I have this script which can calculate the total of numbers given in a string […] total = 0 for c in '0123456789': total += int(c) print total […] How should I modify this

[issue22495] merge large parts of test_binop.py and test_fractions.py

2015-01-11 Thread Martin Panter
Martin Panter added the comment: Yeah it would be good to put related tests in the one place. I was trying to find a good place to test how the comparison operators invoke the __eq__(), __gt__() etc methods, and the existing tests seem to be spread over test_compare.py and test_binop.py.

[issue22662] subprocess.Popen.communicate causing local tty terminal settings to change inconsistently

2015-01-11 Thread Martin Panter
Martin Panter added the comment: I tried in Python 2.7.9 on Linux, with env = TERM=xterm, cmd = date, and couldn’t get any of those seven terminal settings to be turned off -- nosy: +vadmium ___ Python tracker rep...@bugs.python.org

[issue22977] Unformatted “Windows Error 0x%X” exception message on Wine

2015-01-11 Thread Martin Panter
Martin Panter added the comment: Here’s a simple patch which should fix it, although I have not verified this because I don’t have a Windows compiler (and MINGW cross compiling sounds too tricky) -- keywords: +patch Added file: http://bugs.python.org/file37678/win-error-format.patch

Re: annoying doctest problem

2015-01-11 Thread gordianknot1981
gordian...@gmail.com於 2015年1月12日星期一 UTC+8下午12時20分46秒寫道: #!/usr/bin/python # -*- coding: utf-8 -*- import re kivy_class_ptn = re.compile(r\b[\w_.\@\+]+:?) def test_kivy_class(s): s = MYBT@ToggleButton+Button: test_kivy_class(s) MYBT@ToggleButton+Button:

Re: extracting numbers with decimal places from a string

2015-01-11 Thread Joel Goldstick
On Sun, Jan 11, 2015 at 5:20 PM, Thomas 'PointedEars' Lahn pointede...@web.de wrote: Joel Goldstick wrote: my_list = 1.23, 2.4, 3.123.split(,) that will give you ['1.23', '2.4', '3.123'] No, it gives | $ python | Python 2.7.9 (default, Dec 11 2014, 08:58:12) | [GCC 4.9.2] on linux2 |

Re: MS-DOS Commands

2015-01-11 Thread Mark Lawrence
On 11/01/2015 22:13, Jenacee Owens wrote: I'm new to python and every time i type a command into the MS-DOS Commands it looks like this. strings Tracebackmost recent call last: file stdin;line 1 in module name error:name strings'is not defined how can i fix this? Others have already

Re: extracting numbers with decimal places from a string

2015-01-11 Thread Peter Otten
Thomas 'PointedEars' Lahn wrote: Joel Goldstick wrote: On Sun, Jan 11, 2015 at 6:12 PM, Thomas 'PointedEars' Lahn pointede...@web.de wrote: Joel Goldstick wrote: Am I missing something. ^ […] You are missing a leading space character because in the string the

[issue17239] XML vulnerabilities in Python

2015-01-11 Thread Martin Panter
Changes by Martin Panter vadmium...@gmail.com: -- nosy: +vadmium ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17239 ___ ___ Python-bugs-list

[issue23182] Update grammar tests to use new style for annotated function definitions

2015-01-11 Thread Berker Peksag
Changes by Berker Peksag berker.pek...@gmail.com: -- nosy: +berker.peksag stage: - patch review versions: +Python 3.5 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23182 ___

Re: MS-DOS Commands

2015-01-11 Thread Joel Goldstick
On Sun, Jan 11, 2015 at 5:13 PM, Jenacee Owens jenaceerow...@gmail.com wrote: I'm new to python and every time i type a command into the MS-DOS Commands it looks like this. strings Tracebackmost recent call last: file stdin;line 1 in module name error:name strings'is not defined how

[issue21896] Unexpected ConnectionResetError in urllib.request against a valid website

2015-01-11 Thread Martin Panter
Martin Panter added the comment: Not a Python bug. The web site seems to be doing this based on the user agent; if you change it, it works: urlopen(Request(http://www.thomsonlocal.com/;, headers={User-Agent: https://bugs.python.org/issue21896})) -- nosy: +vadmium type: crash -

annoying doctest problem

2015-01-11 Thread gordianknot1981
#!/usr/bin/python # -*- coding: utf-8 -*- import re kivy_class_ptn = re.compile(r\b[\w_.\@\+]+:?) def test_kivy_class(s): s = MYBT@ToggleButton+Button: test_kivy_class(s) MYBT@ToggleButton+Button: s = MYBT test_kivy_class(s) MYBT ret =

Re: extracting numbers with decimal places from a string

2015-01-11 Thread Joel Goldstick
On Sun, Jan 11, 2015 at 3:26 PM, Store Makhzan stor...@gmail.com wrote: On Sunday, January 11, 2015 at 2:06:54 PM UTC-6, Joel Goldstick wrote: On Sun, Jan 11, 2015 at 2:31 PM, Store Makhzan wrote: I have this script which can calculate the total of numbers given in a string script

[issue23214] BufferedReader.read1(size) signature incompatible with BufferedIOBase.read1(size=-1)

2015-01-11 Thread Martin Panter
Martin Panter added the comment: Looking at the test suite: * read1() of LZMAFile and GzipFile (both implementing BufferedIOBase) are asserted to return a non-zero result until EOF * LZMAFile.read1(0) is asserted to return an empty string * BufferedReader.read1(-1) is asserted to raise

  1   2   >