Re: making your own DirEntry.

2023-12-22 Thread DL Neil via Python-list
Antoon, On 12/23/23 01:00, Antoon Pardon via Python-list wrote: I am writing a program that goes through file hierarchies and I am mostly using scandir for that which produces DirEntry instances. At times it would be usefull if I could make my own DirEntry for a specific path, however when I t

Re: How/where to store calibration values - written by program A, read by program B

2023-12-05 Thread DL Neil via Python-list
Apologies: neglected suggested web.refs: https://datagy.io/python-environment-variables/ https://pypi.org/project/json_environ/ -- Regards =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: How/where to store calibration values - written by program A, read by program B

2023-12-05 Thread DL Neil via Python-list
On 12/6/23 03:37, Chris Green via Python-list wrote: Is there a neat, pythonic way to store values which are 'sometimes' changed? My particular case at the moment is calibration values for ADC inputs which are set by running a calibration program and used by lots of programs which display the va

Re: Newline (NuBe Question)

2023-11-26 Thread 7;DL Neil' via Python-list
Avi, On 11/27/2023 4:15 PM, avi.e.gr...@gmail.com wrote: Dave, Back on a hopefully more serious note, I want to make a bit of an analogy with what happens when you save data in a format like a .CSV file. Often you have a choice of including a header line giving names to the resulting columns,

Re: Newline (NuBe Question)

2023-11-26 Thread DL Neil via Python-list
On 11/27/2023 10:04 AM, Peter J. Holzer via Python-list wrote: On 2023-11-25 08:32:24 -0600, Michael F. Stemper via Python-list wrote: On 24/11/2023 21.45, avi.e.gr...@gmail.com wrote: Of course, for serious work, some might suggest avoiding constructs like a list of lists and switch to using m

Re: Newline (NuBe Question)

2023-11-26 Thread DL Neil via Python-list
On 11/27/2023 1:08 AM, Roel Schroeven via Python-list wrote: I prefer namedtuples or dataclasses over tuples. They allow you to refer to their fields by name instead of index: student.gpa is much clearer than student[2], and makes it less likely to accidentally refer to the wrong field. +1 re

Re: Newline (NuBe Question)

2023-11-26 Thread DL Neil via Python-list
On 11/27/2023 12:48 AM, Chris Angelico via Python-list wrote: On Sun, 26 Nov 2023 at 21:08, Michael F. Stemper via Python-list wrote: On 24/11/2023 21.45, avi.e.gr...@gmail.com wrote: Grizz[l]y, I think the point is not about a sorted list or sorting in general It is about reasons why mainta

Re: Printing dict value for possibly undefined key

2023-11-25 Thread DL Neil via Python-list
On 11/25/2023 3:31 AM, Loris Bennett via Python-list wrote: Hi, I want to print some records from a database table where one of the fields contains a JSON string which is read into a dict. I am doing something like print(f"{id} {d['foo']} {d['bar']}") However, the dict does not always have

Re: C is it always faster than nump?

2022-02-26 Thread Neil
to get much > of the speed of Fortran in C. But it required using an error prone subset > of C without good error detection. Pointers were introduced in Fortran 90. Neil. -- https://mail.python.org/mailman/listinfo/python-list

Re: Getting Directory of Command Line Entry Point For Packages

2021-11-12 Thread David L Neil via Python-list
On 13/11/2021 10.51, Abdur-Rahmaan Janhangeer wrote: > Greetings list, > > Let's say i created a package named miaw > > miaw also has a cli command called miaw > > miaw prints files and folders in the directory it is called in > > except that when miaw is used, it prints the files and folders i

Re: The task is to invent names for things

2021-10-26 Thread David L Neil via Python-list
On 27/10/2021 12.29, Stefan Ram wrote: > dn writes: >> On 27/10/2021 11.16, Stefan Ram wrote: >>> The Mental Game of Python - Raymond Hettinger (PyBay 2019) >>> | "The computer gives us words that do ### things. > ... >> Alternately, if your question was to identify the mumbled word, it is >> (se

Re: XML Considered Harmful

2021-09-24 Thread David L Neil via Python-list
On 25/09/2021 11.00, Chris Angelico wrote: > Invented because there weren't enough markup languages, so we needed another? Anything You Can Do I Can Do Better https://www.youtube.com/watch?v=_UB1YAsPD6U -- Regards =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Help me split a string into elements

2021-09-04 Thread Neil
DFS wrote: > Typical cases: > lines = [('one\ntwo\nthree\n')] > print(str(lines[0]).splitlines()) > ['one', 'two', 'three'] > > lines = [('one two three\n')] > print(str(lines[0]).split()) > ['one', 'two', 'three'] > > > That's the result I'm wanting, but I get data in a slightly differen

Re: Ask for help on using re

2021-08-05 Thread Neil
Jach Feng wrote: > I want to distinguish between numbers with/without a dot attached: > text = 'ch 1. is\nch 23. is\nch 4 is\nch 56 is\n' re.compile(r'ch \d{1,}[.]').findall(text) > ['ch 1.', 'ch 23.'] re.compile(r'ch \d{1,}[^.]').findall(text) > ['ch 23', 'ch 4 ', 'ch 56 '] > > I

Re: Horrible abuse of __init_subclass__, or elegant hack?

2021-04-01 Thread David L Neil via Python-list
Officially April-Fools Day is over (here), but... On 01/04/2021 19.25, Chris Angelico wrote: > On Thu, Apr 1, 2021 at 3:36 PM dn via Python-list > wrote: >> >> On 01/04/2021 13.54, Chris Angelico wrote: >>> Real and imaginary are the same thing, just rotated a quarter turn >> >> In which dim

Re: Application window geometry specifier

2021-01-13 Thread David L Neil via Python-list
On 14/01/2021 15.25, boB Stepp wrote: > On Wed, Jan 13, 2021 at 7:28 PM Chris Angelico wrote: > >> I love how "I think" is allowed to trump decades of usability research. I'm just pleased that @Chris has found love! (not detracting from the point though) > Can you recommend a good reference fo

Re: Some problem in code execution in python

2021-01-07 Thread David L Neil via Python-list
On 07/01/2021 22.44, Dario Dario wrote: > Sir, I am one of the user of your python program, that is after completion > of installation I got some statement like "you got code execution problem > ". I don't know how to rectify this problem.so please help me to rectify > this problem . > You send me

Re: Funny error message

2021-01-01 Thread DL Neil via Python-list
On 1/2/21 9:39 AM, Bob van der Poel wrote: > > > On Fri, Jan 1, 2021 at 12:17 PM DL Neil via Python-list > mailto:python-list@python.org>> wrote: > > On 1/2/21 6:35 AM, Bob van der Poel wrote: > > Found it! > > Well done! > > > &

Re: Funny error message

2021-01-01 Thread DL Neil via Python-list
On 1/2/21 6:35 AM, Bob van der Poel wrote: > Found it! Well done! >> I had the proper urllib3 installed. But, in my .local/lib/ a previous >> version was installed. Removing .local/lib/python3.8 has resolved the >> problem. >> >> Anyone hazard a guess as to why I had a .local tre

Re: Funny error message

2020-12-31 Thread DL Neil via Python-list
On 1/1/21 11:46 AM, Bob van der Poel wrote: > When I run python from the command line and generate an error I get the > following: > > Python 3.8.5 (default, Jul 28 2020, 12:59:40) > [GCC 9.3.0] on linux > Type "help", "copyright", "credits" or "license" for more information. z > /home/bob/.l

Re: Fw: See example

2020-12-04 Thread DL Neil via Python-list
On 05/12/2020 09:17, Dan Stromberg wrote: On Fri, Dec 4, 2020 at 12:01 PM dn via Python-list mailto:python-list@python.org>> wrote: On 05/12/2020 07:57, Arthur R. Ott wrote: ... >     Microsoft Windows [Version 10.0.19042.630] >     (c) 2020 Microsoft Corporation. All right

Re: Winreg

2020-07-31 Thread David L Neil via Python-list
On 31/07/2020 16:48, R Pasco wrote: Thanks for your extensive info. Its too bad this isn't published in the python winreg/_winreg modules' info. Ray Pasco Welcome to the world of documentation! Perhaps you have 'discovered' something, or maybe you're using the tool in an unusual way, or mayb

Re: Local access to a file, How To ?

2020-07-28 Thread DL Neil via Python-list
On 29/07/2020 08:56, Steve wrote: I have a python program that reads and writes to files that are all within the folder that contains the python program. There is now a second python program that is to be run to compile information in said files. I am having difficulty trying to call the local

Re: Friday Finking: Limiting parameters

2020-07-11 Thread DL Neil via Python-list
On 12/07/20 9:46 AM, Christman, Roger Graydon wrote: I'll preface this by saying I am a programming instructor who still teaches from the ivory tower, so may not necessarily reflect actual practice in industry. ...in which case I will preface my response by saying that one of the virtues of th

Re: Friday Finking: Limiting parameters

2020-07-11 Thread DL Neil via Python-list
On 12/07/20 8:13 AM, Peter J. Holzer wrote: On 2020-07-11 09:54:33 +1200, dn via Python-list wrote: Questions: Is the idea of limiting the number of parameters passed across an interface a real concern or somewhat an affectation? Is three, five, seven, ... a valid limit (or warning-signal)? D

Re: Need a Dynamic vlookup using python

2020-07-11 Thread DL Neil via Python-list
On 11/07/20 8:34 PM, narenchund...@gmail.com wrote: Any suggestions please Clarify the requirements, rather than starting with a 'solution'. Communicate the constraints, eg what is already in-place. "vlookup" has particular meaning in worksheet/spreadsheet packages. Is that what you are usin

Re: Questioning the effects of multiple assignment

2020-07-08 Thread DL Neil via Python-list
On 8/07/20 10:19 PM, Peter J. Holzer wrote: On 2020-07-08 12:26:06 +1200, dn via Python-list wrote: OTOH, using a tuple doesn't prevent the function from mutating mutable arguments: #!/usr/bin/python3 def f(*a): a[0]["new"] = 2 v = { "old": 1} f(v) print(v) prints «{'old': 1, 'new': 2}».

Re: Assign Excel cell value from Datepicker widget Selection using Python

2020-07-06 Thread DL Neil via Python-list
On 5/07/20 5:20 AM, narenchund...@gmail.com wrote: I am trying to assign a widget to an excel cell. Convertion wont help me.Thanks If you are following this post, you may be interested to view:- Using Widgets in Jupyter Notebook (Video) July 5, 2020 in the Mouse vs Python series. Whilst I have

Re: Assign Excel cell value from Datepicker widget Selection using Python

2020-07-04 Thread DL Neil via Python-list
On 5/07/20 5:20 AM, narenchund...@gmail.com wrote: I am trying to assign a widget to an excel cell. Convertion wont help me.Thanks That's true - and false! Unfortunately, these posts have revealed little about you and your level of understanding of Python specifically, and computer programmi

Re: Data structures and Algorithms

2020-06-30 Thread DL Neil via Python-list
On 1/07/20 1:18 AM, Richard Damon wrote: On 6/30/20 8:26 AM, Cameron Simpson wrote: On 30Jun2020 10:52, satyaprasad wrote: Hi, I am currently in learning process of python have been worked on some desktop application using pyqt . I want improve my DSA area but i searched so many videos mot sur

Re: i don't understand this python class

2020-06-29 Thread DL Neil via Python-list
On 30/06/20 5:14 AM, joseph pareti wrote: I have piece of code with constructs as follows: *class* *SentimentNetwork**:* *def* __init__*(*self*,* reviews*,* labels*,* hidden_nodes *=* 10*,* learning_rate *=* 0.1*):* np*.*random*.*seed*(*1*)* self*.*init_network*(**len**(*s

Re: Assign Excel cell value from Datepicker widget Selection using Python

2020-06-28 Thread DL Neil via Python-list
On 29/06/20 6:01 AM, narenchund...@gmail.com wrote: Datepicker is returning two different types. before date change its and after change its Well done! When it is printed, the date probably makes sense (to us), and the debug-print has given you the opportunity to make sure the data is exa

Re: Assign Excel cell value from Datepicker widget Selection using Python

2020-06-28 Thread DL Neil via Python-list
On 29/06/20 3:04 AM, narenchund...@gmail.com wrote: When I run the python code I should be able to open my Excel and when I click on one Excel cell I should have my datepicker widget popped up and I should be able to select any date from my datepicker widget as my Excel cell value Tried below

Re: problem at the time of using editor

2020-06-18 Thread DL Neil via Python-list
On 18/06/20 10:20 PM, Sourav Kundu wrote: when I am using the editor to write a long program and trying to run it the python command line showing it syntax error Of possible interest:- Why SuperHELP for Python? | pssst Search domain p-s.co.nz/wordpress/why-superhelp-for-python/p-s.co.nz/wordpr

Re: Friday Finking: Beyond implementing Unicode

2020-06-16 Thread DL Neil via Python-list
There was a recent thread on python-ideas discussing this.  It started with arrow characters.  There have been others. Am pleased to hear that it's neither 'new' nor 'way out there'... Am not subscribed to that list. Went looking for its archives, but failed - there's no "ideas" on (https://

Re: Friday Finking: Beyond implementing Unicode

2020-06-16 Thread DL Neil via Python-list
On 13/06/20 5:11 AM, Dennis Lee Bieber wrote: On Fri, 12 Jun 2020 18:03:55 +1200, DL Neil via Python-list declaimed the following: There is/was a language called "APL" (and yes the acronym means "A Programming Language", and yes it started the craze, through "B&q

Re: Friday Finking: Beyond implementing Unicode

2020-06-16 Thread DL Neil via Python-list
On 13/06/20 4:47 AM, Terry Reedy wrote: On 6/12/2020 2:03 AM, DL Neil via Python-list wrote: Unicode has given us access to a wealth of mathematical and other symbols. Hardware and soft-/firm-ware flexibility enable us to move beyond and develop new 'standards'. Do we have opport

Re: change surface

2020-06-13 Thread DL Neil via Python-list
On 13/06/20 10:40 PM, Bischoop wrote: I'm playing with pygame, https://bpa.st/6GOQ Not sure what is wrong here that object moves but draws another surface. (not sure how many will click on a link like that - best to copy-paste code into (text) email message) The most usual reason for 'l

Re: Python database compatibility

2020-06-12 Thread DL Neil via Python-list
On 13/06/20 8:49 AM, Siddharth Joshi wrote: I am new in Python world and would like to use it for one of the our purpose . Before that, I would like to ask if Python has compatibility with ENSCRIBE database . Enscribe database (file structured) is the native database of HP NonStop (Tandem) serve

Re: pyinstaller

2020-06-12 Thread DL Neil via Python-list
On 13/06/20 3:09 AM, Robin Becker wrote: On 11/06/2020 16:39, Grant Edwards wrote: the hands of the developer.  I suppose the OP could quit and stand on the street corner with a cardboard sign: I would love to do that :) Of possible interest to folk interested in this thread: Recently came a

Friday Finking: Beyond implementing Unicode

2020-06-11 Thread DL Neil via Python-list
Unicode has given us access to a wealth of mathematical and other symbols. Hardware and soft-/firm-ware flexibility enable us to move beyond and develop new 'standards'. Do we have opportunities to make computer programming more math-familiar and/or more logically-expressive, and thus easier to

Re: Typing, how come that :int is not ensuring int parameter?

2020-06-11 Thread DL Neil via Python-list
On 12/06/20 9:32 AM, zljubi...@gmail.com wrote: OK, as I can see nothing is enforced but I can use mypy and tests for the purpose. Exactly! Well done - Python uses 'duck typing' and thus when the Typing module was added, it became an option. As mentioned elsewhere, it provides "hints" at 'co

Re: Typing, how come that :int is not ensuring int parameter?

2020-06-11 Thread DL Neil via Python-list
On 12/06/20 8:51 AM, zljubi...@gmail.com wrote: Hi, If I run this code: class Property: def __init__(self, var: int): self.a: int = var @property def a(self): return self.__a @a.setter def a(self, var: int): if var > 0 and var % 2 == 0:

Re: Syntax Help

2020-06-11 Thread DL Neil via Python-list
On 12/06/20 12:13 AM, Terry Reedy wrote: On 6/11/2020 6:03 AM, John Weller wrote: I have been able to find answers to most problems by Googling but couldn't work out a suitable query for this one. That is why I and others have made the Symbols index as complete as possible.  If anything think

Re: Syntax Help

2020-06-10 Thread DL Neil via Python-list
On 11/06/20 4:56 AM, John Weller wrote: I am trying to learn python. Looking at an example on the web I found this line: def plot(*args, **kwargs): What do the stars mean? The Python "docs" are (surprisingly, for this day-and-age) comprehensive. Try https://docs.python.org/3/tutorial/control

Re: Turning pygame apps into add-ons

2020-06-10 Thread DL Neil via Python-list
On 11/06/20 1:32 AM, elisha hollander wrote: I have a folder with my pygame apps, I want to build a program to have a nice interface to access those apps from, I want it to be like an actual computer, so, I need it to open the apps as rect of something not as external apps. Is there a way to do i

Re: repair modify uninstall

2020-06-10 Thread DL Neil via Python-list
On 10/06/20 11:26 PM, Silvia Aminul wrote: I tried installing Python for windows 10 (the latest version of python for windows ) And after downloading and trying to launch it keeps saying repair modify uninstall I tried looking for solution and it was suggested I might have do

Re: Button press event - event handling and picking: IndexError: list index out of range

2020-06-07 Thread DL Neil via Python-list
On 8/06/20 10:38 AM, MRAB wrote: On 2020-06-07 23:24, DL Neil via Python-list wrote: On 8/06/20 7:06 AM, Caledonian26 wrote: ... However, I keep getting the error: IndexError: list index out of range. Could anyone give me a helping hand as to where I am going wrong? When things go wrong

Re: Button press event - event handling and picking: IndexError: list index out of range

2020-06-07 Thread DL Neil via Python-list
On 8/06/20 7:06 AM, Caledonian26 wrote: ... However, I keep getting the error: IndexError: list index out of range. Could anyone give me a helping hand as to where I am going wrong? When things go wrong, Python tries to be helpful by providing a "traceback". Please copy-paste the entire tra

Re: Can I have a class with property named "from"

2020-06-05 Thread DL Neil via Python-list
On 6/06/20 9:36 AM, zljubi...@gmail.com wrote: Hi, if I define class like this one: class abc: def __init__(self): self._from = None @property def from(self): return self._from @from.setter def from(self, value): self._from = value I get

Friday Finking: Imports, Namespaces, Poisoning, Readability

2020-06-04 Thread DL Neil via Python-list
How do you prefer to balance all of the above when import-ing? Python offers a number of options for importing modules, eg import module, ... from importable import object, ... most of which can be augmented with the "as preferred_name" syntax. (ignoring the much-reviled "*" (import ev

Re: Issues with Python

2020-06-03 Thread DL Neil via Python-list
On 4/06/20 2:22 PM, Kelley Hudson wrote: Keep getting an error when trying to us Python with Pycharm. I uninstalled it but this was the error I received. Sent from [1]Mail for Windows 10 References Visible links 1. https://go.microsoft.com/fwlink/?LinkId=550

Re: Unsubscribe to python list

2020-06-03 Thread DL Neil via Python-list
On 4/06/20 4:59 PM, Meet Agrawal wrote: I want to unsubscribe from python list and would like to stop recieving mails from the same. At the bottom of your request (as reflected), this, and all over messages to the list is an administration link. At the foot of that web-page you will find a s

Re: Format Logfile Name with logging.ini

2020-05-30 Thread DL Neil via Python-list
On 30/05/20 4:52 AM, connor.r.no...@gmail.com wrote: In an effort to clean up my python logging practices when creating libraries, I have begun reading into "Advanced Logging" and converting my logging practices into logging configuration `.ini` files: [link](https://docs.python.org/3.4/howto/

Re: Python with text editor

2020-05-30 Thread DL Neil via Python-list
On 30/05/20 7:42 PM, Preetha M wrote: Hello. Thank you for responding to my previous mail. Can someone tell me how to connect python to sublime text 3. Whenever I select python and type the code, it does not work when I press ctrl+B. Please tell. ST is an editor/IDE which is not Python-specifi

Re: Constructing mime image attachment

2020-05-28 Thread DL Neil via Python-list
On 28/05/20 11:48 PM, Joseph L. Casale wrote: I have some json encoded input for nodemailer (https://nodemailer.com/message/embedded-images) where the path key is a string value which contains the base64 encoded data such as: { html: 'Embedded image: ', attachments: [{ filen

Re: Access an object to which being bound

2020-05-27 Thread DL Neil via Python-list
@AR, On 28/05/20 8:41 AM, Chris Angelico wrote: On Thu, May 28, 2020 at 6:27 AM Abdur-Rahmaan Janhangeer wrote: Thanks, Actually i want to keep a reference from B to all A instantiated like in the case of z I have class A and i want to call class B via A You can have def x(self, *args, *

Re: Behaviour of os.path.join

2020-05-27 Thread DL Neil via Python-list
... Again, a pathname is never inherently a directory or a file. See previous contribution: until YOU define YOUR arena of operations, it will be difficult to select the correct tool or library - or for others to assist you. If dealing with strings (which happen to look as if they are fil

Re: Behaviour of os.path.join

2020-05-26 Thread DL Neil via Python-list
On 27/05/20 5:23 AM, BlindAnagram wrote: On 26/05/2020 16:59, Mats Wichmann wrote: On 5/26/20 8:56 AM, BlindAnagram wrote: I came across an issue that I am wondering whether I should report as an issue. If I have a directory, say: base='C:\\Documents' and I use os.path.join() as follows:

Re: Managing plug-ins

2020-05-25 Thread DL Neil via Python-list
On 26/05/20 11:35 AM, Benjamin Schollnick wrote: Did you ever find anything that met your requirements? If not, I have a prototype that I need to build out some more… https://github.com/bschollnick/PyPlugInMgr I use it for some home grown utilities, but it needs to be fleshed out some more…

Re: Custom logging function

2020-05-25 Thread DL Neil via Python-list
On 26/05/20 8:26 AM, zljubi...@gmail.com wrote: Hi, I have a case in which I have to use custom function for logging. For example, all messages should go to stderr and end with '\r\n'. Can I somehow use standard python logging module but send all message to stderr with '\r\n' line endings?

Re: Strings: double versus single quotes

2020-05-24 Thread DL Neil via Python-list
On 24/05/20 8:41 PM, Frank Millman wrote: On 2020-05-24 9:58 AM, DL Neil via Python-list wrote: 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

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.

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: 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 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: 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-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: 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 <__pete...@web.de> 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: 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: 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

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: 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 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

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, swaroop.sahoo...@gmail.com 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: 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: 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

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: 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

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 as long as this o

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: 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

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

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

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

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 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: 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: 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

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: 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: 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

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-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 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 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 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
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: 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: 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

  1   2   3   4   5   6   7   8   9   10   >