Re: psss...I want to move from Perl to Python

2016-01-29 Thread Steven D'Aprano
On Fri, 29 Jan 2016 11:21 pm, Ulli Horlacher wrote: > Most tutorials I found so far makes OO mandatory. You should have started with the official tutorial: https://docs.python.org/2/tutorial/ which doesn't get into classes until Chapter 9, after: - using Python as a calculator; - numbers,

[issue26039] More flexibility in zipfile interface

2016-01-29 Thread Thomas Kluyver
Thomas Kluyver added the comment: Here's a new version of the zf.open() patch following Martin's review (thanks Martin!). I agree that it feels a bit awkward having two completely different actions for zf.open(), but it is a familiar interface, and since the mode parameter is already there,

Re: psss...I want to move from Perl to Python

2016-01-29 Thread Ulli Horlacher
James Harris wrote: > I nearly gave up with Python at the very beginning before I realised not > to mix tabs and spaces. I nearly gave up with Python at the very beginning before I realised that OO-programming is optional in Python! :-) Most tutorials I found so far

Re: show instant data on webpage

2016-01-29 Thread Joel Goldstick
On Fri, Jan 29, 2016 at 6:48 AM, mustang wrote: > > Then I'd use gnuplot or matplotlib. >> >> ok, but then I can upload/plot them online? > -- > https://mail.python.org/mailman/listinfo/python-list > Confusing mustang. You said: anyway I'm not interested in building website

[issue23548] TypeError in event loop finalizer, new in Python 3.4.3

2016-01-29 Thread 山本泰宇
山本泰宇 added the comment: > I may workaround the bug during Python finalization if more users report this > issue. +1 in my project: https://github.com/cybozu/passh/issues/1 Anyway, I'd like to express my gratitude to asyncio. -- nosy: +山本泰宇 ___

[issue12912] xmlrpclib.__version__ not bumped with updates

2016-01-29 Thread Berker Peksag
Berker Peksag added the comment: xmlrpc.client.__version__ is used by Transport.user_agent and it has been changed to use sys.version[:3] in 197d703fb23e. It's too late for 2.7 so I think this can be closed now. Thanks for the report, Rob! -- nosy: +berker.peksag resolution: -> out

[issue26039] More flexibility in zipfile interface

2016-01-29 Thread Thomas Kluyver
Changes by Thomas Kluyver : Added file: http://bugs.python.org/file41753/zipinfo-from-file3.patch ___ Python tracker ___

Re: psss...I want to move from Perl to Python

2016-01-29 Thread James Harris
On 29/01/2016 09:12, Ulli Horlacher wrote: Steven D'Aprano wrote: Every time I make a half-hearted attempt to learn enough Perl syntax to get started, I keep running into the differences between $foo, %foo and @foo and dire warnings about what happens if you use the wrong

[issue25698] The copy_reg module becomes unexpectedly empty in test_cpickle

2016-01-29 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- priority: normal -> high stage: -> patch review ___ Python tracker ___

Re: show instant data on webpage

2016-01-29 Thread mustang
Then I'd use gnuplot or matplotlib. ok, but then I can upload/plot them online? -- https://mail.python.org/mailman/listinfo/python-list

Pyhon Icon

2016-01-29 Thread Walter Nakatana
Good day, Every time I install python , I don't see the icon on my desktop neither in my C: drive Have a great day Kind Regards, Walter Nakatana IT Help-Desk Administrator Meat Corporation of Namibia, MEATCO Tel : +264 (0)61 321 6459 Fax : +264 (0)61 321 6401 Mobile : +264 (0)81 744 7474

[issue26237] UnboundLocalError error while handling exception

2016-01-29 Thread Марк Коренберг
New submission from Марк Коренберг: This works right in Python 2.7, but fails in python3: UnboundLocalError: local variable 'e' referenced before assignment def test(): try: raise Exception('a') except Exception as e: pass else: return print(e) test()

[issue26237] UnboundLocalError error while handling exception

2016-01-29 Thread STINNER Victor
STINNER Victor added the comment: Yes, it's a deliberate change in the Python language. You have to copy "e" to a different variable: err = None try: ... except Exception as exc: err = exc print(err) -- nosy: +haypo resolution: -> not a bug status: open -> closed

new devpi releases (2.6.0) with pip-search/offline mode support

2016-01-29 Thread holger krekel
This trinity release of devpi, the private packaging and workflow system, is drop-in compatible to earlier releases and comes with these improvements: - support for pip search on the server side which is also configured when "devpi use" writes to pip configuration files. - explicit

Re: Question about asyncio and blocking operations

2016-01-29 Thread Maxime Steisel
Le 28 janv. 2016 22:52, "Ian Kelly" a écrit : > > On Thu, Jan 28, 2016 at 2:23 PM, Maxime S wrote: > > > > 2016-01-28 17:53 GMT+01:00 Ian Kelly : > >> > >> On Thu, Jan 28, 2016 at 9:40 AM, Frank Millman

Re: Question about asyncio and blocking operations

2016-01-29 Thread Frank Millman
"Frank Millman" wrote in message news:n8et0d$hem$1...@ger.gmane.org... I have read the other messages, and I can see that there are some clever ideas there. However, having found something that seems to work and that I feel comfortable with, I plan to run with this for the time being. A

[issue26238] httplib use wrong hostname in https request with SNI support

2016-01-29 Thread lirenke
New submission from lirenke: httplib give openssl SNI extension message like IP:PORT string. the apache server would return 400 code if SNI/request ServerName mismatch. In class HTTPSConnection, we hope call self._get_hostport() before give the value to server_hostname. === if

[issue26173] test_ssl.bad_cert_test() exception handling

2016-01-29 Thread Martin Panter
Martin Panter added the comment: I was mistaken about what test_wrong_cert() is doing. It tells the _server_ to check the _client’s_ certificate (the opposite way around from HTTPS for example). Now I understand this, I see it is fine for the client to raise ECONNRESET if the server rejected

[issue26168] Py_BuildValue may leak 'N' arguments on PyTuple_New failure

2016-01-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Current code already decref obj if creating previous argument is failed. But a leak if PyTuple_New() fails is possible. Proposed patch fixes this leak and adds a test for the case when creating previous argument is failed. Testing the failure of

[issue26125] Incorrect error message in the module asyncio.selector_events.

2016-01-29 Thread Berker Peksag
Berker Peksag added the comment: https://github.com/python/asyncio/pull/313 has been merged. Do we need to commit this patch to the CPython repo or will it be merged with the next sync? (e.g. f4fe55dd5659) -- nosy: +berker.peksag ___ Python tracker

[issue26227] Windows: socket.gethostbyaddr(name) fails for non-ASCII hostname

2016-01-29 Thread Emanuel Barry
Emanuel Barry added the comment: For future reference, Victor's patch does fix it, I was checking the wrong thing when testing. -- ___ Python tracker

Error message

2016-01-29 Thread Emeka Ikele
Please I downloaded Python 3.5 (32 bit) for Windows software. I installed it but it keeps giving me an error message that a file was not found and I should please re-install to fix the problem. I've tried that severally but to no avail. Please what can I do or should I just install the 2.7

[issue25698] The copy_reg module becomes unexpectedly empty in test_cpickle

2016-01-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: One solution is to skip tests caused deep recursion. The better solution would be to fix import machinery to not produce empty modules. -- keywords: +patch Added file: http://bugs.python.org/file41748/issue25698_skip_tests.patch

Re: psss...I want to move from Perl to Python

2016-01-29 Thread Jussi Piitulainen
Fillmore writes: > Does Python have Regexps? Start by importing the re module (as said). Find its documentation at the following link (together with a list of many other modules that come standard with Python). Also, once imported to the interactive session, help(re), dir(re).

Getting VS2015 to work with arcpy

2016-01-29 Thread Paul Schrum
I have posted this question on stackoverflow, but I think I may be more likely to get help in the mailing list: http://stackoverflow.com/questions/35069640/getting-vs2015-to-work-with-arcpy Getting VS2015 to work with arcpy

>>> %matplotlib inline results in SyntaxError: invalid syntax

2016-01-29 Thread Mike S via Python-list
I have installed Python 3.4.4 on XPSP3 and am trying to work my way through this tutorial. A Complete Tutorial on Ridge and Lasso Regression in Python http://www.analyticsvidhya.com/blog/2016/01/complete-tutorial-ridge-lasso-regression-python/ In Step 2 "Why Penalize the Magnitude of

Re: >>> %matplotlib inline results in SyntaxError: invalid syntax

2016-01-29 Thread Steven D'Aprano
On Fri, 29 Jan 2016 06:04 pm, Mike S wrote: > %matplotlib inline > > I get an error on the last line. I am running this code in Idle Python > 3.4.4 Shell... > > Python 3.4.4 (v3.4.4:737efcadf5a6, Dec 20 2015, 19:28:18) [MSC v.1600 32 > bit (Intel)] on win32 > Type "copyright", "credits" or

Re: >>> %matplotlib inline results in SyntaxError: invalid syntax

2016-01-29 Thread Mike S via Python-list
On 1/28/2016 11:57 PM, Steven D'Aprano wrote: On Fri, 29 Jan 2016 06:04 pm, Mike S wrote: %matplotlib inline I get an error on the last line. I am running this code in Idle Python 3.4.4 Shell... Python 3.4.4 (v3.4.4:737efcadf5a6, Dec 20 2015, 19:28:18) [MSC v.1600 32 bit (Intel)] on win32

Re: psss...I want to move from Perl to Python

2016-01-29 Thread Chris Angelico
On Fri, Jan 29, 2016 at 6:12 PM, Steven D'Aprano wrote: > On Fri, 29 Jan 2016 11:25 am, Chris Angelico wrote: > >> Probably the biggest thing to take note of is the Python object model >> - how names and objects and assignment work. It's pretty >> straight-forward, but if

Re: psss...I want to move from Perl to Python

2016-01-29 Thread Ulli Horlacher
Steven D'Aprano wrote: > Every time I make a half-hearted attempt to learn enough Perl syntax to get > started, I keep running into the differences between $foo, %foo and @foo > and dire warnings about what happens if you use the wrong sigil I have started learning Python

[ANN] Gajja 0.1: Fake objects for real tests

2016-01-29 Thread Ben Finney
Howdy all, I am pleased to announce the first release of the testing library I've named Gajja . Its purpose is to allow fine-grained control of not only file content, but metadata and system access behaviour, for in-memory test doubles. Currently it

[issue25698] The copy_reg module becomes unexpectedly empty in test_cpickle

2016-01-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here is a patch that makes import machinery to not left empty module in case of recursion error. I prefer this solution. -- Added file: http://bugs.python.org/file41750/issue25698_fix_remove_module.patch ___

Python 3.5.1

2016-01-29 Thread Joel Cotto
Hi, I'm using the new release of python ver 3.5.1 but i got problem using its code to communicate w/ serial port. I'm receiving port error. Hope you can guide me if there are change made in the command. Thanks and Good Day import serial ser = 0 def init_serial(): COMNUM = 1 global ser ser =

[issue26039] More flexibility in zipfile interface

2016-01-29 Thread Thomas Kluyver
Thomas Kluyver added the comment: Thanks Serhiy for review comments. -- Added file: http://bugs.python.org/file41754/zipinfo-from-file4.patch ___ Python tracker

[issue26227] Windows: socket.gethostbyaddr(name) fails for non-ASCII hostname

2016-01-29 Thread STINNER Victor
STINNER Victor added the comment: He he, no problem. Thanks again for the bug report. I'm surprised that nobody reported it before. -- ___ Python tracker

[issue26229] Make number serialization ES6/V8 compatible

2016-01-29 Thread Eric V. Smith
Eric V. Smith added the comment: Do you have a pointer to the spec which requires -0 vs. -3.333e+20, for example? -- nosy: +eric.smith ___ Python tracker

[issue26125] Incorrect error message in the module asyncio.selector_events.

2016-01-29 Thread Guido van Rossum
Guido van Rossum added the comment: Usually Yury or Victor takes care of this sooner or later. If you want to you can keep this open as a release blocker with that as a task. -- ___ Python tracker

Re: Pyhon Icon

2016-01-29 Thread Joel Goldstick
On Fri, Jan 29, 2016 at 6:00 AM, Walter Nakatana wrote: > Good day, > > Every time I install python , I don't see the icon on my desktop neither > in my C: drive > > > Try searching the list. There are dozens of questions and answers about installing python on windows.

Re: Python 3.5.1

2016-01-29 Thread Joel Goldstick
On Fri, Jan 29, 2016 at 10:35 AM, Joel Cotto wrote: > Hi, > > I'm using the new release of python ver 3.5.1 but i got problem using its > code to communicate w/ serial port. I'm receiving port error. Hope you can > guide me if there are change made in the command. Thanks

[issue1475692] replacing obj.__dict__ with a subclass of dict

2016-01-29 Thread Torsten Landschoff
Torsten Landschoff added the comment: I just bumped into this issue because I was shown by a colleague that my implementation of immutable objects (by replacing __dict__ with an ImmutableDict that inherits from dict and blocks write accesses) is ineffective - ouch! I'd expect that Python

Re: Pyhon Icon

2016-01-29 Thread Oscar Benjamin
On 29 January 2016 at 11:00, Walter Nakatana wrote: > Every time I install python , I don't see the icon on my desktop neither in > my C: drive Hi Walter, I guess you're using Windows. There are many different ways to run Python. One way that beginners often use is to

[issue26155] 3.5.1 installer issue on Win 7 32 bit

2016-01-29 Thread Steve Dower
Steve Dower added the comment: Looks like the log files were attached just fine. >From a first glance, the logs don't show anything being installed into your >documents folder. Could you list the files you are seeing, where they are and where you believe they should be? --

Re: psss...I want to move from Perl to Python

2016-01-29 Thread Random832
On Fri, Jan 29, 2016, at 04:12, Ulli Horlacher wrote: > Steven D'Aprano wrote: > > > Every time I make a half-hearted attempt to learn enough Perl syntax to get > > started, I keep running into the differences between $foo, %foo and @foo > > and dire warnings about what

Re: psss...I want to move from Perl to Python

2016-01-29 Thread Sven R. Kunze
Hi, On 29.01.2016 01:01, Fillmore wrote: I look and Python and it looks so much more clean add to that that it is the language of choice of data miners... add to that that iNotebook looks powerful All true. :) Does Python have Regexps? "import re"

[issue23601] use small object allocator for dict key storage

2016-01-29 Thread Tim Peters
Tim Peters added the comment: +1 from me. Julian, you have the patience of a saint ;-) -- ___ Python tracker ___

[issue1475692] replacing obj.__dict__ with a subclass of dict

2016-01-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Python uses concrete class API (PyDict_GetItem and like) for resolving attributes. Using general mapping API would slow down attribute lookup in common case. This is performance critical part of Python and we should be very careful changing it. On the

[issue26180] multiprocessing.util._afterfork_registry leak in threaded environment

2016-01-29 Thread Nir Soffer
Changes by Nir Soffer : -- nosy: +nirs ___ Python tracker ___ ___ Python-bugs-list mailing

Re: psss...I want to move from Perl to Python

2016-01-29 Thread Cody Piersall
On Fri, Jan 29, 2016 at 2:42 PM, Fillmore wrote: > I actually have a few followup question. > - will iNotebook also work in Python 3? Yes! And just FYI, it's called they Jupyter Notebook now, but pretty much everyone still (colloquially) calls it the IPython

[issue26239] distutils link-objects is not normalized

2016-01-29 Thread Jeremy Fergason
New submission from Jeremy Fergason: When giving setup.cfg a link-objects argument build fails with an error message about cannot concatenate string with list. Need to add the following line to: Lib/distutils/command/build_ext.py self.ensure_string_list('link_objects') See patch here:

Re: psss...I want to move from Perl to Python

2016-01-29 Thread MRAB
On 2016-01-30 00:57:10, "Fillmore" wrote: On 1/29/2016 4:30 PM, Rick Johnson wrote: People who are unwilling to "expanding their intellectual horizons" make me sick!!! did I miss something or is this aggressiveness unjustified? In the past, he has posted under

Re: psss...I want to move from Perl to Python

2016-01-29 Thread Fillmore
On 1/29/2016 4:30 PM, Rick Johnson wrote: People who are unwilling to "expanding their intellectual horizons" make me sick!!! did I miss something or is this aggressiveness unjustified? -- https://mail.python.org/mailman/listinfo/python-list

Re: Font issues Tkinter/Python 3.5

2016-01-29 Thread MRAB
On 2016-01-29 22:04:57, "KP" wrote: import tkinter as tk from tkinter import ttk from tkinter import font ... def __init__(self): self.root = tk.Tk() self.root.title('Main Window') self.root.geometry('1000x800+200+200')

[issue26168] Py_BuildValue may leak 'N' arguments on PyTuple_New failure

2016-01-29 Thread squidevil
squidevil added the comment: Martin Panter: You're right. The DECREF on v when itemfailed will decref the N object and prevent the leak. My original analysis was wrong on that count. You're right, do_mklist and do_mkdict (in 2.7.11 at least) have similar problems, bailing after list or dict

Re: psss...I want to move from Perl to Python

2016-01-29 Thread Rick Johnson
On Friday, January 29, 2016 at 2:49:24 PM UTC-6, sohca...@gmail.com wrote: > I'm convinced that anyone who actually prefers Perl's > syntax over Python is suffering from Stockholm Syndrome. > > [...] > > Readability counts. I'd say readability is one of the > most important features of a

Re: psss...I want to move from Perl to Python

2016-01-29 Thread Gregory Ewing
Random832 wrote: The main source of confusion is that $foo[5] is an element of @foo. $foo{'x'} is an element of %foo. Both of these have absolutely nothing to do with $foo. And this is where Perl seems totally insane to me. Obviously it knows from the square brackets that foo[5] is referring

Re: psss...I want to move from Perl to Python

2016-01-29 Thread Ben Finney
"Sven R. Kunze" writes: > On 29.01.2016 01:01, Fillmore wrote: > > How was the Python 2.7 vs Python 3.X solved? which version should I > > go for? > > Python 3 is the new and better one. More importantly: Python 2 will never improve; Python 3 is the only one that is actively

Re: psss...I want to move from Perl to Python

2016-01-29 Thread Gregory Ewing
sohcahto...@gmail.com wrote: On Thursday, January 28, 2016 at 6:34:34 PM UTC-8, Chris Angelico wrote: https://xkcd.com/353/ I have this comic pinned to the outside wall of my cubicle at work, where I use Python for 98% of my work. Another good thing to pin to your wall:

Re: The computer that mastered Go

2016-01-29 Thread mm0fmf via Python-list
On 29/01/2016 22:13, Paul Rubin wrote: mm0fmf writes: Is it written in Python? One would expect it to be written in Go, but it turns out to be C++ and Lua :(. Why did he post it in comp.lang.python then? -- https://mail.python.org/mailman/listinfo/python-list

How to resize an animated gif to fit the window

2016-01-29 Thread kwekey
Hi, I am able to display animated gif using pyglet using below code, but I would like the image to stretch and fit the window as i resize the window. Any one can help me? import pyglet # pick an animated gif file you have in the working directory CODE: SELECT ALL def animate(str): ag_file =

Re: psss...I want to move from Perl to Python

2016-01-29 Thread Cameron Simpson
On 29Jan2016 18:12, Steven D'Aprano wrote: On Fri, 29 Jan 2016 11:25 am, Chris Angelico wrote: Probably the biggest thing to take note of is the Python object model - how names and objects and assignment work. It's pretty straight-forward, but if it's not what you're used

[issue26229] Make number serialization ES6/V8 compatible

2016-01-29 Thread Mark Dickinson
Mark Dickinson added the comment: Eric: I suspect he's talking about section 7.1.12.1 of the 6th edition of ECMA-262; a PDF can be found here: http://www.ecma-international.org/ecma-262/6.0/ECMA-262.pdf. Clause 6 applies to this particular example: """ If k <= n <= 21, return the String

Re: psss...I want to move from Perl to Python

2016-01-29 Thread Chris Angelico
On Sat, Jan 30, 2016 at 7:41 AM, wrote: > It's funny...when I first started using Python, I hated it because it held > your hand and made everything too easy. I was a major C, C++ and Java > fanatic. Now, I LOVE Python because it holds your hand and makes everything >

Re: The computer that mastered Go

2016-01-29 Thread Paul Rubin
mm0fmf writes: > Is it written in Python? One would expect it to be written in Go, but it turns out to be C++ and Lua :(. -- https://mail.python.org/mailman/listinfo/python-list

[issue25934] ICC compiler: ICC treats denormal floating point numbers as 0.0

2016-01-29 Thread Roundup Robot
Roundup Robot added the comment: New changeset 296fb7c10a7d by Zachary Ware in branch '2.7': Issue #25934: Default to /fp:strict for ICC builds https://hg.python.org/cpython/rev/296fb7c10a7d New changeset 747b415e96c4 by Zachary Ware in branch '3.5': Issue #25934: Default to /fp:strict for ICC

Re: psss...I want to move from Perl to Python

2016-01-29 Thread Ben Finney
Steven D'Aprano writes: > You should have started with the official tutorial: > > https://docs.python.org/2/tutorial/ And these days the default recommendation should be to start with the official tutorial for the current stable version of the Python language, Python 3

[issue26234] The typing module includes 're' and 'io' in __all__

2016-01-29 Thread Martin Panter
Martin Panter added the comment: The __alldoc__ is an interesting idea to think about. Anyway, I haven’t actually tried the typing module yet, so I will let you decide the best way forward. -- ___ Python tracker

Font issues Tkinter/Python 3.5

2016-01-29 Thread KP
import tkinter as tk from tkinter import ttk from tkinter import font ... def __init__(self): self.root = tk.Tk() self.root.title('Main Window') self.root.geometry('1000x800+200+200') self.root.minsize(width=1000, height=800) default_font =

[issue26195] Windows frozen .exe multiprocessing.Queue access is denied exception

2016-01-29 Thread Terry J. Reedy
Changes by Terry J. Reedy : -- nosy: +jnoller, sbt ___ Python tracker ___ ___

Re: The computer that mastered Go

2016-01-29 Thread Bernardo Sulzbach
On Fri, Jan 29, 2016 at 8:25 PM, mm0fmf via Python-list wrote: > > Why did he post it in comp.lang.python then? > I don't know. I must say that it is a pretty good video, though. Much more interesting than the average "How to install Python? What have you tried? Asking

Re: The computer that mastered Go

2016-01-29 Thread Bernardo Sulzbach
On Fri, Jan 29, 2016 at 8:13 PM, Paul Rubin wrote: > One would expect it to be written in Go, but it turns out to be C++ and > Lua :(. I can only contribute with my sadness and disappointment. =( -- Bernardo Sulzbach --

Re: psss...I want to move from Perl to Python

2016-01-29 Thread Terry Reedy
On 1/29/2016 3:51 PM, Chris Angelico wrote: On Sat, Jan 30, 2016 at 7:42 AM, Fillmore wrote: - Is there a good IDE that can be used for debugging? all free IDEs for Perl suck and it would be awesome if Python was better than that. Debugging Python code is

[issue26216] run runtktests.py error when test tkinter

2016-01-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This is rather import machinery issue. The simple reproducer: $ ./python -c "import importlib; importlib.import_module('.bar', 'foo')" Traceback (most recent call last): File "", line 1, in File "/home/serhiy/py/cpython/Lib/importlib/__init__.py", line

[issue26235] argparse docs: Positional * argument in mutually exclusive group requires a default parameter

2016-01-29 Thread Terry J. Reedy
Changes by Terry J. Reedy : -- nosy: +bethard ___ Python tracker ___ ___ Python-bugs-list

[issue26209] TypeError in smtpd module with string arguments

2016-01-29 Thread Terry J. Reedy
Terry J. Reedy added the comment: I am guessing that 25 is the default port. Autoconversion of 'host' to ('host', 25) would be a new feature ('enhancement') that would have to wait for the next Python version (3.6 or later). Is there any precedent for this in any other module? Does 2.7 act

[issue25924] investigate if getaddrinfo(3) on OSX is thread-safe

2016-01-29 Thread A. Jesse Jiryu Davis
A. Jesse Jiryu Davis added the comment: I've created a Mac OS 10.4 virtual machine and reproduced the getaddrinfo concurrency bug there using the attached h_resolv.c. The man page on that OS version indeed includes the "not thread-safe" warning. The same test passes on my Mac OS 10.10 system.

Re: Mimick tac with python.

2016-01-29 Thread Christian Gollwitzer
Am 30.01.16 um 05:58 schrieb Random832: On Fri, Jan 29, 2016, at 23:46, Hongyi Zhao wrote: awk '{a[NR]=$0} END {while (NR) print a[NR--]}' input_file perl -e 'print reverse<>' input_file Well, both of those read the whole file into memory - tac is sometimes smarter than that, but that makes

Re: Mimick tac with python.

2016-01-29 Thread Hongyi Zhao
On Fri, 29 Jan 2016 23:58:38 -0500, Random832 wrote: > python <(echo 'import sys;print("".join(reversed(list(sys.stdin') Why do you write it as follows: cat input_file | python -c 'import sys;print("".join(reversed(list (sys.stdin' Regards -- .: Hongyi Zhao [ hongyi.zhao AT gmail.com

[issue26225] New misleading wording in execution model documenation

2016-01-29 Thread Martin Panter
Martin Panter added the comment: Calling exec() with only one argument is equivalent to exec(..., globals(), locals()). It does not create a new scope for names. So an equivalent of your three-level example is more like >>> i = 'global' >>> def f(): ... i = 'nonlocal' ... class_locals

[issue23601] use small object allocator for dict key storage

2016-01-29 Thread Raymond Hettinger
Raymond Hettinger added the comment: If there are no objects, I'll apply the patch tomorrow. -- assignee: -> rhettinger versions: +Python 3.6 -Python 3.5 ___ Python tracker

[issue26218] Set PrependPath default to true

2016-01-29 Thread Terry J. Reedy
Terry J. Reedy added the comment: Are you are referring to the option in the Windows installer to prepend the currently-being-installed Python directory (and the scripts directory) to the system PATH variable? Is so, making this the default has been proposed and rejected before. Some

Mimick tac with python.

2016-01-29 Thread Hongyi Zhao
Hi all, I can use the following methods for mimicking tac command bellow: awk '{a[NR]=$0} END {while (NR) print a[NR--]}' input_file perl -e 'print reverse<>' input_file Is it possible to do the same thing with python? Regards -- .: Hongyi Zhao [ hongyi.zhao AT gmail.com ] Free as in Freedom

Re: psss...I want to move from Perl to Python

2016-01-29 Thread Josef Pktd
On Friday, January 29, 2016 at 4:50:25 PM UTC-5, Cody Piersall wrote: > On Fri, Jan 29, 2016 at 2:42 PM, Fillmore > wrote: > > I actually have a few followup question. > > > - will iNotebook also work in Python 3? > Yes! And just FYI, it's called they Jupyter Notebook now, but pretty much >

Re: Pyhon Icon

2016-01-29 Thread Terry Reedy
On 1/29/2016 6:00 AM, Walter Nakatana wrote: Every time I install python , I don't see the icon on my desktop Correct. The Windows installer puts 5 icons-entries under a Python x.y entry in the Start Menu (or All apps in Win 10). It does not put any on the desktop. You can easily copy

[issue25924] investigate if getaddrinfo(3) on OSX is thread-safe

2016-01-29 Thread Guido van Rossum
Guido van Rossum added the comment: Thanks for the thorough work! Hopefully we can apply this fix to 3.5, 3.6 and even 2.7. -- nosy: +gvanrossum ___ Python tracker

Re: psss...I want to move from Perl to Python

2016-01-29 Thread Rustom Mody
On Saturday, January 30, 2016 at 3:01:09 AM UTC+5:30, Rick Johnson wrote: > On Friday, January 29, 2016 at 6:21:21 AM UTC-6, Ulli Horlacher wrote: > > I nearly gave up with Python at the very beginning before > > I realised that OO-programming is optional in Python! :-) > > Most tutorials I found

[issue26218] Set PrependPath default to true

2016-01-29 Thread Steve Dower
Steve Dower added the comment: Sorry, not happening. There's a very prominent checkbox on the first page of the installer, which was added under protest. I'd suggest learning the py.exe launcher instead, which does not suffer from any of the issues that are caused by modifying the global

[issue4806] Function calls taking a generator as star argument can mask TypeErrors in the generator

2016-01-29 Thread Martin Panter
Martin Panter added the comment: I think this is ready to push for Python 3. Python 2 might need an extra Py_TPFLAGS_HAVE_ITER check, perhaps reusing some code from the Issue 5218 patch. -- stage: patch review -> commit review versions: +Python 3.6 -Python 3.4

Re: Mimick tac with python.

2016-01-29 Thread Random832
On Fri, Jan 29, 2016, at 23:46, Hongyi Zhao wrote: > Hi all, > > I can use the following methods for mimicking tac command bellow: > > awk '{a[NR]=$0} END {while (NR) print a[NR--]}' input_file > perl -e 'print reverse<>' input_file Well, both of those read the whole file into memory - tac is

[issue26240] Docstring of the subprocess module should be cleaned up

2016-01-29 Thread Martin Panter
Martin Panter added the comment: IMO the doc strings should be reduced down so that it is a concise summary, and divided or merged into doc strings of each class, method, function. Less important details should be moved to the main RST documentation (if they aren’t already there). Regarding

[issue26222] Missing code in linux_distribution python 2.7.11

2016-01-29 Thread Terry J. Reedy
Terry J. Reedy added the comment: >From the last two comments, it looks like this should be closed as 'not a bug'. -- nosy: +terry.reedy ___ Python tracker

Re: show instant data on webpage

2016-01-29 Thread Grobu
On 26/01/16 17:10, mustang wrote: I've built a sensor to measure some values. I would like to show it on a web page with python. This is an extract of the code: file = open("myData.dat", "w") while True: temp = sensor.readTempC() riga = "%f\n" % temp

[issue26214] textwrap should minimize number of breaks in extra long words

2016-01-29 Thread Terry J. Reedy
Changes by Terry J. Reedy : -- type: behavior -> enhancement versions: -Python 2.7 ___ Python tracker ___

[issue26216] run runtktests.py error when test tkinter

2016-01-29 Thread Terry J. Reedy
Changes by Terry J. Reedy : -- nosy: +serhiy.storchaka ___ Python tracker ___ ___

Re: Mimick tac with python.

2016-01-29 Thread Chris Angelico
On Sat, Jan 30, 2016 at 3:46 PM, Hongyi Zhao wrote: > I can use the following methods for mimicking tac command bellow: > > awk '{a[NR]=$0} END {while (NR) print a[NR--]}' input_file > perl -e 'print reverse<>' input_file > > Is it possible to do the same thing with python?

[issue26240] Docstring of the subprocess module should be cleaned up

2016-01-29 Thread Antony Lee
New submission from Antony Lee: subprocess.__doc__ currently contains copies for the docstrings of a bunch of functions in the module (... but not subprocess.run). The docs for the Popen class should be moved into that class' docstring. The module's docstring also mentions the list2cmdline

Re: psss...I want to move from Perl to Python

2016-01-29 Thread Chris Angelico
On Sat, Jan 30, 2016 at 2:08 PM, Terry Reedy wrote: > On 1/29/2016 3:51 PM, Chris Angelico wrote: >> >> On Sat, Jan 30, 2016 at 7:42 AM, Fillmore >> wrote: > > >>> - Is there a good IDE that can be used for debugging? all free IDEs for >>> Perl >>>

Re: psss...I want to move from Perl to Python

2016-01-29 Thread Rustom Mody
On Saturday, January 30, 2016 at 3:01:09 AM UTC+5:30, Rick Johnson wrote: > On Friday, January 29, 2016 at 6:21:21 AM UTC-6, Ulli Horlacher wrote: > > I nearly gave up with Python at the very beginning before > > I realised that OO-programming is optional in Python! :-) > > Most tutorials I found

Re: psss...I want to move from Perl to Python

2016-01-29 Thread Ben Finney
Fillmore writes: > On 1/29/2016 4:30 PM, Rick Johnson wrote: > > People who are unwilling to "expanding their > > intellectual horizons" make me sick!!! > > did I miss something or is this aggressiveness unjustified? Indeed it is unjustified. The person to whom you

[issue26168] Py_BuildValue may leak 'N' arguments on PyTuple_New failure

2016-01-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Rather rare reference leak is not the worst bug here. Following example const char *s = ...; PyObject *b = PyBytes_New(...); return PyBuildValue("(Ns)s", b, s, PyBytes_AS_STRING(b)); works if s is correct UTF-8 encoded string. But if it is not

[issue26205] Inconsistency concerning nested scopes

2016-01-29 Thread Terry J. Reedy
Terry J. Reedy added the comment: Would 'three or more' be any clearer than 'at least three'? They mean the same, but the first seems better to me in this context. The real problem with this section are a) the use of Guido's first person 'I' and b) statements that were not changed when

  1   2   >