Re: Cygwin and Python3

2016-02-10 Thread Terry Reedy
On 2/10/2016 4:26 PM, Benoit Izac wrote: Larry Hudson writes: Since Python runs natively in Windows, why are you trying to run it with Cygwin? I'm not implying that you shouldn't, just offhand I don't see a reason for it. I do it because it's easier to install third party

Re: Error

2016-02-03 Thread Terry Reedy
On 2/2/2016 9:49 PM, Russell McCune via Python-list wrote: Hi So I have installed python 3.5.1 (32-bit) for my windows 10 PC. I have also installed the IDE pycharm 5 to go along with it. Now my problem is when I run pycharm the 'Modify Setup' window for python keeps popping up everytime I try

Re: Error

2016-02-03 Thread Terry Reedy
On 2/3/2016 4:40 AM, Oscar Benjamin wrote: On 3 February 2016 at 08:49, Mark Lawrence wrote: On 03/02/2016 02:49, Russell McCune via Python-list wrote: Hi So I have installed python 3.5.1 (32-bit) for my windows 10 PC. I have also installed the IDE pycharm 5 to go

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

2016-01-31 Thread Terry Reedy
On 1/31/2016 5:34 PM, Fillmore wrote: On 01/30/2016 05:26 AM, wxjmfa...@gmail.com wrote: Python 2 vs python 3 is anything but "solved". Python 3.5.1 is still suffering from the same buggy behaviour as in Python 3.0 . Can you elaborate? Please do not propagate jmf's repeated trolls to

Re: The computer that mastered Go

2016-01-31 Thread Terry Reedy
On 1/30/2016 8:53 AM, Bernardo Sulzbach wrote: On Fri, Jan 29, 2016 at 6:53 PM, Ian Kelly wrote: Given the game, and the fact that it's Google, I would be very disappointed if it's not written in Go. Then be disappointed. The AI field seems to have strong feelings

Re: carry **arguments through different scopes/functions

2016-01-31 Thread Terry Reedy
On 1/31/2016 7:19 AM, c.bu...@posteo.jp wrote: I am not sure what the problem is here, so I don't really know how I should call the subject for that question. Please offer a better subject. The code below is a extrem simplified example of the original one. But it reproduce the problem very

Re: Unable to activate Python once installed, as far I am aware i have full permission. The download is in programs but does not show when i use run in windows start menu, any suggestions would be hel

2016-01-31 Thread Terry Reedy
On 1/30/2016 10:32 AM, Haydn James wrote: Please repost with a short subject line, about 40 chars. Put your messages in the body of the post, with adequate detail. What version of Windows. What version of Python. Where did you get it. How did you install it. How did you try to run it. 'run in

Re: Error : 0x80070570 file or directory is corrupted or unavailable

2016-01-31 Thread Terry Reedy
On 1/31/2016 2:26 AM, archi dsouza wrote: I was trying to install Python.exe in windows 8.1. But got error mention in subject line. Repeat such detail in the body of the message. But first try a web search. find attached log file. Nope. This is a no-attachment mail list. YOU should

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

2016-01-31 Thread Terry Reedy
On 1/30/2016 10:22 PM, Rustom Mody wrote: On Sunday, January 31, 2016 at 7:27:06 AM UTC+5:30, Steven D'Aprano wrote: On Sunday 31 January 2016 09:18, Gregory Ewing wrote: Correct. The re module keeps a cache of the last N regexes used, for some value of N (possibly 10?) so for casual use

Re: Mimick tac with python.

2016-01-30 Thread Terry Reedy
On 1/30/2016 1:03 AM, Christian Gollwitzer wrote: 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 -

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

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

Re: pip install mitmproxy - fails on watchdog-0.8.3.tar.gz with "Permission denied" error (Python 2.7.11 on Win XP SP3);

2016-01-24 Thread Terry Reedy
On 1/24/2016 5:35 PM, Larry Hudson via Python-list wrote: If the path string is typed directly into Windows where it is parsed by (whatever is the current equivalent of) command.com, forward slashes are NOT accepted. More specifically, / is not accepted in paths to be executed. It seems to

Re: import locale and print range on same line

2016-01-23 Thread Terry Reedy
On 1/23/2016 8:58 AM, Chris Angelico wrote: On Sun, Jan 24, 2016 at 12:45 AM, Steven D'Aprano wrote: On Sun, 24 Jan 2016 12:19 am, Chris Angelico wrote: On Sun, Jan 24, 2016 at 12:07 AM, Steven D'Aprano wrote: On Sat, 23 Jan 2016 09:02 pm,

Re: How to simulate C style integer division?

2016-01-21 Thread Terry Reedy
On 1/21/2016 9:56 PM, Terry Reedy wrote: On 1/21/2016 3:39 AM, Shiyao Ma wrote: I wanna simulate C style integer division in Python3. There are two problems with this spec: it assumes that 'C style integer division' is well defined and that we know the definition. Better: "How do I

Re: How to simulate C style integer division?

2016-01-21 Thread Terry Reedy
On 1/21/2016 3:39 AM, Shiyao Ma wrote: I wanna simulate C style integer division in Python3. There are two problems with this spec: it assumes that 'C style integer division' is well defined and that we know the definition. Better: "How do I write a function 'div' in Python 3 so that the

Re: How to fix my imports/file structure

2016-01-20 Thread Terry Reedy
On 1/20/2016 8:26 PM, Travis Griggs wrote: I wrote a simple set of python3 files for emulating a small set of mongodb features on a 32 bit platform. I fired up PyCharm and put together a directory that looked like: minu/ client.py database.py collection.py test_client.py

Re: installing

2016-01-20 Thread Terry Reedy
On 1/20/2016 3:41 PM, navneet bhatele wrote: Whenever i try to install python-3.5.1-amd64 a problem occur , picture of which has attached. This is a text only, no attachments allowed mailing list. So picture was discarded. -- Terry Jan Reedy --

Re: ERROR: IDLEs subprocesses did not make a connection...

2016-01-17 Thread Terry Reedy
On 1/14/2016 12:42 PM, Lee, Brandon wrote: Hello! I am running into the following error and need some guidance. I summarized at https://bugs.python.org/issue25514#msg258498 the reasons listed in the SO page you linked and another linked on that page. Running through the list is your job.

Re: Modify Settings window pop-up

2016-01-17 Thread Terry Reedy
On 1/17/2016 12:13 PM, Arvind Vallabhaneni wrote: I installed the python interpreter and pycharm program onto my home desktop. However, while doing some simple programming exercises from class, the window below keeps popping up every time I type a few words or try to run the program. This

Re: Which Python editor has this feature?

2016-01-13 Thread Terry Reedy
On 1/12/2016 8:20 PM, jf...@ms4.hinet.net wrote: Terry Reedy at 2016/1/12 UTC+8 3:56:03PM wrote: Revamping IDLE to 1. use ttk widgets and 2. become a modern single window app with multiple panes, including a tabbed editor pane, is a goal for 2016. That will be great, I'm looking forward

Re: Which Python editor has this feature?

2016-01-13 Thread Terry Reedy
On 1/12/2016 5:18 AM, Chris Angelico wrote: On Tue, Jan 12, 2016 at 7:27 PM, Terry Reedy <tjre...@udel.edu> wrote: Can psycopg2 be installed with pip? There is an issue (#23551) to make a pip GUI and make it accessible from IDLE. We need someone with both pip and tkinter knowledge to

Re: Stop writing Python 4 incompatible code

2016-01-13 Thread Terry Reedy
On 1/13/2016 8:02 PM, Rick Johnson wrote: and a leader who lost his cushy job at Google Unless you have access to facts that I do not, 'lost' is impolite speculation. But lets move on. I have a contrary hypothesis based on the facts quoted below. As far as I know, Google is somewhat stuck

Re: Building list

2016-01-13 Thread Terry Reedy
On 1/13/2016 10:23 AM, Eddy Quicksall wrote: What list do I use for building issues? I'm building 3.5.1. Start here. -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list

Re: Stop writing Python 4 incompatible code

2016-01-13 Thread Terry Reedy
On 1/13/2016 7:10 PM, Steven D'Aprano wrote: On Thu, 14 Jan 2016 03:25 am, Random832 wrote: On Wed, Jan 13, 2016, at 09:21, sjms...@gmail.com wrote: This strikes me as very good advice. Thanks for being so far-sighted. And let's hope that Python 4 has fewer incompatibilities (none would

Re: Which Python editor has this feature?

2016-01-12 Thread Terry Reedy
On 1/11/2016 8:09 PM, Chris Angelico wrote: On Tue, Jan 12, 2016 at 11:55 AM, Bernardo Sulzbach wrote: On Mon, Jan 11, 2016 at 10:14 PM, Chris Angelico wrote: Next IDLE feature request: Can you make it so that, across all platforms, it magically

Re: subscripting Python 3 dicts/getting the only value in a Python 3 dict

2016-01-12 Thread Terry Reedy
On 1/12/2016 11:50 AM, Nick Mellor wrote: Hi all, Seemingly simple problem: There is a case in my code where I know a dictionary has only one item in it. I want to get the value of that item, whatever the key is. In Python2 I'd write: d = {"Wilf's Cafe": 1} d.values()[0] 1 and that'd be

Re: I'm missing something here...

2016-01-11 Thread Terry Reedy
On 1/11/2016 6:26 PM, Skip Montanaro wrote: Here's a dumb little bit of code, adapted from a slightly larger script: #!/usr/bin/env python "dummy" import glob import os def compare_prices(*_args): "dummy" return set() def find_problems(cx1, cx2, cx3, prob_dates): "dummy"

Re: Which Python editor has this feature?

2016-01-11 Thread Terry Reedy
On 1/11/2016 8:51 PM, jf...@ms4.hinet.net wrote: Terry Reedy at 2016/1/12 UTC+8 5:22:35AM wrote: IDLE has an optional 'code context' feature that shows header lines that have scrolled up off the top of the screen. This would let you see which class you are in, Thanks, Terry. It's just what I

Re: Which Python editor has this feature?

2016-01-11 Thread Terry Reedy
On 1/11/2016 6:04 AM, jf...@ms4.hinet.net wrote: I am studying the PyUSB package now as the learning object of how to write a Python program in a "formal" way. In those modules, there are many comment inserted between codes to explain what it does. It's good to the user comprehension, but also

Re: python

2016-01-11 Thread Terry Reedy
On 1/11/2016 2:17 PM, Sean Melville wrote: I've downloaded python 3.5.1 but when I try and open it You need to be more specific. (Is 'it' the python installer or python program?) 1. What version of Windows, including 32/64 bit. For pre-10, service packs matter (you should have the

Re: Question on pytest example code

2016-01-10 Thread Terry Reedy
On 1/10/2016 2:38 PM, Robert wrote: Hi, Below is a code snippet from pytest package. It passes pytest, i.e. there is no failure report. # content of test_sysexit.py import pytest def f(): raise SystemExit(1) def test_mytest(): with pytest.raises(SystemExit): f() I

Re: Python 3.4.4 Install

2016-01-09 Thread Terry Reedy
On 1/9/2016 5:25 PM, Colin J. Williams wrote: The reponse is not understood. What part of 'SyntaxError: invalid syntax' do you not understand? *** Python 3.4.4rc1 (v3.4.4rc1:04f3f725896c, Dec 6 2015, 17:06:10) [MSC v.1600 64 bit (AMD64)] on win32. *** Consider replacing with 3.4.4,

Re: Fast pythonic way to process a huge integer list

2016-01-06 Thread Terry Reedy
On 1/6/2016 9:36 PM, high5stor...@gmail.com wrote: I have a list of 163.840 integers. What is a fast & pythonic way to process this list in 1,280 chunks of 128 integers? What have you tried that did not work? This is really pretty simple, but the detail depend on the meaning of 'process a

Re: python unit test framework sample code

2016-01-06 Thread Terry Reedy
On 1/6/2016 8:45 AM, Ganesh Pal wrote: Hello Team, I have written a small program using python unit test framework . I need your guidance to find out 1. If I have used the fixtures and classes properly ( first oop program) :) ) 2. why does unittest2.SkipTest not print the message when the

Re: trying to install

2016-01-06 Thread Terry Reedy
On 1/4/2016 2:00 PM, Montone_Dennis wrote: I am using Windows 7 and when I try to runt IDLE I get the following error. "The program can't start because api-ms-win-crt-runtime-I1-1-0.dll is missing from your computer." Do you have any suggestions for me? Download and install the required

Re: We will be moving to GitHub

2016-01-01 Thread Terry Reedy
On 1/1/2016 4:08 PM, Zachary Ware wrote: On Fri, Jan 1, 2016 at 2:03 PM, wrote: Is there a summary document that discusses the options examined and why others did not meet the requirements? I am -NOT- trying to dredge up arguments about the choice. I am guessing

Re: raise None

2015-12-30 Thread Terry Reedy
On 12/30/2015 7:09 PM, Steven D'Aprano wrote: I have a lot of functions that perform the same argument checking each time: def spam(a, b): if condition(a) or condition(b): raise TypeError if other_condition(a) or something_else(b): raise ValueError if whatever(a): raise

Re: Is it safe to assume floats always have a 53-bit mantissa?

2015-12-30 Thread Terry Reedy
On 12/30/2015 8:18 AM, Steven D'Aprano wrote: We know that Python floats are equivalent to C doubles, Yes which are 64-bit IEEE-754 floating point numbers. I believe that this was not true on all systems when Python was first released. Not all 64-bit floats divided them the same way. I

Re: Python.Exe Problem

2015-12-29 Thread Terry Reedy
On 12/29/2015 11:24 AM, Daniel Lee wrote: Hello, When I try to run python.exe on my computer with Windows 8, Which exact version? From what source? How did you download (from where) or compile? How did you install? How do you try to run it? I get the following error: "Python.exe -

Re: EOFError: marshal data too short -- causes?

2015-12-29 Thread Terry Reedy
On 12/29/2015 3:01 AM, Glenn Linderman wrote: Now the __pycache__ directory is full of .pyc and .pyo files (from the install? The installer optionally runs compileall on /Lib and recursively on its subpackages. The option defaults to 'yes', at least for 'install for everyone', as writing

Re: Message Box

2015-12-28 Thread Terry Reedy
On 12/28/2015 4:43 PM, Malik Brahimi wrote: I have an event driven script What does that mean, more specifically? that prompts users as the events are triggered with a message box. Is there anyway with any GUI toolkit to create these dialogs simultaneously in the event that they coincide?

Re: EOFError: marshal data too short -- causes?

2015-12-28 Thread Terry Reedy
On 12/29/2015 1:50 AM, Glenn Linderman wrote: Here's a sanatized stack trace off my web server: File ".../cgihelpers.py", line 10, in import cgitb File ".../py34/lib/python3.4/cgitb.py", line 24, in import inspect File ".../py34/lib/python3.4/inspect.py", line 54, in

Re: Recursively listing the contents of a package?

2015-12-25 Thread Terry Reedy
On 12/25/2015 6:01 PM, jeanbigbo...@gmail.com wrote: As an occasional Python user, I'd like to be able to get for myself a high-level overview of a package's capabilities. I can do this after a fashion interactively in IPython using tab completes. e.g. import numpy as np np. ---> Big list of

Re: unable to open IDLE for Python3.50rc1 on windows10 64bit AMD

2015-12-24 Thread Terry Reedy
On 12/24/2015 9:59 AM, eryk sun wrote: On Thu, Dec 24, 2015 at 5:06 AM, Nicky Mac wrote: not sure what you mean by "my profile". following your suggestion, looks normal: I meant your profile directory, "C:\Users\Nick". But printing the package path showed the problem

Re: need some basic help

2015-12-24 Thread Terry Reedy
On 12/24/2015 2:33 PM, Qurrat ul Ainy wrote: what is snippet ?? Search 'snippet definition' on the web with your browser. It comes from 'snip', so something 'snipped'. -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list

Re: unable to open IDLE for Python3.50rc1 on windows10 64bit AMD

2015-12-24 Thread Terry Reedy
On 12/24/2015 8:59 AM, Nicky Mac wrote: Dear python Team I think I've been wasting your time: C:\Users\Nick>path PATH=C:\Python27\;C:\Python27\Scripts;C:\ProgramData\Oracle\Java\javapath;C:\Program Files\Broadcom\Broadcom 802.11 Network

Re: Idiom for this case?

2015-12-24 Thread Terry Reedy
On 12/24/2015 5:04 PM, KP wrote: Given: cfg = {'c': ('3840', '1024'), 'p1': {'gpio': '1', 'id': '4', 'coord': ('0', '0', '1280', '1024')}, 'p2': {'gpio': '2', 'id': '5', 'coord': ('1280', '0', '2560', '1024')}, 'p3': {'gpio': '3', 'id': '6', 'coord': ('2560', '0',

Re: unable to open IDLE for Python3.50rc1 on windows10 64bit AMD

2015-12-22 Thread Terry Reedy
On 12/22/2015 3:27 PM, Nicky Mac wrote: I have run the install (and repair) which explicitly includes Tcl/Tk and l have this problem: First, I would download and install the final 3.5.1. I believe there was a change to the installer that might, possibly, make a difference. Write down

Re: Ignore error with non-zero exit status

2015-12-21 Thread Terry Reedy
On 12/21/2015 9:05 AM, Thomas 'PointedEars' Lahn wrote: Chris Angelico wrote: On Tue, Dec 22, 2015 at 12:19 AM, Thomas 'PointedEars' Lahn wrote: Mark Lawrence wrote: On 21/12/2015 07:51, Thomas 'PointedEars' Lahn wrote: Chris Angelico wrote: But it's been clearly

Re: Installing PyCharm on Windows

2015-12-20 Thread Terry Reedy
On 12/20/2015 4:54 PM, Chris Angelico wrote: > Want to run CPython 3.6 on Windows? > Go hunt down a compiler, fiddle around with it, and see if you can get everything to work. No, much easier. Essentially the same steps as below after following the instructions in the devguide to get the 2015

Re: Should stdlib files contain 'narrow non breaking space' U+202F?

2015-12-18 Thread Terry Reedy
On 12/18/2015 4:49 AM, Steven D'Aprano wrote: On Fri, 18 Dec 2015 05:51 pm, Chris Angelico wrote: I would be inclined to ASCIIfy the apostrophes, dashes, and the connection.py space that started this thread. People's names, URLs, and demonstrative characters I'm more inclined to leave. Agreed?

Re: Should stdlib files contain 'narrow non breaking space' U+202F?

2015-12-17 Thread Terry Reedy
On 12/17/2015 6:18 PM, Chris Angelico wrote: On Fri, Dec 18, 2015 at 10:05 AM, Mark Lawrence wrote: The culprit character is hidden between "Issue #" and "20540" at line 400 of C:\Python35\Lib\multiprocessing\connection.py. https://bugs.python.org/issue20540 and

Re: cannot open file with non-ASCII filename

2015-12-17 Thread Terry Reedy
On 12/18/2015 12:12 AM, bearmingo wrote: Usually I put #!-*-coding=utf-8-*- at each py file. It's ok to open file in local system. That declaration only applies to the content of the file, not its name on the filesystem. -- Terry Jan Reedy --

Re: Python 3.1 test issue

2015-12-16 Thread Terry Reedy
On 12/16/2015 1:22 PM, George Trojan wrote: I installed Python 3.1 on RHEL 7.2. According to the output below, you installed 3.5.1. Much better than the years old 3.1. The command make test hangs (or takes a lot of time on test_subprocess [396/397] test_subprocess This indicates that

Re: Help on code comprehension from an example project of pymc

2015-12-15 Thread Terry Reedy
On 12/15/2015 11:15 AM, Robert wrote: Hi, I find the useful small code project for me: #https://users.obs.carnegiescience.edu/cburns/ipynbs/PyMC.html It runs as expected. When I review the code, I find 'data' in the original line: data = pymc.Normal('data', mu=model, tau=tau, value=z_obs,

Re: List of integers

2015-12-14 Thread Terry Reedy
On 12/13/2015 7:24 PM, KP wrote: data = list(f.read(4)) print data from a binary file might give In 2.x, a binary file and a text file are not distinguished. ['\x10', '\x20', '\x12', '\x01'] If a 'binary' file yields strings, you must be using 2.x. How can I receive this instead?

Re: cannot open file with non-ASCII filename

2015-12-14 Thread Terry Reedy
On 12/14/2015 11:24 AM, Ulli Horlacher wrote: With Python 2.7.11 on Windows 7 my users cannot open/read files with non-ASCII filenames. Right. They should either restrict themselves to ascii (or possibly latin-1) filenames or use current 3.x. This is one of the (known) unicode problems

Re: Screenshots in Sphinx docs

2015-12-14 Thread Terry Reedy
On 12/14/2015 11:31 AM, Albert-Jan Roskam wrote: I'd like to include up-to-date screenshots (of a tkinter app) > into my Sphinx documentation. If you manually take screenshots with *any* screen grabber and save in an appropriate format, this is apparently trivial -- use the ..image

Re: Python IO Redirection to Console

2015-12-13 Thread Terry Reedy
On 12/13/2015 9:14 AM, austin aigbe wrote: I am trying to redirect the IO (stdout, stdin and stderr) to the console. For a program run from the console, console IO is the default. One must explicitly redirect to a file stream or pipe. At least on Windows, console IO is also the default

Re: 2to3 translation problem

2015-12-12 Thread Terry Reedy
On 12/12/2015 12:30 PM, Tony van der Hoff wrote: Thanks, Laura, and others who have replied. You're right; python-3-pygame exists in unstable, but has not yet made it to jessie, even in backports. So, I'll stick with python 2.7 for the time being; really no hardship :) pygame itself was

Re: tkinter: Switch between two grids

2015-12-12 Thread Terry Reedy
On 12/12/2015 1:24 PM, sms wrote: What I need: 1. Fullscreen application Not directly relevant to the below. 2. On the home screen: Three row 3. When I click on the main screen, it switches to one row only. Create homescreen Frame(master=root) or subclasses thereof. Pack the homescreen.

Re: appending a line to a list based off of a string found in a previous list

2015-12-12 Thread Terry Reedy
On 12/12/2015 4:48 PM, Pedro Vincenty wrote: Hello, I'm wondering how to append a line from a file onto a list(easy part) provided that the line contains strings specific to a previous list I've already made(hard part). I have this right now, for line in satellite_dataread: if any(i

Re: writing an email.message.Message in UTF-8

2015-12-07 Thread Terry Reedy
On 12/7/2015 9:57 AM, Adam Funk wrote: I'm trying to write an instance of email.message.Message, whose body contains unicode characters, to a UTF-8 file. (Python 2.7.3 & 2.7.10 again.) The email package was rewritten for, I believe, 3.3. I believe it should handle unicode email encoded as

Re: Accessing container's methods

2015-12-07 Thread Terry Reedy
On 12/7/2015 1:10 PM, Tony van der Hoff wrote: Hi, I have a class A, containing embedded embedded classes, which need to access methods from A. . A highly contrived example, where I'm setting up an outer class in a Has-a relationship, containing a number of Actors. The inner class needs to

Re: Understanding Python from a PHP coder's perspective

2015-12-07 Thread Terry Reedy
On 12/7/2015 4:07 PM, villasc...@gmail.com wrote: Hello all! Just started getting into Python, and am very excited about the prospect. I am struggling on some general concepts. My past experience with server-side code is mostly limited to PHP and websites. I have some file called

Re: python 3.5: upgrading smart_open package

2015-12-07 Thread Terry Reedy
On 12/7/2015 12:15 PM, Anupam Mediratta wrote: Hello, I have to use python 3.5 in my use case and one of the packages I use (gensim), in turn uses smart_open (https://github.com/piskvorky/smart_open/) smart_open depends on boto and boto fails on my machine running ubuntu 15.10. So in order

Re: increment/decrement operators

2015-12-05 Thread Terry Reedy
On 12/5/2015 9:41 AM, D'Arcy J.M. Cain wrote: On Sat, 5 Dec 2015 13:56:47 +0100 Robin Koch wrote: x += y works. (Well, it should.) It does, even on objects other than numbers. x = "abc" y = "def" x += y x 'abcdef' x++ doesn't. No but it's just a special case of

Re: Unicode failure

2015-12-05 Thread Terry Reedy
On 12/5/2015 2:44 PM, Random832 wrote: On 2015-12-05, Terry Reedy <tjre...@udel.edu> wrote: On 12/4/2015 10:22 PM, Random832 wrote: Well, any bar 1200, 1201, 12000, 12001, 65000, 65001, and 54936. Test before you post. As someone else pointed out, I meant that as a list of codepages

Re: Unicode failure

2015-12-04 Thread Terry Reedy
On 12/4/2015 1:07 PM, D'Arcy J.M. Cain wrote: I thought that going to Python 3.4 would solve my Unicode issues Within Python itself, that should be mostly true. As soon as you send text to a display, the rules of the display device take over. #! /usr/bin/python3 # -*- coding: UTF-8 -*-

Re: Unicode failure

2015-12-04 Thread Terry Reedy
On 12/4/2015 10:22 PM, Random832 wrote: On 2015-12-04, Terry Reedy <tjre...@udel.edu> wrote: Tk widgets, and hence IDLE windows, will print any character from \u to \u without raising, even if the result is blank or �. Higher codepoints fail, but allowing the entire BMP is bette

Re: Unicode failure

2015-12-04 Thread Terry Reedy
On 12/4/2015 11:15 PM, D'Arcy J.M. Cain wrote: On Fri, 4 Dec 2015 22:49:49 + Albert-Jan Roskam wrote: I think you need to use a raw unicode string, ur Nope. The 'r' prefix does not disable unicode escapes. unicodedata.name(ur'\u2122') 'TRADE MARK SIGN' If

Re: Does Python 2.7 do Open Office

2015-12-03 Thread Terry Reedy
On 12/3/2015 11:00 AM, Seymore4Head wrote: On Thu, 3 Dec 2015 00:47:42 +, MRAB wrote: On 2015-12-02 23:50, Seymore4Head wrote: I have a text file I would like to search through but I have tried it before. I don't remember why they are not compatible together,

Re: getting fileinput to do errors='ignore' or 'replace'?

2015-12-03 Thread Terry Reedy
On 12/3/2015 10:18 AM, Adam Funk wrote: On 2015-12-03, Adam Funk wrote: I'm having trouble with some input files that are almost all proper UTF-8 but with a couple of troublesome characters mixed in, which I'd like to ignore instead of throwing ValueError. I've found the openhook for the

Re: 'string.join' is wrong in my Python console

2015-12-03 Thread Terry Reedy
On 12/3/2015 11:00 AM, Robin Koch wrote: Am 03.12.2015 um 10:02 schrieb Gary Herron: On 12/02/2015 10:55 PM, Robert wrote: Hi, I read the tutorial on "Why is join() a string method instead of a list or tuple method?" at link:

Re: filter a list of strings

2015-12-03 Thread Terry Reedy
On 12/3/2015 7:28 AM, Mark Lawrence wrote: On 03/12/2015 01:15, c.bu...@posteo.jp wrote: I would like to know how this could be done more elegant/pythonic. I have a big list (over 10.000 items) with strings (each 100 to 300 chars long) and want to filter them. list = . for item in

Re: Could you explain this rebinding (or some other action) on "nums = nums"?

2015-12-01 Thread Terry Reedy
On 12/1/2015 3:32 PM, Denis McMahon wrote: On Tue, 01 Dec 2015 03:32:31 +, MRAB wrote: In the case of: tup[1] += [6, 7] what it's trying to do is: tup[1] = tup[1].__iadd__([6, 7]) tup[1] refers to a list, and the __iadd__ method _does_ mutate it, but then Python tries to

Re: Could you explain this rebinding (or some other action) on "nums = nums"?

2015-12-01 Thread Terry Reedy
On 12/1/2015 4:36 PM, Denis McMahon wrote: On Tue, 01 Dec 2015 16:18:49 -0500, Terry Reedy wrote: On 12/1/2015 3:32 PM, Denis McMahon wrote: On Tue, 01 Dec 2015 03:32:31 +, MRAB wrote: In the case of: tup[1] += [6, 7] what it's trying to do is: tup[1] = tup[1].__iadd__

Re: Caret key quits idle on pt keyboard

2015-11-30 Thread Terry Reedy
On 11/30/2015 11:13 AM, Laura Creighton wrote: In a message of Tue, 01 Dec 2015 02:57:15 +1100, Chris Angelico writes: On Tue, Dec 1, 2015 at 2:10 AM, Random832 wrote: On 2015-11-30, Chris Angelico wrote: Hmm. This could be part of the known issues

Re: Question about code writing '% i, callback'

2015-11-30 Thread Terry Reedy
On 11/30/2015 11:44 AM, fl wrote: I come across the following code snippet. for i in range(10): def callback(): print "clicked button", i UI.Button("button %s" % i, callback) http://effbot.org/zone/default-values.htm Note that the above is an intentional example of

Re: static variables

2015-11-30 Thread Terry Reedy
On 11/30/2015 12:15 PM, Ulli Horlacher wrote: I try to to implement a "static variable" inside a function: def main(): a(1) a(2) a() print(a.x) if 'a.x' in globals(): print('global variable') if 'a.x' in locals(): print('local variable') def a(x=None): if not x is None:

Re: Python on windows 10

2015-11-26 Thread Terry Reedy
On 11/25/2015 3:34 PM, francis funari wrote: I have tried installing Python 3 on windows 10 it install OK but I do not get Idle. When I type Idle in the interpreter nothing happen Starting programs by typing their names into the interactive interpreter does not work. Use Start Menu | All

Re: What is a function parameter =[] for?

2015-11-24 Thread Terry Reedy
On 11/24/2015 9:34 AM, Antoon Pardon wrote: I agree that the tutorial should talk about default argument objects (which have values) instead of conflating 'object' with 'value'. Op 20-11-15 om 13:12 schreef Ned Batchelder: I'm not sure what your goal is at this point. Are you: 1)

Re: error help import random

2015-11-20 Thread Terry Reedy
On 11/20/2015 12:22 PM, Dylan Riley wrote: This is my fortune cookie program i wrote in python. the problem is it will not run past the first line of input. could someone please identify the error and explain to me why. here is the code: #the program silulates a fortune cookie #the program

Re: non-blocking getkey?

2015-11-18 Thread Terry Reedy
On 11/18/2015 11:50 AM, Ulli Horlacher wrote: Ulli Horlacher wrote: from Tkinter import Tk from tkFileDialog import askopenfilename Tk().withdraw() file = askopenfilename() I found another glitch: After termination of

Re: Writing SOME class methods in C

2015-11-18 Thread Terry Reedy
On 11/18/2015 2:50 AM, Daniel Haude wrote: Hello, I'm trying to implement some (but not all) methods of a Python class in C. What I've found on the Net is: - how to implement entire modules in C so that I can import that module and use the C functions (successfully done it, too). - how

Re: Launcher, and ftype Python.File

2015-11-18 Thread Terry Reedy
On 11/18/2015 3:12 AM, Glenn Linderman wrote: Setting up a new machine with Windows 10, I installed Python 3.5.0 and the Launcher. Invoking python files from batch files as foo.py -a -bunch -of -parameters Didn't seem to do _anything_ so I checked: d:\>assoc .py .py=Python.File d:\>ftype

Re: non-blocking getkey?

2015-11-18 Thread Terry Reedy
On 11/18/2015 6:01 AM, Ulli Horlacher wrote: Ulli Horlacher wrote: it is too complicated to rewrite my application from CLI to GUI. But... is there a windows program with which one can select files and the result is written to STDOUT? Found it: from

Re: Is there any reason to introduce this intermediate variable (sz)?

2015-11-18 Thread Terry Reedy
On 11/17/2015 3:51 PM, fl wrote: n_iter = 50 sz = (n_iter,) # size of array x = -0.37727 z = np.random.normal(x,0.1,size=sz) Q = 1e-5 # process variance # allocate space for arrays xhat=np.zeros(sz) P=np.zeros(sz) I learn Python now and the above code seems from an experienced author. The

Re: import module pyttsx in windows IDLE failed

2015-11-16 Thread Terry Reedy
On 11/16/2015 12:45 PM, input/ldompel...@casema.nl wrote: In reply to "MRAB" who wrote the following: Have you installed pyttsx? No, I did not. Where can I find pyttsx to install ? Let pip find it (its on pypi). On a command line, enter 'pip install pyttsx' -- Terry Jan Reedy --

Re: Trying out Kivy

2015-11-13 Thread Terry Reedy
On 11/13/2015 11:33 AM, Cecil Westerhof wrote: I tried out the ‘standard’ Kivy application: from kivy.app import App from kivy.uix.button import Button class TestApp(App): def build(self): return Button(text='Hello

Re: What is '@' for

2015-11-13 Thread Terry Reedy
On 11/13/2015 6:04 PM, fl wrote: I read the following code snippet. A question is here about '@'. I don't find the answer online yet. Start with the index of the fine docs, which includes symbols. https://docs.python.org/3/genindex-Symbols.html '@' is near the end of the page.

Re: find which Python libraries are most influential in scientific research

2015-11-13 Thread Terry Reedy
On 11/13/2015 10:58 PM, Ian Kelly wrote: On Nov 9, 2015 7:41 PM, "Heather Piwowar" wrote: Today's scientists often turn to Python to run analysis, simulation, and other sciency tasks. That makes us wonder: which Python libraries are most influential in scientific

Re: Python Trouble

2015-11-12 Thread Terry Reedy
On 11/11/2015 3:01 PM, Kaif Mahmood wrote: I downloaded the recent version of Python and after it downloaded I tried IDLE. But when I tried to load it, it didn’t load and just acted as if nothing happened. All of the other features work fine, it’s just IDLE not working. I tried different

Re: cross platform alternative for signal.SIGALRM?

2015-11-12 Thread Terry Reedy
On 11/12/2015 2:37 AM, Chris Angelico wrote: On Thu, Nov 12, 2015 at 5:43 PM, Christian Gollwitzer wrote: My understanding of async is that it creates an event loop. In which case the loop has no chance to run within a block of code that computes anything, is that correct?

Re: Is it useful for re.M in this example?

2015-11-12 Thread Terry Reedy
On 11/12/2015 4:34 PM, fl wrote: I follow a web site on learning Python re. I have read the function description of re.m, as below. re.MMakes $ match the end of a line (not just the end of the string) and makes ^ match the start of any line (not just the start of the string). But I

Re: cross platform alternative for signal.SIGALRM?

2015-11-12 Thread Terry Reedy
On 11/12/2015 6:38 AM, Chris Angelico wrote: On Thu, Nov 12, 2015 at 9:15 PM, Terry Reedy <tjre...@udel.edu> wrote: On 11/12/2015 2:37 AM, Chris Angelico wrote: On Thu, Nov 12, 2015 at 5:43 PM, Christian Gollwitzer <aurio...@gmx.de> wrote: My understanding of async is tha

Re: cross platform alternative for signal.SIGALRM?

2015-11-11 Thread Terry Reedy
On 11/11/2015 11:16 AM, Ulli Horlacher wrote: I am rewriting a Perl program into Python (2.7). I recommend using 3.4+ if you possibly can. It must run on Linux and Windows. With Linux I have no problems, but Windows... :-( The current show stopper is signal.SIGALRM which is not available on

Re: IDLE quits unexpectedly when about to open or creat a new file

2015-11-10 Thread Terry Reedy
On 11/10/2015 6:01 AM, Chris Angelico wrote: On Tue, Nov 10, 2015 at 9:46 PM, wrote: I need help to find out what's going on. I did some research, but I couldn't find anything to solve this problem: - I open the IDLE program; From the Start menu icon, let us

Re: Question about math.pi is mutable

2015-11-10 Thread Terry Reedy
On 11/9/2015 9:37 PM, Steven D'Aprano wrote: The compiler doesn't need to decide *in advance* whether the attribute might have changed. It knows whether it has changed or not *at runtime*. You are using 'compiler' when you should, to avoid confusion, use 'interpreter'. It's one thing to

<    7   8   9   10   11   12   13   14   15   16   >