Re: How to POST html data to be handled by a route endpoint

2020-03-07 Thread DL Neil via Python-list
On 7/03/20 2:33 AM, îØî-îºî¿ïé îÆî ïüî³î¿ïé wrote: > First i must say i use Bottle, but the same may also be the case in Flask too. I ask here and not in sub Bottle because there are only a few people there and i receive no responses. > > Actualy since i started here let me say what i have found.

Re: Possible Addition to Python Language: Marked Sub-condition

2020-03-08 Thread DL Neil via Python-list
On 8/03/20 11:05 PM, Shrinivas Kulkarni wrote: Hello Everyone While writing python code, I frequently come across the need to do certain tasks based on combined conditions. Much of the task for all the sub-conditions are common but some are specific to one or more of these sub-conditions. The

Re: How to POST html data to be handled by a route endpoint

2020-03-08 Thread DL Neil via Python-list
On 8/03/20 8:47 AM, Richard Damon wrote: On 3/7/20 5:15 AM, Νίκος Βέργος wrote: When superhost.gr/test tries to post html form data to the route endpoint '/mailform' it sends it to superhost.gr/mailform and NOT at superhost.gr/test/mailform as it should have done. The HTML path /mailform mea

Re: pip UX Studies - help improve the usability of pip

2020-03-10 Thread Marco Sulla via Python-list
Subscribed. I have a little suggestion IMHO "What is you favourite pip command or functionality?" is not very useful... of course the most useful command is "install" :-) -- https://mail.python.org/mailman/listinfo/python-list

Re: pip UX Studies - help improve the usability of pip

2020-03-10 Thread Marco Sulla via Python-list
There's someone of the pip team that can confirm this? On Sat, 7 Mar 2020 at 02:49, Bernard Tyers - Sane UX Design wrote: > > Hi there, > > My name is Bernard Tyers. I'm a UX designer and have recently started > working on the PSF project to improve the usability of pip, funded by > MOSS/CZI. > >

Re: Error while installing a python code

2020-03-10 Thread Marco Sulla via Python-list
I suppose you tried to use this setup.py: https://github.com/breathe/coffee_conda_package/blob/master/0001-Add-alternative-setup.py-script.patch It's not well written IMHO... anyway this is not the problem. I suppose you also downloaded the required sources from here: https://data.mendeley.com/da

Re: [Python-ideas] Re: Magnitude and ProtoMagnitude ABCs — primarily for argument validation

2020-03-10 Thread Tim Peters via Python-list
[Marco Sulla ] > Excuse me, Tim Peters, what do you think about my (probably heretical) > proposal of simply raising an exception instead of return a NaN, like > Python already do for division by zero? Sorry, I'm missing context. I don't see any other message(s) from you in this thread, so don't

Re: [Python-ideas] Re: Magnitude and ProtoMagnitude ABCs — primarily for argument validation

2020-03-10 Thread Marco Sulla via Python-list
I think that implementing TotallyOrderable and PartiallyOrderable is a good idea. But is it useful? I mean, I don't know how much people needs really to order sets. Maybe some mathematician. But they can simply use Sage: http://doc.sagemath.org/html/en/reference/categories/sage/categories/posets.ht

Re: [Python-ideas] Re: New explicit methods to trim strings

2020-03-10 Thread Marco Sulla via Python-list
I agree with Steven D'Aprano. I never had problems with strip(), but if people find it confusing, Python can simply leave strip() and all the other function as they are and add another functions, like crop() or snip() or shear() prune() or mow(). Personally I prefer crop() or prune(). This way the

Re: pip UX Studies - help improve the usability of pip

2020-03-10 Thread Marco Sulla via Python-list
On Mon, 9 Mar 2020 at 16:09, Paul Moore wrote: > We've had some questions as to whether this survey is legitimate. I > can confirm it is (speaking as a pip core developer). Thank you a lot! -- https://mail.python.org/mailman/listinfo/python-list

Re: Python question

2020-03-10 Thread Marco Sulla via Python-list
On Fri, 6 Mar 2020 at 17:30, Souvik Dutta wrote: > And you cannot form opinions for > other people's by saying them not to support a person. That is injustice > and rude. I would reply, but I was already too much off topic. I want only to write what Gmail reports to me about the last message of t

Re: Error while installing a python code

2020-03-10 Thread Marco Sulla via Python-list
Little errata: you have only to install or update Cython, remove the .c files as I wrote before and run again python setup.py build_ext -b PoissonSolver/ No intermediate steps are required. The generated ELF files are three. You have also to rename them with the names in the README file. On Mon

Re: Python question

2020-03-10 Thread DL Neil via Python-list
On 11/03/20 7:34 AM, Michael Torrie wrote: On 3/10/20 6:40 AM, Chris Angelico wrote: On Tue, Mar 10, 2020 at 11:22 PM Marco Sulla via Python-list ... I'm also reading this in Gmail, and I didn't get any such warning. I'm going to call that a spurious warning, a false positive

Re: Installation of python

2020-03-10 Thread Marco Sulla via Python-list
*Ahem* I already posted the solution to your problem. I quote myself: I suppose you also downloaded the required sources from here: https://data.mendeley.com/datasets/s2x4d542dc/1 It seems the problem is that the above sources are generated by an old version of Cython: https://github.com/mcfletc

Re: [Python-ideas] Re: Magnitude and ProtoMagnitude ABCs — primarily for argument validation

2020-03-10 Thread Marco Sulla via Python-list
On Tue, 10 Mar 2020 at 13:41, Chris Angelico wrote: > It makes good sense for > division by 0 and division by 0.0 to both result in the same > exception. But Python 3 returns a float, for example, in division between integers. 4 / 2 == 2.0. So some_integer / +0 should return +Infinity. This is wh

Re: link to venv python sees a different sys.path

2020-03-11 Thread Jon Ribbens via Python-list
On 2020-03-11, Robin Becker wrote: > I'm trying to understand why python 3.8.2 venv behaves differently > when it is executed va a link Because site.py contains a function called venv() which looks up the path of the executed python binary, and searches for the virtual environment relative to tha

Re: Python question

2020-03-11 Thread DL Neil via Python-list
On 12/03/20 3:03 AM, Rhodri James wrote: On 11/03/2020 04:06, Michael Torrie wrote: On 3/10/20 6:49 PM, Souvik Dutta wrote: What about moving on to a social media app completely made in pythoj for python? No thanks. I don't want to be on yet another web forum.  I don't need "social media" or a

Re: [Mostly OT] Feedback on Python homework using Canvas LMS

2020-03-16 Thread DL Neil via Python-list
On 17/03/20 10:49 AM, Grant Edwards wrote: On 2020-03-16, Irv Kalb wrote: I like both suggestions, and will probably go with the non-breaking space (Option space on my Mac). I tested that and it works well. Until somebody tries to cut/paste the snippets you post into a .py file and run them

Re: PEP Idea: Multi-get for lists/tuples and dictionaries (inspired in NumPy)

2020-03-18 Thread DL Neil via Python-list
On 19/03/20 3:28 PM, Santiago Basulto wrote: ...> myself missing A LOT features from NumPy, like fancy indexing or boolean arrays. So, has it ever been considered to bake into Python's builtin list and dictionary types functionality inspired by NumPy? I think multi indexing alone would be huge a

Re: How to incorporate environment from with python.

2020-03-22 Thread DL Neil via Python-list
On 23/03/20 4:04 AM, Antoon Pardon wrote: I think I can best explain what I want by showing two bash sessions: Session 1) -- $ /opt/csw/bin/python Python 2.6.4 (r264:75706, Sep 9 2015, 15:05:38) [C] on sunos5 Type "help", "copyright", "credits" or "license" for more information. imp

Re: Like c enumeration in python3 [ERRATA]

2020-03-22 Thread DL Neil via Python-list
On 23/03/20 3:32 PM, Paulo da Silva wrote: Às 02:18 de 23/03/20, Paulo da Silva escreveu: Hi! Olá, Suppose a class C. I want something like this: class C: KA=0 KB=1 KC=2 ... Kn=n def __init__ ... ... These constants come

Re: Confusing textwrap parameters, and request for RE help

2020-03-24 Thread DL Neil via Python-list
On 23/03/20 8:00 AM, Chris Angelico wrote: When using textwrap.fill() or friends, setting break_long_words=False without also setting break_on_hyphens=False has the very strange behaviour that a long hyphenated word will still be wrapped. I discovered this as a very surprising result when trying

Re: Confusing textwrap parameters, and request for RE help

2020-03-24 Thread DL Neil via Python-list
On 25/03/20 10:30 AM, Chris Angelico wrote: On Wed, Mar 25, 2020 at 8:04 AM DL Neil via Python-list wrote: On 23/03/20 8:00 AM, Chris Angelico wrote: When using textwrap.fill() or friends, setting break_long_words=False without also setting break_on_hyphens=False has the very strange

Re: Confusing textwrap parameters, and request for RE help

2020-03-25 Thread DL Neil via Python-list
On 25/03/20 11:57 AM, Chris Angelico wrote: On Wed, Mar 25, 2020 at 9:37 AM DL Neil via Python-list wrote: As you observe, the problem with terminal emulators is the extent of their emulation and the degree of adoption of their 'extended features'! My concern grows because of t

Re: Module import best practice

2020-03-26 Thread DL Neil via Python-list
Rich, On 26/03/20 9:09 AM, Rich Shepard wrote: I'm writing an application using Python3 and Tkinter. The views/ directory contain multiple modules, including one called commonDlgs.py. This contains classes (such as those for validating data entry) used by all the data entry views. Some classe

Re: Module import best practice

2020-03-26 Thread DL Neil via Python-list
I'm not a professional coder. I'm an environmental consultant and I use a I take it all back then... No! No need to feel apologetic, the Python community works hard to be inclusive - which I take to include levels of expertise, not merely countering the various "-isms". variety of tools de

Re: error in importing

2020-03-31 Thread DL Neil via Python-list
On 31/03/20 11:23 PM, Jami Yaswanth wrote: i am not able to use the libraries that are installed using "pip install pandas" Welcome to Python! Are you aware of the Python-Tutor Discussion List? (https://mail.python.org/mailman/listinfo/tutor) Please describe how you installed these libraries.

Re: questions:

2020-04-01 Thread DL Neil via Python-list
On 2/04/20 6:49 AM, anson freer wrote: Will Anaconda2, Python2, jupyter and many applications I have for python harm the 3.8.2? should I be in Python Tutor and in this one(current email)at the same time? Or is it one or the other not both I want to learn how to use PDF to read files that have rac

Re: Fwd: Problemas para ejecutar Python en windows 7

2020-04-01 Thread DL Neil via Python-list
On 2/04/20 7:15 AM, Honori R. Camacho wrote: Ok. 1.- Necesitamos ayuda. No podemos ejecutar Python 3.5.4 en windows 7, se descargo la version Python 3.5.4 y se instalo correctamente.Y se corrigieron los path. Pero no permite ejecutar los .py ni los .pyw por acceso directo. gracias. Hola! Pytho

Re: Fwd: Problemas para ejecutar Python en windows 7

2020-04-02 Thread DL Neil via Python-list
On 2/04/20 7:24 PM, Honori R. Camacho wrote: Gracias por atender esta solicitud. Si, no explique que antes se ejecutaba correctamente, pero ocurio que por error se desinstalo un *frameworks* y desde ahi consideramos, empezaron los problemas. Se reinstalo el Python 3.5.4 desde los repositorios d

Re: Window and position of figure

2020-04-04 Thread DL Neil via Python-list
I already use the IDL software. Now I`m using Python. In IDL I havethe vector position=(xo,yo,x1,y1) to set where Iwnat to plot my figure in my window. I have an 2d array with x and y dimensition equal 5224. when I plot my figure, using contourtf it takes up a small part of my window. What can I

Re: kill a window

2020-04-07 Thread DL Neil via Python-list
On 8/04/20 4:37 AM, J Conrado wrote: ... plt.title("Região a Ser Setorizada") plt.show() plt,close(1) and to kil the window I have to click on the "X" in the top my window. What can I do to kil the window and plot other windows in squence. Ola, perhaps use dotted-notation: plt.close( 1

Re: Fwd: Troubling running my Python

2020-04-08 Thread DL Neil via Python-list
I have downloaded the 3.8 64 bit python program to my PC but the interpreter will not run. It seems to have 'repaired' itself when I ran the setup again but the interpreter still won't run. Is there a reason for this? Do you require a screenshot? Welcome to Python! This is an FAQ because Pyth

Re: type annotations for xpath list

2020-04-08 Thread DL Neil via Python-list
On 9/04/20 10:02 AM, Martin Alaçam wrote: Hello, I have the following descriptor: self._pi = None @property def pi(self) -> list: self._pi = self._root.xpath('processing-instruction()') return self._pi Mypy says: "Incompatible return value type (got "None", exp

Re: Is it possible to inheret a metaclass.

2020-04-10 Thread Greg Ewing via Python-list
On 11/04/20 12:19 am, Pieter van Oostrum wrote: Your Pardon is not a class, it is a function. To elaborate on that a bit, the way inheritance of metaclasses works is that when you define a class, if you don't explicity specify a metaclass, it uses the class of the base class as the metaclass.

Re: RFC: For Loop Invariants

2020-04-10 Thread DL Neil via Python-list
On 11/04/20 8:44 AM, Elliott Dehnbostel wrote: If I've done this incorrectly, please let me know so that I can improve/revise. I'm new to the Python community and quite enjoy the more functional features of Python 3, but have I have a peeve about it. I'd like to propose and discuss the following

My New Project : Aduct

2020-04-12 Thread J.Arun Mani via Python-list
Hello, I made my first Python package that can be installed via PIP. It is called "Aduct". https://github.com/atornel/Aduct. Aduct is a toolkit to design graphical applications that can be dynamically changed with a little work as possible. It is designed by inheriting objects provided by [Gtk](

Re: python

2020-04-15 Thread DL Neil via Python-list
On 15/04/20 2:05 PM, mike via Python-list wrote: I need somehelpwith Python 36-32 and 38-32 I have been using sublime text 3 asmy ide for about 1 year now and everything was fine -I tried to change to Pycharm 2020 - I was going to use sublime 3 as my IDE for python36-32 and the Pycharm2020

Re: DLL file was not loading everytime when pandas was use to run

2020-04-15 Thread DL Neil via Python-list
On 15/04/20 6:47 PM, [email protected] wrote: Whenever I try to run any file in which pandas was import it was showing that dll file is not loaded Please copy-paste the *exact* error message. Are you aware of the Python-Tutor list? https://mail.python.org/mailman/listinfo/tutor -- R

Re: ERROR GENERATED AFTER INSTALLING PYTHON 3.5.2 64-BIT

2020-04-15 Thread Tarjei Bærland via Python-list
ogunleye ayobami writes: > Dear Python Team, > > After downloading and installing python on my system, error generated on > command prompt is > C:\Users\Olakunle Johnson>python > > *'python' is not recognized as an internal or external command,operable > program or batch file.* Given that the in

Re: What variable type is returned from Open()?

2020-04-15 Thread DL Neil via Python-list
On 16/04/20 1:55 AM, [email protected] wrote: As much as possible, I make use of optional type hints. So if I know a function returns an integer, then I use this_number_i : int = GetThisNumber() But there's no 'file' type, so I'm not sure what to use as the type for the return value of an Op

Re: Helping Windows first time users

2020-04-15 Thread DL Neil via Python-list
On 16/04/20 3:34 PM, Dennis Lee Bieber wrote: On Wed, 15 Apr 2020 19:23:43 +0100, Barry Scott declaimed the following: I post some suggestion to improve the Python installer for Windows to better sign post users on the next steps. https://mail.python.org/archives/list/[email protected]/

Re: What variable type is returned from Open()?

2020-04-17 Thread DL Neil via Python-list
On 18/04/20 4:18 AM, [email protected] wrote: Yes,personal preference is definitely a factor and a bias, in these matters. But aside from trying to make it easier for future A.I. to figure out what the heck we humans were doing, it also makes a difference in how the IDE interpets the code.

Re: python read line by line and keep indent

2020-04-17 Thread DL Neil via Python-list
On 18/04/20 11:10 AM, [email protected] wrote: I am reading a Python file and find an specific line, replace a text and then write back to the file. When I check back the file, I am getting indent error. How to fix this issue. Please make it easier for us (volunteers giving-up our free ti

Re: Floating point problem

2020-04-18 Thread DL Neil via Python-list
On 19/04/20 1:07 AM, Souvik Dutta wrote: I have one question here. On using print(f"{c:.32f}") where c= 2/5 instead of getting 32 zeroes I got some random numbers. The exact thing is 0.40002220446049250313 Why do I get this and not 32 zeroes? Approximating decimal numbers as binary

Re: Floating point problem

2020-04-18 Thread DL Neil via Python-list
computer behave so differently? Please don't top-post - (human) conversations are normally question followed by answer, not the other way around! Computers use binary, not decimal - asked and answered (see previous first response, below) On Sat, 18 Apr, 2020, 7:02 pm DL Neil via P

Re: Issues regarding the download

2020-04-18 Thread DL Neil via Python-list
On 18/04/20 6:20 PM, MRIDULA GUPTA wrote: Hi, I am a new user and I am facing difficulty using the app. everytime I click on the app the windows open which tell me either to modify the app or repair it or uninstall it. I did my level best but still I am facing problems installing it. please look

Springer released free ebooks (epub and pdf)

2020-04-18 Thread DL Neil via Python-list
Springer (publisher) has released a bunch of eBook versions of Python text-books, free to download (.PDF and/or .EPUB), in support of COVID-19 stay-at-homes. This sub-list features texts for all 'levels' of mastery, and published between 2014 and 2019/20. They tend to be 'solid' content, cf 'D

Re: Why is a generator expression called a expression?

2020-04-20 Thread DL Neil via Python-list
On 20/04/20 9:19 PM, Chris Angelico wrote: On Mon, Apr 20, 2020 at 6:51 PM Veek M wrote: The docs state that a expression is some combination of value, operator, variable and function. Also you cannot add or combine a generator expression with a value as you would do with 2 + 3 + 4. For exampl

Re: RFC: For Loop Invariants

2020-04-20 Thread Tony Flury via Python-list
On 10/04/2020 21:44, Elliott Dehnbostel wrote: *We could do this:* chars = "abcaaabkjzhbjacvb" seek = {'a','b','c'} count = sum([1 for a in chars if a in seek]) However, this changes important semantics by creating an entire new list before summing. Creating the list is pointless in this ca

Re: Getting the dependencies of a function from a library

2020-04-20 Thread DL Neil via Python-list
On 21/04/20 9:40 AM, elisha hollander wrote: I have a python library with a function. This function call some other functions, classes and variable from the library (and those functions and classes call other ones, etc)... Can I automatically create a file with all of the dependencies (and nothin

python and numpy

2020-04-21 Thread Derek Vladescu via Python-list
I’ve just begun a serious study of using Python as an aspiring programmer/data scientist. Can someone please walk me through how to download Python, SO THAT I will be able to import numpy? Thanks, Derek Sent from Mail for Windows 10 -- https://mail.python.org/mailman/listinfo/python-list

Re: news.bbs.nz is spewing duplicates to comp.lang.python

2020-04-23 Thread DL Neil via Python-list
Have tracked-down and communicated with the site owner/operator. He advised a loop-back problem which has now been blocked. -- Regards =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: How to test the data type of a variable

2020-04-23 Thread DL Neil via Python-list
On 24/04/20 1:24 PM, Deac-33 Lancaster wrote: I'm aware that you can find the type of a variable with type(var) But are there Boolean operators in Python3.8 to test the data type, e.g. is_floate(var) is_string(var) etc. ? You are close! https://docs.python.org/3/library/functions.htm

Re: How to test the data type of a variable

2020-04-23 Thread DL Neil via Python-list
On 24/04/20 1:24 PM, Deac-33 Lancaster wrote: I'm aware that you can find the type of a variable with type(var) But are there Boolean operators in Python3.8 to test the data type, e.g. is_floate(var) is_string(var) etc. ? There is also a 'pythonic' answer (what is the 'Python way'?)

Re: How to test the data type of a variable

2020-04-23 Thread DL Neil via Python-list
... Is there a way to see all of the groups? Yes! Follow the link at the bottom of this email msg. Then follow the link at the bottom of this list's web-page ... -- Regards =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: How to test?

2020-04-24 Thread DL Neil via Python-list
On 25/04/20 6:40 AM, Manfred Lotz wrote: I have a command like application which checks a directory tree for certain things. If there are errors then messages will be written to stdout. How to test this in the best way? One idea was for the error situations to write messages to files and then l

Re: How to test?

2020-04-24 Thread DL Neil via Python-list
May I point-out that the above may not be the best approach. Rather than using screen-prints to report errors, another method is to utilise "logging" to collect such data - so that there is always a formal record (regardless of user behavior). During 'production' the information could be collected

Re: How to test?

2020-04-24 Thread DL Neil via Python-list
On 25/04/20 5:16 PM, Manfred Lotz wrote: On Fri, 24 Apr 2020 19:12:39 -0300 Cholo Lennon wrote: On 24/4/20 15:40, Manfred Lotz wrote: I have a command like application which checks a directory tree for certain things. If there are errors then messages will be written to stdout. How to test t

Re: How to test?

2020-04-25 Thread DL Neil via Python-list
On 25/04/20 7:53 PM, Manfred Lotz wrote: On Sat, 25 Apr 2020 18:41:37 +1200 DL Neil wrote: On 25/04/20 5:16 PM, Manfred Lotz wrote: On Fri, 24 Apr 2020 19:12:39 -0300 Cholo Lennon wrote: On 24/4/20 15:40, Manfred Lotz wrote: I have a command like application which checks a directory tr

Re: Python Problems

2020-04-26 Thread DL Neil via Python-list
On 26/04/20 8:06 PM, helal uddin wrote: https://drive.google.com/open?id=1DCciLNPkARXnVIHFhXmijRTbFEC9Xsa- Please visit this link to see my problem I'm facing some problems to installlibraries like 'torch library' My Operating System is Windows 10 64bit. <<< 404. That’s an error. The reque

Re: Python Problems

2020-04-26 Thread DL Neil via Python-list
On 27/04/20 11:29 AM, Mats Wichmann wrote: On 4/26/20 2:06 AM, helal uddin wrote: https://drive.google.com/open?id=1DCciLNPkARXnVIHFhXmijRTbFEC9Xsa- Please visit this link to see my problem I'm facing some problems to installlibraries like 'torch library' My Operating System is Windows 10 64

Re: How to test?

2020-04-26 Thread DL Neil via Python-list
If I have understood correctly, the objective is to check a dir-tree to ensure that specific directory/file-permissions are in-effect/have not been changed. The specifications come from a .JSON file and may be over-ridden by command-line arguments. Correct? Yes. How to test this in the best

Bug in the urljoin library

2020-04-28 Thread Moro, Andrea via Python-list
Hello there, I believe there is a bug in the urljoin library. See below: p = urlparse(url) if p.scheme == '': url = urljoin('http://', url) Input: domain.tld/somepath Output http:///domain.tld/somepath p = urlparse(url) if p.scheme == '': url = urljoin('http:', url) Input: domain.tld/somepa

Re: Function to avoid a global variable

2020-04-29 Thread Tony Flury via Python-list
On 28/04/2020 06:49, [email protected] wrote: bvdp於 2020年4月28日星期二 UTC+8上午9時46分35秒寫道: Oh my, that is very cool! So, I can do this: def foo(i): if not 'bar' in foo.__dict__: foo.bar = 5 foo.bar += i You can have function attribute created this way if you like: def foo

Re: What user-defined request error levels are recommended?

2020-04-30 Thread Ed Leafe via Python-list
On Apr 30, 2020, at 15:14, Dan Campbell wrote: > > Hi, what range of error codes are recommended, if we wanted to return a > user-defined code? > > Obviously, we don't want to use a code in the 200+ range, or the 400+ range, > e.g. > > I want to throw, or just return, a code that represents t

Re: How to test?

2020-05-01 Thread DL Neil via Python-list
Given your replies, 'now' might be a good time to take a look at Pytest, and see how you could use it to help build better code - by building tested units/functions which are assembled into ever-larger tested-units... (there is a range of choice/other testing aids if Pytest doesn't take your fancy

Re: Function to avoid a global variable

2020-05-01 Thread DL Neil via Python-list
On 28/04/20 7:36 PM, Chris Angelico wrote: "Best"? Not sure about that. Functions are first-class objects in Python, so a function *is* a callable object. You don't have to create a custom class with a call method just to be able to attach attributes to your function. ChrisA Using a mutable o

Re: Function to avoid a global variable

2020-05-01 Thread DL Neil via Python-list
On 2/05/20 11:30 AM, Chris Angelico wrote: On Sat, May 2, 2020 at 9:14 AM DL Neil via Python-list wrote: On 28/04/20 7:36 PM, Chris Angelico wrote: "Best"? Not sure about that. Functions are first-class objects in Python, so a function *is* a callable object. You don't h

Re: Function to avoid a global variable

2020-05-01 Thread DL Neil via Python-list
On 2/05/20 12:00 PM, Bob van der Poel wrote: I still think that the use of a keyword like "static" would be easiest. def foo(arg): static counter = 0 counter += 1 if counter ... And in this case static just means that it's a variable only readable inside foo() and it should maint

OT-Comic: Tabs vs Spaces

2020-05-02 Thread DL Neil via Python-list
Is this the way to write Python Enhancement Proposals (PEPs)? eg https://www.python.org/dev/peps/pep-0008/#indentation TabError: inconsistent use of tabs and spaces in indentation https://www.geeksaresexy.net/2020/05/01/the-tab-club-comic/ -- Regards, =dn -- https://mail.python.org/mailman/listin

Docs - beyond tabs, spaces, PEPs...

2020-05-02 Thread DL Neil via Python-list
To make-up to those people who frowned at the earlier OT-Comic post... There are changes in-the-wind, in the way Python should/could be documented. Currently, there is a difficulty in 'scaling' the documentation to cope with the growing range of language user-types, as well as keeping-up wi

Re: OT-Comic: Tabs vs Spaces

2020-05-02 Thread DL Neil via Python-list
On 3/05/20 9:07 AM, Chris Angelico wrote: On Sun, May 3, 2020 at 6:33 AM DL Neil via Python-list wrote: Is this the way to write Python Enhancement Proposals (PEPs)? eg https://www.python.org/dev/peps/pep-0008/#indentation TabError: inconsistent use of tabs and spaces in indentation https

The '-c' CLI option removes just the command str.

2020-05-05 Thread Simon Forman via Python-list
Is this anything? When you run a python command from the shell to just print the command line args you get this: $ python -c "import sys; print(sys.argv)" ['-c'] But I would expect one of these: Either the '-c' option consumes both args: $ python -c "import sys; print(sys.argv)"

Re: Can a print overwrite a previous print ?

2020-05-08 Thread Sir Real via Python-list
On Fri, 8 May 2020 16:25:52 +0200, ast wrote: >Hello > > >Suppose we want that: > >print("abcdef"); print("ghi") > >produces: > >ghidef > >The 2nd print overwrites the first one. >Is it feasible ? > >It should since the progress bar tdqh seems to do that > >try: > >from tkdm import tkdm > >for i

Re: Not able use installed modules

2020-05-08 Thread DL Neil via Python-list
On 7/05/20 4:15 PM, Music lover wrote: Hello python team, I have installed the latest version of python from your site. Then I successfully installed some modules like :- numpy , pandas, matplotlib from command prompt. But I am not able to use them while programing in python Idle. It'

Re: php to python code converter

2020-05-14 Thread Jon Ribbens via Python-list
On 2020-05-14, MRAB wrote: > Look at the date of the original post. It says "8 May 2009". That's over > 11 years ago! > > Since then, Google Code has ceased to exist. Disgraceful, all URLs should continue to work for at least as long as this one has: http://info.cern.ch/hypertext/WWW/TheProject.

Re: php to python code converter

2020-05-15 Thread DL Neil via Python-list
On 15/05/20 12:58 AM, Jon Ribbens via Python-list wrote: On 2020-05-14, MRAB wrote: Look at the date of the original post. It says "8 May 2009". That's over 11 years ago! Since then, Google Code has ceased to exist. Disgraceful, all URLs should continue to work for at least

Re: Help with installation please

2020-05-15 Thread DL Neil via Python-list
On 15/05/20 4:18 PM, Jhoana Kacheva Melissa Joseph wrote: Hello, I downloaded python 3.8 in my windows, I selected the box for the path but when I try to run it in powershell it brought me to app store to get it again. Please advise if the following reference is accurate, and works for you: h

OT: ALGOL 60 at 60

2020-05-16 Thread DL Neil via Python-list
ALGOL 60 at 60: The greatest computer language you've never used and grandaddy of the programming family tree Back to the time when tape was king By Richard Speed 15 May 2020 at 09:47 https://www.theregister.co.uk/2020/05/15/algol_60_at_60/ NB 'El Reg' is known for its irreverent and cynical vie

Re: Fwd: Unable to Install Python (3.5.0) Properly

2020-05-17 Thread DL Neil via Python-list
On 17/05/20 7:06 PM, Tarun Pathak wrote: -- Forwarded message - From: Tarun Pathak Date: Sun, May 17, 2020, 12:07 PM Subject: Unable to Install Python (3.5.0) Properly To: Dear Sir/Madam, I am trying to install Python for a while. But failed to do so. Tried with different

Re: Help with installation please

2020-05-17 Thread DL Neil via Python-list
On 18/05/20 10:52 AM, Oscar Benjamin wrote: On Sun, 17 May 2020 at 15:21, Mats Wichmann wrote: On 5/15/20 9:47 PM, Souvik Dutta wrote: I dont know if you should shift from powershell to cmd. Python kinda does not work in powershell. Powershell has a funky way of looking up programs, with th

Re: Determining index of range of values in a matrix

2020-05-19 Thread DL Neil via Python-list
On 19/05/20 6:40 AM, [email protected] wrote: Hi All, I am using python for doing the following: I have a matrix which has dimension of 174*993. Each row of the matrix has some numbers in the range of 30-30.5. I would like to determine the index of the numbers in the range of 30-30.5 in

Re: Strings: double versus single quotes

2020-05-19 Thread DL Neil via Python-list
On 20/05/20 6:26 AM, Chris Angelico wrote: On Wed, May 20, 2020 at 4:21 AM Manfred Lotz wrote: Hi there, I am asking myself if I should preferably use single or double quotes for strings? If I need a single quote in a string I would use double quotes for the whole string and vice versa. For f

Missing python curses functions?

2020-05-19 Thread Alan Gauld via Python-list
During my Covid19 lock-down I thought I'd spend my time translating the "Linux Curses Programming HOWTO" document into Pythonic curses. One of the functions discussed that does not appear to have a Python equivalent is attr_get() which gets the current attributes. There are functions aplenty for

Re: why no camelCase in PEP 8?

2020-05-19 Thread DL Neil via Python-list
On 20/05/20 8:49 AM, Chris Angelico wrote: On Wed, May 20, 2020 at 6:38 AM Jim wrote: On 5/19/20 1:24 PM, Chris Angelico wrote: On Wed, May 20, 2020 at 4:03 AM Schachner, Joseph wrote: And, because '_' looks sort of like a space, the individual words are more easily readable. notEveyoneT

Re: Strings: double versus single quotes

2020-05-19 Thread Alan Gauld via Python-list
On 19/05/2020 19:10, Manfred Lotz wrote: > Hi there, > I am asking myself if I should preferably use single or double quotes > for strings? Personally laziness wins every time. Single quotes only require one finger from the home position using my right hand, double quotes require two and a big mov

Re: Missing python curses functions?

2020-05-20 Thread Alan Gauld via Python-list
On 20/05/2020 01:48, Cameron Simpson wrote: > It may be that the person who wrote the curses module simply got tired. That was my assumption. Although the implementation includes some functions that are a lot more obscure. Usually when one is missing there is an alternative with the same effect

Solved: Re: Missing python curses functions?

2020-05-20 Thread Alan Gauld via Python-list
On 19/05/2020 20:53, Alan Gauld via Python-list wrote: > One of the functions discussed that does not appear to have > a Python equivalent is attr_get() which gets the current > attributes. OK, Using inch() I've written the following function: def attr_get(win): ""

Re: Python not running

2020-05-20 Thread DL Neil via Python-list
On 21/05/20 2:22 AM, Supriyo Roy wrote: I have installed the latest version of python which is 3.8.3. However, when I try to run a sample program, a small python icon appears on my taskbar for a split second and then disappears. Nothing else happens. Please advise me on how to get python up and r

Re: Can't run program

2020-05-20 Thread DL Neil via Python-list
On 21/05/20 7:16 AM, Dennis Lee Bieber wrote: On Tue, 19 May 2020 20:31:28 -0400, Ryan Harrington declaimed the following: Hi - I'm not the least bit technical. Trying to learn through YouTube. I've gotten exit code 1, 2, 106. Tried setting up the project interpreter and can't figure it out. T

exiting a while loop

2020-05-22 Thread John Yeadon via Python-list
Am I unreasonable in expecting this code to exit when required? # Add up the powers of 2 starting with 2**0 until 2 million is met. n = 1 target = 200 sum = 0 while True: x = 2 ** (n - 1) sum += x print(n, sum) if sum >= target: print("Target met.") exit

Re: Online training June 11, 12: Docker packaging best practices for Python in production

2020-05-22 Thread DL Neil via Python-list
On 23/05/20 3:40 AM, Itamar Turner-Trauring wrote: You’re about to ship your Python application into production using Docker: your images are going to be critical infrastructure. ... *The class will take place on two mornings (US East Coast) on June 11th and 12th. You can **learn more about

Re: exiting a while loop

2020-05-22 Thread DL Neil via Python-list
On 23/05/20 4:31 AM, Grant Edwards wrote: On 2020-05-22, Peter Otten <[email protected]> wrote: If you want to terminate the script you can use exit. However exit is a function, and you have to call it exit() Actually it's an instance of _sitebuiltins.Quitter not a function. You still have

Re: Strings: double versus single quotes

2020-05-22 Thread DL Neil via Python-list
I am asking myself if I should preferably use single or double quotes for strings? ... I agree to the following: 1. Consistency is important. 2. Single quotes are less noisy. 3. Triple double quotes are to be preferred over triple single quotes. ... Of course, this is my subjective result,

Re: Strings: double versus single quotes

2020-05-23 Thread DL Neil via Python-list
On 23/05/20 11:03 PM, Skip Montanaro wrote: I also agree about SQL. I found that something like this: stmt = ( """select foo from bar""" """ where a = 'bag'""" """and c = 'dog'""" ) worked pretty well, served to both satisfy my brain's desire for semantic indentation (you sh

Re: Strings: double versus single quotes

2020-05-23 Thread DL Neil via Python-list
On 24/05/20 4:03 AM, Tim Chase wrote: On 2020-05-24 01:40, Chris Angelico wrote: On Sat, May 23, 2020 at 10:52 PM Abdur-Rahmaan Janhangeer wrote: The interpreter prefers single-quotes "single or double" 'single or double' 'not all that strongly, it doesn\'t' "not all that strongly,

Re: Fwd: installed but doesn't boot

2020-05-23 Thread DL Neil via Python-list
On 24/05/20 4:55 AM, Ben Hansen wrote: -- Forwarded message - From: Ben Hansen Date: Sat, May 23, 2020 at 11:44 AM Subject: Fwd: installed but doesn't boot To: -- Forwarded message - From: Ben Hansen Date: Fri, May 22, 2020 at 3:18 PM Subject: installed b

Re: Strings: double versus single quotes

2020-05-23 Thread DL Neil via Python-list
On 24/05/20 8:39 AM, Skip Montanaro wrote: May I ask why not simply like this: stmt = """ select foo from bar where a = 'bag' and c = 'dog' """ Sorry, I don't recall. I wouldn't be at all surprised that it has something to do with Emacs's Python mode behavio

Re: Strings: double versus single quotes

2020-05-24 Thread DL Neil via Python-list
On 24/05/20 5:43 PM, Frank Millman wrote: On 2020-05-23 9:45 PM, DL Neil via Python-list wrote: My habit with SQL queries is to separate them from other code, cf the usual illustration of having them 'buried' within the code, immediately before, or even part of, the query call.

<    33   34   35   36   37   38   39   40   41   42   >