Re: subprocess startup error

2016-07-02 Thread Terry Reedy
On 7/1/2016 11:43 PM, Veek. M wrote: Shweta Dinnimani wrote: hi hello, I'm begineer to python programming.. I had installed python 3.5.1 version on my windows 7 system. I was fine earlier and now when i was trying the programs on string i'm facing the subprocess startup error. IDLE is not conn

Re: Help with subclasses and classes

2016-07-02 Thread Terry Reedy
On 7/2/2016 8:58 PM, cadenmr...@gmail.com wrote: When i run the code I get this error : Traceback (most recent call last): File "C:/Python25/chapter2", line 18, in bank=InterestAccount(5,1000,0.5) NameError: name 'InterestAccount' is not defined I can't find the issue, any help? class B

Re: input vs. readline

2016-07-08 Thread Terry Reedy
On 7/8/2016 7:17 PM, John Nagle wrote: If "readline" is imported, "input" gets "readline" capabilities. It also loses the ability to import control characters. It doesn't matter where "readline" is imported; an import in some library module can trigger this. You can try this with a simple te

Re: Curious Omission In New-Style Formats

2016-07-11 Thread Terry Reedy
On 7/11/2016 1:24 PM, Ethan Furman wrote: On 07/11/2016 09:28 AM, Steven D'Aprano wrote: On Tue, 12 Jul 2016 01:04 am, Ian Kelly wrote: Er, what? I count *five* digits in "00123", not three. You seem to be assuming that "precision" can only refer to digits after the decimal place, but that's

Re: Compression of random binary data

2016-07-11 Thread Terry Reedy
On 7/11/2016 2:09 PM, Joonas Liik wrote: On 11 July 2016 at 20:52, wrote: What kind of statistic law or mathematical conjecture or is it even a physical law is violated by compression of random binary data? Off-topic, but... It is unclear whether you mean 'random' in the technical sense o

Re: Curious Omission In New-Style Formats

2016-07-11 Thread Terry Reedy
On 7/11/2016 3:27 PM, Ian Kelly wrote: On Mon, Jul 11, 2016 at 12:54 PM, Terry Reedy wrote: In any case, I think it an improvement to say that '0x00123' has a field width of 7 rather than a 'precision' of 5. '{:#07x}'.format(0x123) # specifiy field widt

Re: What is precision of a number representation?

2016-07-11 Thread Terry Reedy
On 7/11/2016 5:51 PM, Chris Angelico wrote: This is why it's important to be able to record precisions of arbitrary numbers. If I then measure the width of this corridor with a laser, I could get an extremely precise answer - say, 2,147 millimeters, with a precision of four significant digits, a

Re: What is precision of a number representation?

2016-07-11 Thread Terry Reedy
On 7/11/2016 6:17 PM, Ethan Furman wrote: On 07/11/2016 02:51 PM, Chris Angelico wrote: This is why it's important to be able to record precisions of arbitrary numbers. If I then measure the width of this corridor with a laser, I could get an extremely precise answer - say, 2,147 millimeters,

Re: Were is a great place to Share your finished projects?

2016-07-14 Thread Terry Reedy
On 7/14/2016 3:04 PM, hasan.di...@gmail.com wrote: Python's primary repository is Mercurial (hg.python.org), not Git. CPython's current repository Ditto for the PSF Python docs. Were python to switch, Like it or not, CPython and the Docs are moving to git and github. PEPs and the devg

Re: PEP Request: Advanced Data Structures

2016-07-16 Thread Terry Reedy
On 7/16/2016 6:14 PM, shrey.de...@gmail.com wrote: I have found it slightly frustrating that Python does not have built-in support for advanced data structures (Linked Lists, You and I have different ideas of 'advanced data structures' ;-). To me, linked list are limited structures used in fu

Re: an error

2016-07-19 Thread Terry Reedy
On 7/19/2016 2:07 AM, WePlayGames WeEnjoyIt wrote: pygame1.blit(image3,(143,146) If you type this line (including \n) into IDLE's Python-aware editor, it will notice that there is an open parenthesis for a function call and indent the next line to the space under the 'i' of image. This i

Re: Technique for safely reloading dynamically generated module

2016-07-21 Thread Terry Reedy
On 7/21/2016 12:07 PM, Malcolm Greene wrote: I assume that one downside to the exec() approach is that there is no persistent namespace for this code's functions and classes, eg. after the exec() completes, its namespace disappears and is not available to code that follows? Objects only disapp

Re: How asyncio works? and event loop vs exceptions

2016-07-23 Thread Terry Reedy
On 7/22/2016 8:27 PM, Marco S. via Python-list wrote: I'm developing a web app based on aiohttp, and I find the event loop concept very interesting. I never programmed with it before, but I know that node.js and GUIs are based on it. What I can't understand is how asyncio make it possible to run

Re: Caller's module name, function/method name and line number for output to logging

2016-07-25 Thread Terry Reedy
On 7/25/2016 3:16 PM, Malcolm Greene wrote: Is there a technique for accessing a function's *CALLER* module name, function/method name and line number so that this information can be Look in the inspect module for the inspect stack function. Note that when you call the function, it needs to l

Re: Unittest

2016-07-25 Thread Terry Reedy
On 7/25/2016 12:45 PM, Joaquin Alzola wrote: Hi Guys I have a question related to unittest. I suppose a SW that is going to live will not have any trace of unittest module along their code. In order to test idlelib, I had to a _utest=False (unittest = False) parameter to some functions. The

Re: FW: error in python IDLE

2016-07-26 Thread Terry Reedy
On 7/26/2016 1:51 PM, Nakirekanti Jahnavi wrote: Sent from Mail for Windows 10 From: Nakirekanti Jahnavi The above is all I see. This is a text-only, no-attachment list. -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list

Re: python and open office

2016-07-27 Thread Terry Reedy
On 7/27/2016 12:37 PM, Chris Kaynor wrote: def __init__(self, name: str): That "name: str" syntax is called function annotations, and was added in Python 3, and you are trying to use the module in Python 2.7. There may be another variation of the module compatible with Python 2, or you'll need

Re: working with OpenOffice Calc

2016-07-27 Thread Terry Reedy
On 7/27/2016 1:54 PM, id23...@gmail.com wrote: I am looking for a library that will allow me to work with Calc documents from Python. But so far I was not able to build properly working environment for that. You posted this same question 1 1/2 hours before under a different name. Please don'

Re: TypeError: '_TemporaryFileWrapper' object is not an iterator

2016-07-29 Thread Terry Reedy
On 7/29/2016 4:43 AM, Antoon Pardon wrote: Below is a short program that illustrate the problem It works with python2, whether you use the -c option or not. It only works with python3 if you use the -c option. The problem seems to come from my expectation that a file is its own iterator and in p

Re: TypeError: '_TemporaryFileWrapper' object is not an iterator

2016-07-29 Thread Terry Reedy
On 7/29/2016 7:59 AM, eryk sun wrote: On Fri, Jul 29, 2016 at 8:43 AM, Antoon Pardon wrote: The problem seems to come from my expectation that a file is its own iterator and in python3 that is no longer true for a NamedTemporaryFile. For some reason it uses a generator function for __iter__

Re: Why not allow empty code blocks?

2016-07-29 Thread Terry Reedy
On 7/29/2016 4:58 AM, Antoon Pardon wrote: Op 23-07-16 om 16:19 schreef Chris Angelico: On Sun, Jul 24, 2016 at 12:00 AM, BartC wrote: Or, for debugging or other reasons, when you need to comment out the contents of a block. Then pass needs to be added. How often do you comment out an entire

Debugging (was Re: Why not allow empty code blocks?)

2016-07-31 Thread Terry Reedy
On 7/31/2016 6:18 AM, BartC wrote: The costs are near zero: at minimum, a syntactic construct such as: repeat N: that expands to: for _ in range(N): The benefit is not so much performance, but being able to express something very easily and quickly. The cost of the 'repeat' contraction i

Re: Tcl/Tk for Python 3.6.0a3 on Os X 10.9.5

2016-08-02 Thread Terry Reedy
On 8/2/2016 4:21 AM, munozvvale...@gmail.com wrote: I am new to the programming world but I need to learn this program for a research class that I am taking. I have downloaded Python 3.6.0a3 on a Mac 10.9.5 and realized that I also need to download an Active Tcl for it. I can't find one for this

Re: gmane sending

2016-08-02 Thread Terry Reedy
On 8/2/2016 10:42 AM, Robin Becker wrote: I just got a mail bounce from my normal gmane --> nntp setup sending to python-python-l...@m.gmane.org. Have others seen this and does it mean the end of gmane has happened? See I am reading and sending via gmane right now. https://developers.slashd

Re: Debugging (was Re: Why not allow empty code blocks?)

2016-08-02 Thread Terry Reedy
On 8/2/2016 7:05 AM, BartC wrote: On 31/07/2016 19:58, Terry Reedy wrote: On 7/31/2016 6:18 AM, BartC wrote: repeat N: The benefit is not so much performance, but being able to express something very easily and quickly. The cost of the 'repeat' contraction is that one cann

Re: Debugging (was Re: Why not allow empty code blocks?)

2016-08-04 Thread Terry Reedy
Making repeat a keyword would have such an extremely high cost that it is out of the question and not a sane proposal. To start with, it is used in two major, widely used APIs. itertools.repeat + 50 uses in other itertools and tests + all the imports and and uses of repeat() in code all over th

Re: Python Error message

2016-08-04 Thread Terry Reedy
On 8/4/2016 12:19 PM, MRAB wrote: In those rare occasions when you do write a bare except, A bare "except:" is never needed and in my opinion, and that of others, one should never write one (except possibly for experimentation). Be explicit and write "except BaseException:" or "except Except

Re: Python slang

2016-08-05 Thread Terry Reedy
On 8/5/2016 6:00 PM, Marco Sulla via Python-list wrote: I have a simple curiosity: why Python has much keywords, and some builtin types and methods, that are different from the other languages? What is the rationale? I'm referring to: * `except` instead of `catch` Python partly takes its cue f

Re: Python slang

2016-08-06 Thread Terry Reedy
On 8/6/2016 2:30 AM, Michael Selik wrote: When people ask me why the core classes are lowercased, Int, float, list, dict, etc were once functions that return objects of type 'int', 'float', 'list', 'dict', etc, before they became 'new-style classes', which are not just 'classes'. The lowerc

Re: How do I make a game in Python ?

2016-08-06 Thread Terry Reedy
On 8/6/2016 5:51 PM, Cai Gengyang wrote: As in, any recommended websites that helps users create complex games in Python ? For 2D graphics, try pygame among others. For 3D, I don't know what is current. On Sunday, August 7, 2016 at 5:41:25 AM UTC+8, Ian wrote: On Aug 6, 2016 11:57 AM, "C

Re: Running Python from the source repo

2016-08-08 Thread Terry Reedy
On 8/8/2016 12:24 PM, Zachary Ware wrote: I generally assume that if I'm testing a patch, I'm going to need to rebuild regardless of what the patch actually touches. I often wait until the patch is applied before I do the rebuild, or if I'm manually testing a bug I go ahead and do the rebuild i

Re: Running Python from the source repo

2016-08-09 Thread Terry Reedy
On 8/8/2016 5:16 PM, Zachary Ware wrote: On Mon, Aug 8, 2016 at 2:25 PM, Terry Reedy wrote: Last January, I wrote a batch file to build all three versions with the 'optional' extensions. I started rebuilding more often after this. 36\pcbuild\build.bat -e -d 35\pcbuild\build.ba

Re: Running Python from the source repo

2016-08-09 Thread Terry Reedy
On 8/8/2016 5:25 PM, Random832 wrote: On Mon, Aug 8, 2016, at 15:25, Terry Reedy wrote: Last January, I wrote a batch file to build all three versions with the 'optional' extensions. I started rebuilding more often after this. 36\pcbuild\build.bat -e -d 35\pcbuild\build.bat -e -d

Re: IDLE Default Working Directory

2018-11-12 Thread Terry Reedy
On 11/12/2018 2:28 PM, eryk sun wrote: On 11/12/18, Christman, Roger Graydon wrote: eryk sun responded: On 11/12/18, Christman, Roger Graydon wrote: I looked in IDLE's own configuration menu, and didn't see anything there -- and I fear that I might have to f

Re: IDLE Default Working Directory

2018-11-12 Thread Terry Reedy
On 11/12/2018 10:35 AM, Bev in TX wrote: On Nov 12, 2018, at 9:16 AM, eryk sun wrote: On 11/12/18, Christman, Roger Graydon mailto:d...@psu.edu>> wrote: I looked in IDLE's own configuration menu, and didn't see anything there -- and I fear that I might have to fight some Windows settings so

Re: IDLE Default Working Directory

2018-11-12 Thread Terry Reedy
On 11/12/2018 7:15 PM, Thomas Jollans wrote: On 13/11/2018 00:45, Terry Reedy wrote: On Windows, a simple alternate is a .bat file.  I belive the folloiwing should work. cd c:/desired/startup/directory py -x.y -m idlelib The default for x.y is latest 3.x or latest 2.x if no 3.x. Correct me

Re: IDLE Default Working Directory

2018-11-15 Thread Terry Reedy
On 11/13/2018 9:04 PM, Christman, Roger Graydon wrote: On 13 Nov 2018, at 09:51, Bev in TX wrote: On Nov 12, 2018, at 5:50 PM, Terry Reedy wrote: For me, open (command-O) opens 'Documents'. I presume it should be easy enough to move into a 

Re: Question about the definition of the value of an object

2018-11-19 Thread Terry Reedy
On 11/19/2018 9:08 AM, Iwo Herka wrote: Hello everyone, I've been looking for something in the documentation (https://docs.python.org/3.8/reference/datamodel.html) recently and I've noticed something weird. Documentation states that every object has a value, but doesn’t provide any definition wh

Re: Error Python version 3.6 does not support this syntax.

2018-11-27 Thread Terry Reedy
On 11/27/2018 7:50 AM, srinivasan wrote: Dear Python Experts, As still I am newbie and learning python, I am trying to reuse the Bluetoothctl wrapper in Python from the link ( https://gist.github.com/egorf/66d88056a9d703928f93 Created in 2015 ) I am using python3.6 version, In pycharm editor

Re: Error Python version 3.6 does not support this syntax.

2018-11-27 Thread Terry Reedy
On 11/27/2018 8:24 AM, Frank Millman wrote: In the line 'return None',  it may be complaining that None is superfluous - a plain 'return' does the same thing. PEP 8 recommends explicit 'return None' if elsewhere in the function there is an explicit 'return something', as in if condition

Re: Creating type evaluation annotation

2018-12-06 Thread Terry Reedy
On 12/6/2018 5:48 AM, Marek Mosiewicz wrote: I'm Java developer,but had some experience with Python based ERP software. It is quite serious application and I feel unconfortable with not having type checking. I do not say language should be static, but having checking method signature is big win.

Re: Creating type evaluation annotation

2018-12-09 Thread Terry Reedy
On 12/9/2018 11:37 AM, Jon Ribbens wrote: On 2018-12-09, Marek Mosiewicz wrote: I'm talking about this https://docs.python.org/3/library/typing.html I'm not talking about new language. I think it could be nice to have standard PEP annotations for classes to make type validation or type hints w

Re: No connection

2018-12-16 Thread Terry Reedy
On 12/16/2018 9:40 AM, Vasilis Mytilinaios wrote: Hello, I'm trying to open the interactive shell but it doesn't let me. It says that IDLE's subprocess didn't make connection. Read the doc section on possible reasons. https://docs.python.org/3/library/idle.html#startup-failure -- Terry Jan

Re: Decoding a huge JSON file incrementally

2018-12-20 Thread Terry Reedy
On 12/20/2018 10:42 AM, Paul Moore wrote: I'm looking for a way to incrementally decode a JSON file. I know this has come up before, and in general the problem is not soluble (because in theory the JSON file could be a single object). AFAIK, a JSON file always represents a single JSON item and

Re: Why doesn't a dictionary work in classes?

2018-12-25 Thread Terry Reedy
On 12/25/2018 7:45 AM, אורי wrote: Why does this not work: class User(ValidateUserPasswordMixin, PermissionsMixin, Entity, AbstractBaseUser): GENDER_UNKNOWN = 0 > ... Indent needed here. I presume you used tabs, which disappeared in transmission, but I cannot cut and paste to run this. -

Re: Rate limiting a web crawler

2018-12-26 Thread Terry Reedy
On 12/26/2018 10:35 AM, Simon Connah wrote: Hi, I want to build a simple web crawler. I know how I am going to do it but I have one problem. Obviously I don't want to negatively impact any of the websites that I am crawling so I want to implement some form of rate limiting of HTTP requests

Re: Ask for help about class variable scope (Re: Why doesn't a dictionary work in classes?)

2018-12-27 Thread Terry Reedy
On 12/26/2018 9:53 PM, jf...@ms4.hinet.net wrote: I saw the code below at stackoverflow. I have a little idea about the scope of a class, and list comprehension and generator expressions, but still can't figure out why Z4 works and Z5 not. Can someone explain it? (in a not-too-complicated way:

Re: Type hinting of Python is just a toy ?

2019-01-04 Thread Terry Reedy
On 1/4/2019 4:04 AM, iamybj--- via Python-list wrote: In fact, there is only 3 types in all prigramming languages. 'Category' would be a better term. Better said might be: "One can usefully group types/classes of values/objects into 3 categories." Primitive type: int, string, bool, char...

Re: Compilation

2019-01-06 Thread Terry Reedy
On 1/6/2019 6:20 PM, Avi Gross wrote: I suspect there is some python tool that can go through a directory structure of python code and produce appropriate byte code files in one sweep. import compileall help(compileall) The Windows installer optionally runs it. It is usually needed if one d

Re: Deletion of Environmental Variables

2019-01-06 Thread Terry Reedy
On 1/6/2019 9:56 PM, Logan Vogelsong wrote: I planned on using python to simulate different cipher to challenge myself, but I kinda deleted my environmental variables to python. I run Windows 10 and wanted to get NumPy and MatPlotLib modules imported to python. Basically, I downloaded python 3.7

Re: System printer object

2019-01-07 Thread Terry Reedy
On 1/7/2019 5:17 PM, Dave wrote: I need to print to one or both of my system printers.  I have not found a printer object in Python or in Tkinter.  This needs to work with Linux, Window, and Mac.  Can someone point me in the right direction? Ultimately, I want to have a File/Print in the menu t

Re: How to find files with a string

2019-01-09 Thread Terry Reedy
On 1/9/2019 11:29 AM, anton.gridus...@gmail.com wrote: I need to find a file, that contains a string TeNum IDLE's 'Find in Files' is a mid-level grep with GUI interface. The code is in idlelib/grep.py if you want to copy code. -- Terry Jan Reedy -- https://mail.python.org/mailman/listinf

Re: Exercize to understand from three numbers which is more high

2019-01-25 Thread Terry Reedy
On 1/25/2019 6:56 AM, ^Bart wrote: number1 = int( input("Insert the first number: ")) number2 = int( input("Insert the second number: ")) number3 = int( input("Insert the third number: ")) if number1 > number2 and number1 > number3:     print("Max number is: ",number1) if number2 > number1 a

Re: Problem in Installing version 3.7.2(64 bit)

2019-01-27 Thread Terry Reedy
On 1/26/2019 6:24 AM, Vrinda Bansal wrote: Dear Sir/Madam, After Installation of the version 3.7.2(64 bit) in Windows 8 when I run the program it gives an error. Screenshot of the error is attached below. Nope. This is text only mail list. Images are tossed. You must copy and paste. -- T

Re: List of methods affected by 'Special method lookup'

2019-01-28 Thread Terry Reedy
On 1/28/2019 11:14 AM, Roberto Martínez wrote: Hi, the documentation about Special method lookup claims: "For custom classes, implicit invocations of special methods are only guaranteed to work correctly if defined on an

Re: How to replace space in a string with \n

2019-01-31 Thread Terry Reedy
On 1/31/2019 11:19 AM, Ian Clark wrote: text = "The best day of my life!" output = '' for i in text: if i == ' ': output +='\n' else: output += i print(output) throwing my hat in the ring, not only is it .replace free it is entirely method free But this is an awful, O(n*n) way to s

Re: How to replace space in a string with \n

2019-01-31 Thread Terry Reedy
On 1/31/2019 1:36 PM, Grant Edwards wrote: On 2019-01-31, Grant Edwards wrote: On 2019-01-31, Terry Reedy wrote: On 1/31/2019 11:19 AM, Ian Clark wrote: text = "The best day of my life!" output = '' for i in text: if i == ' ': output +='\n'

Re: Trying to figure out the data type from the code snippet

2019-01-31 Thread Terry Reedy
On 1/31/2019 3:31 PM, Chupo via Python-list wrote: In article , Chris Angelico says... There are stupid questions, but I enjoy answering those too. You don't need to apologize for asking these questions. All you need to do is ignore the trolls like Rick. In fact, if you abandon Google Groups an

Re: cant use def command

2019-02-02 Thread Terry Reedy
On 2/1/2019 10:49 AM, mb1541def 0 wrote: Hello, I need help on the def command. My script: Import os Test def Test(): print(“test”) os.system(“pause”) someone please help,it gives me an error in python 3. The python authors already did by providing you with a traceback that explains what

Re: The slash "/" as used in the documentation

2019-02-09 Thread Terry Reedy
On 2/9/2019 8:29 AM, Piet van Oostrum wrote: r...@zedat.fu-berlin.de (Stefan Ram) writes: The slash »/« as used in the documentation f( x, /, y ) is so ugly, it will disappear. Especially since it consumes a comma as it it was a parameter itself. Possible alternatives include:

Re: The sum of ten numbers inserted from the user

2019-02-09 Thread Terry Reedy
On 2/9/2019 4:23 AM, Christian Gollwitzer wrote: Am 08.02.19 um 09:58 schrieb ^Bart: A colleague did: total=0 for n in range(10): n= int(input("Enter a number: ")) Here, you are reusing "n" for two different things: 1. The loop index, indicating which number you ask for 2. The number en

Re: The slash "/" as used in the documentation

2019-02-09 Thread Terry Reedy
On 2/9/2019 2:10 PM, Piet van Oostrum wrote: Christian Gollwitzer writes: __import__( 'sys' ).version '3.6.1 |Anaconda 4.4.0 (x86_64)| (default, May 11 2017, 13:04:09) \n[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)]' help( __import__( 'math' ).sin ) Help on built-in function sin

Re: My appreciation for python's great work to my country.

2019-02-09 Thread Terry Reedy
On 2/8/2019 4:37 AM, Kiyimba Godfrey wrote: I take this opportunity to thank python for having designed such a wonderful program which has enabled computer scientists and programmers in my country Uganda, understand, design and create other computer application programs . You're welcome, and

Re: The slash "/" as used in the documentation

2019-02-10 Thread Terry Reedy
On 2/10/2019 10:47 AM, Ian Kelly wrote: On Sat, Feb 9, 2019 at 1:19 PM Terry Reedy wrote: This is the result of Python being a project of mostly unpaid volunteers. See my response in this thread explaining how '/' appears in help output and IDLE calltips. '/' only a

Re: The slash "/" as used in the documentation

2019-02-10 Thread Terry Reedy
On 2/10/2019 11:32 PM, Ian Kelly wrote: On Sun, Feb 10, 2019 at 9:34 AM Chris Angelico wrote: Do you ACTUALLY want to call math.sin(x=1.234) or is it purely for the sake of consistency? Aside from questions about the help format, what is actually lost by the inability to pass those arguments

Re: The slash "/" as used in the documentation

2019-02-11 Thread Terry Reedy
On 2/11/2019 2:47 AM, Ian Kelly wrote: For math.sin, sure, but what about, say, list.index? Special-case conversion is a different issue from blanket conversion. Some C functions have been converted to accept some or all args by keyword. I don't know the status of list method conversion: dis

Zato blog post: A successful Python 3 migration story

2019-02-11 Thread Terry Reedy
The migration was from 2.7 to 2.7 and 3.x, rather than 3.x only. I think it worth reading for anyone interested in the subject. https://zato.io/blog/posts/python-3-migration-success-story.html 60,000 lines of Python and Cython, 130 external dependencies (but only 10 not already 3.x ready) took 2

Re: more pythonic way

2019-02-11 Thread Terry Reedy
On 2/11/2019 2:46 PM, Felix Lazaro Carbonell wrote: def find_monthly_expenses(month=None, year=None): month = month or datetime.date.today().month Or it should better be: if not month: month = datetime.date.today().month As a 20+ year veteran, I would be

Re: [RELEASE] Python 2.7.16 release candidate 1

2019-02-16 Thread Terry Reedy
On 2/16/2019 8:10 PM, Benjamin Peterson wrote: I'm pleased to announce the immediate availability of Python 2.7.16 release candidate 1. This is a prerelease for yet another bug fix release in the Python 2.7.x series. It includes over 100 fixes over Python 2.7.15. See the changelog at ht

Re: Trying to compile Python 3.5 on Linux Mint 19, getting compiler warnings and failing tests

2019-02-18 Thread Terry Reedy
On 2/18/2019 3:35 PM, Marcin G wrote: Hmm. From looking at your full log (THANK YOU for posting that, btw - so many people don't), it looks like an issue with certificate checking. Might be a bug in the test itself. Does the same thing happen with a more recent Python build? It could be a weirdne

Re: revisiting the "What am I running on?" question

2019-02-19 Thread Terry Reedy
On 2/19/2019 10:06 AM, Chris Angelico wrote: On Wed, Feb 20, 2019 at 2:04 AM Chris Angelico wrote: On Wed, Feb 20, 2019 at 1:59 AM songbird wrote: MRAB wrote: ... Don't use a bare except, it'll catch _any_ exception. that's ok with this code IMO, but i see your point. Not really, n

Re: sys.modules

2019-02-21 Thread Terry Reedy
On 2/21/2019 11:40 AM, ast wrote: Hello Is it normal to have 151 entries in dictionary sys.modules just after starting IDLE or something goes wrong ? The is the right number. When Python starts, it imports around 50 modules. When it runs IDLE, most of idlelib modules are imported, plus abo

Re: revisiting the "What am I running on?" question

2019-02-22 Thread Terry Reedy
On 2/22/2019 7:55 AM, songbird wrote: eryk sun wrote: ... The win-amd64 ABI is significantly different, but at the API level there isn't a drastic difference between 32-bit and 64-bit Windows, so there's no cognitive burden with perpetuating the Win32 name. The official API name was actually cha

Re: python3.7 installation failing - so why?

2019-02-23 Thread Terry Reedy
On 2/22/2019 10:56 PM, Chris Angelico wrote: On Sat, Feb 23, 2019 at 2:51 PM Frank Miles wrote: Question: how can I determine what has gone wrong? Hmm. I'd start with: $ which python3 $ dpkg -S `which python3` and from inside Python: >>> import sys; sys.path Adding ', sys.executable' is

Re: missing 1 required positional argument error

2019-02-26 Thread Terry Reedy
On 2/26/2019 10:10 AM, vergos.niko...@gmail.com wrote: I'm receiving the following error: Traceback (most recent call last): File "/usr/lib64/python3.6/site-packages/bottle.py", line 862, in _handle return route.call(**args) File "/usr/lib64/python3.6/site-packages/bottle.py", line 17

Re: Need help with Python3.4 and Avro

2019-02-28 Thread Terry Reedy
On 2/28/2019 11:19 AM, Mihir Kothari wrote: I am not sure if this is the right list, but trying to get help from experienced python users for my issue. This is a good place to get a somewhat different set of such people. I have posted the issue in stackoverflow, but yet to see any response.

Re: dash/underscore on name of package uploaded on pypi

2019-02-28 Thread Terry Reedy
On 2/28/2019 11:09 AM, ast wrote: Hello I just uploaded a package on pypi, whose name is "arith_lib" The strange thing is that on pypi the package is renamed "arith-lib" The underscore is substitued with a dash If we search for this package: pip search arith arith-lib (2.0.0) - A set of func

Re: Class Issue`

2019-03-05 Thread Terry Reedy
On 3/5/2019 6:11 PM, Kevin Hu wrote: Python is a language with very weak typing, Python runtime objects are strongly dynamically typed. Their type/class is one of their attributes. All classes are subclasses of class 'object'. Python names (variables) are untyped in a sense, or one could

Re: System Beep?

2019-03-08 Thread Terry Reedy
On 3/8/2019 1:13 PM, Steve wrote: How can I cause a system beep using code? >>> import winsound as ws >>> ws.Beep(500, 1000) and >>> from tkinter import Tk >>> root = Tk() >>> root.bell() work for me. The bell is not exactly a bell, but different from a monotone beep. -- Terry Jan Reedy

Re: Question regarding the local function object

2019-03-15 Thread Terry Reedy
On 3/15/2019 8:47 AM, Arup Rakshit wrote: Hi, I am reading a book where it says that: Just like module-level function definitions, the definition of a local function happens at run time when the def keyword is executed. Interestingly, this means that each call to sort_by_last_letter results i

Re: Question about the @staticmethod decorator

2019-03-18 Thread Terry Reedy
On 3/17/2019 2:15 PM, Arup Rakshit wrote: I am reading a book where the author says that: In principle, it would also be possible to implement any @staticmethod completely outside of the class at module scope without any loss of functionality — so you may want to consider carefully whether a p

Re: tkinter

2019-03-18 Thread Terry Reedy
On 3/18/2019 12:00 PM, Informatico de Neurodesarrollo wrote: Hello friends: I am a beginner on programming in python. I want make a simple program that test continuously (every 5 seg) the connection  to internet and change the background color when are not available. I try this , but not work

Re: running "python -i" in subprocess shows no prompt

2019-03-18 Thread Terry Reedy
On 3/18/2019 9:10 AM, finnkochin...@keemail.me wrote: I try to start a separate python subprocess using the attached code. This example should catch all stdout and stderr output from the launched subprocess and send commands to its stdin. Subprocess is not intended for interaction. My attemp

Re: Can my python program send me a text message?

2019-03-19 Thread Terry Reedy
On 3/19/2019 10:56 PM, Steve wrote: Thanks for all the suggestions. It is going to take a while to sift through them. I will continue to watch for more discussion and will check back in if/when I get something working or if I get stuck. Steve Footnote: Fight the hand that feeds the hate. --

Re: Might be doing this wrong? (Turtle graphics)

2019-03-20 Thread Terry Reedy
On 3/20/2019 7:34 PM, jasonanyil...@gmail.com wrote: So, I typed in code: from turtle import * forward(100) right(120) clear() It didn't work! It kept on saying that there was an indent and the first line was wrong. Help! that suggests that what you typed above is not what you ran. Did you run

Re: Python 3.7 Bug

2019-03-25 Thread Terry Reedy
On 3/25/2019 8:14 AM, Bassam Abdul-Baki wrote: Greetings, In the following code, there's a bug on certain parameters. -- def per(n, steps = 0): digits = [int(i) for i in str(n)] result = 1 for j in digits: result *= j steps += 1 print(steps, result, sep=" - ") if result

Re: configparser - which one?

2019-03-26 Thread Terry Reedy
On 3/25/2019 8:10 PM, Dave wrote: I use Python3 3, and expected learning how to use configparser would be no big deal.  Well!  Seems there is configparser, stdconfigparser, and configparser is what IDLE uses. I would read the extra or deleted features of the others and see if they apply to y

Re: Syntax for one-line "nonymous" functions in "declaration style"

2019-03-27 Thread Terry Reedy
On 3/27/2019 4:21 AM, Alexey Muranov wrote: Whey you need a simple function in Python, there is a choice between a normal function declaration and an assignment of a anonymous function (defined by a lambda-expression) to a variable:    def f(x): return x*x or    f = lambda x: x*x PEP 8 p

Re: Syntax for one-line "nonymous" functions in "declaration style"

2019-03-28 Thread Terry Reedy
On 3/28/2019 12:29 PM, Alexey Muranov wrote: On jeu., Mar 28, 2019 at 5:00 PM, python-list-requ...@python.org wrote: So my opinion is that lambda expressions should only be used within larger expressions and never directly bound. It would be however more convenient to be able to write inste

Re: DeprecationWarning in Python 3.6 and 3.7

2019-04-02 Thread Terry Reedy
On 4/2/2019 6:29 AM, אורי wrote: Hi, Please look at this issue: DeprecationWarning in Python 3.6 and 3.7 I tried to upgrade to the latest virtualenv (virtualenv==16.4.3) in the tests but the tests still fail in Python 3.6 and 3.7 with the De

Re: I really liked this Javscript FizzBuzz can it be as nice in Python?

2019-04-05 Thread Terry Reedy
On 4/5/2019 2:52 AM, Sayth Renshaw wrote: for (let n = 1; n <= 100; n++) { n = range(100) n = range(1, 101) to cover 1 to 100 inclusive -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list

Re: What is a, b, c, and d in: rect1 = drawing.create_rectangle(a, b, c, d) and circle1 = drawing.create_oval(a, b, c, d)

2019-04-09 Thread Terry Reedy
On 4/9/2019 4:24 PM, Christian Gollwitzer wrote: Am 09.04.19 um 21:57 schrieb CrazyVideoGamez: What is a, b, c, and d in: from tkinter import * window = Tk() drawing = Canvas(window, height=500, width=500) rectangle = drawing.create_rectangle(a, b, c, d) and: circle = drawing.create_oval(a, b, c

Re: Why inspect.isclass says iter() a class?

2019-04-11 Thread Terry Reedy
On 4/10/2019 3:17 PM, Arup Rakshit wrote: From docs https://docs.python.org/3/library/itertools.html#itertools.chain I see that itertools.chain is defined as a function. Because that is what the itertools functions are. (The chain entry does not use 'function', but the beginning of the doc do

Re: save files

2019-04-22 Thread Terry Reedy
On 4/22/2019 7:51 AM, Calvin Spealman wrote: Can you give some more information about the problem and your setup, including: - What OS and OS version are you running? - What is the Python script you are trying to write? Specifically, what name are you trying to give to the file. If you use a

Re: Python best practice instantiating classes in app

2019-04-29 Thread Terry Reedy
On 4/29/2019 1:38 PM, Dave wrote: As apps get more complex we add modules, or Python files, to organize things.  One problem I have is a couple of data classes (list of dictionary objects) in a few modules that are used in a number of the other modules.  For example a list of meter reading dict

Re: Python 3.73 cannot install py3exiv2

2019-05-01 Thread Terry Reedy
On 5/1/2019 9:12 AM, Ken Martell wrote: I’m a retired aerospace engineer. I’m a Windows 10 user & have zero experience with Python. My goal is to learn, get this working & run lens distortion correction routines using Python. I’ve tried or many hours and read as much as I can but cannot get the py

Re: help plz

2019-05-13 Thread Terry Reedy
On 5/12/2019 1:05 PM, Tristan Cribaro wrote: [image: image.png] This is text-only mail list. so I have a project I have to work on that is due tomorrow for a lot of points towards my grade. The issue here is I've been trying to download Pillow and simple audio for my project and I keep gettin

Re: idle is not at all opening moreover its not showing error any also...what could I do now???

2019-05-13 Thread Terry Reedy
On 5/13/2019 5:47 AM, kalai kathirvel wrote: Run 'python -m idlelib' or 'py -m idlelib' in Command Prompt window. Then report whatever error message you see. -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list

Re: Error encountered

2019-05-13 Thread Terry Reedy
On 5/12/2019 8:12 AM, Buhari Alhassan wrote: I tried running Python 3.6.1 in windows command prompt,it keeps saying access denied,can't run this app on your system Copy and paste what you type and the response. -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list

Re: Tkinter on Mac OS crashes python

2019-05-14 Thread Terry Reedy
On 5/14/2019 9:27 PM, Wildman via Python-list wrote: On Tue, 14 May 2019 11:22:54 -0600, Chip Towner wrote: I am trying to use tkinter and when I attempt to do so Python crashes. I am accessing Python (v 3.6.8) in Spyder (v3.6) from Anaconda. The version of TkVersion tells me the version is

<    13   14   15   16   17   18   19   20   21   22   >