Re: Lists And Extra Commas at end

2019-12-24 Thread Marco Sulla via Python-list
On Tue, 24 Dec 2019 at 22:51, Avi Gross via Python-list wrote: > So, is that a feature you want warnings about? After all, a dangling comma > may simply mean you left something out and meant to add later? .completely OT. I responded to a topic named "List and missing commas"

Re: Lists And Missing Commas

2019-12-24 Thread Marco Sulla via Python-list
On Tue, 24 Dec 2019 at 19:05, Avi Gross via Python-list wrote: > There are some lint programs that check your code and supply warnings and I > see some languages have the option to generate warnings when the two strings > are on the same line. I wonder if a Python lint does that. It may

Re: More efficient/elegant branching

2019-12-24 Thread Marco Sulla via Python-list
I agree with Chris Angelico, branch1 is "the way to go". Maybe you have to add a default at start, maybe None, and maybe raise an exception if res is None. Anyway, despite I'm a pain in the... arse and I usually activate ALL the possible warnings in the world, I always disable cyclomatic complexity

RE: Lists And Extra Commas at end

2019-12-24 Thread Avi Gross via Python-list
Cameron, I am not at all against the feature. I like it as my programming style is like you describe. One entry per line indented at the same level, in multiple languages. I often do graphics where I generate an image then fine-tune additional parameters to get the effect I want. Some functions ta

Re: Lists And Extra Commas at end

2019-12-24 Thread Marco Sulla via Python-list
On Wed, 25 Dec 2019 at 00:56, Avi Gross wrote: > I may not be understanding what you are objecting to I, sir, am objecting that I replied to a topic, and you answered to me, but in another topic. You could have respond to me in the correct topic, and then create this other one (that I'm not real

Re: Most elegant way to do something N times

2019-12-24 Thread Marco Sulla via Python-list
imes? > > > This > > > seems to me not elegant in primis. > > > > > > Can you give us a practical example? > > > > File parsing. You read a section header and want to ignore that > > section, so you ignore the next 15 lines. > > mmap and find? >

Re: [Q] __init__ in class

2019-12-26 Thread DL Neil via Python-list
On 27/12/19 12:11 AM, 황병희 wrote: in making class, why we should set "__init__"? so non-init class is useless? actually i did fail to understand __init__'s meaning. what is role of __init__ in class. sincerely, from python beginner. Please be aware that there is a Python Tutor Discussion List.

Re: [Q] __init__ in class

2019-12-26 Thread DL Neil via Python-list
On 27/12/19 10:58 AM, Irv Kalb wrote: On Dec 26, 2019, at 3:11 AM, 황병희 wrote: in making class, why we should set "__init__"? so non-init class is useless? actually i did fail to understand __init__'s meaning. what is role of __init__ in class. ... As an example, let's say that you create a p

Error in python installation

2019-12-27 Thread Kishor Soni via Python-list
Hello I have Intel DH61 series mother board, with Windows7 64bit + SP1 + some debugging components ( as shown in microsoft website, as service pack for W7) however when I try to install current version of python, it displays error. See the screenshot attached herewith. (board configuration display

Grepping words for match in a file

2019-12-28 Thread Mahmood Naderan via Python-list
Hi I have some lines in a text file like ADD R1, R2 ADD3 R4, R5, R6 ADD.MOV R1, R2, [0x10] If I grep words with this code for line in fp: if my_word in line: Then if my_word is "ADD", I get 3 matches. However, if I grep word with this code for line in fp: for word in line.split():

Friday Finking: Source code organisation

2019-12-28 Thread DL Neil via Python-list
Is it helpful to, and thus, do you have a style/convention for ordering the methods within each class in your code? Python's "honking great idea" of namespaces enables us to gather functions/methods under a single name-umbrella, thereby avoiding name-clashes/name-space 'pollution'. [Oh yeah!]

Re: Friday Finking: Source code organisation

2019-12-28 Thread DL Neil via Python-list
"Define before use" is a broad principle that I try to follow, even when the code itself doesn't mandate this. IMO it makes the code easier to navigate even when it's not strictly necessary. As others have said, Python mandates that the functions be defined before they're CALLED, but I find that

Re: Friday Finking: Source code organisation

2019-12-28 Thread DL Neil via Python-list
On 29/12/19 2:19 PM, Tim Chase wrote: On 2019-12-29 12:52, Greg Ewing wrote: I tend to do this too, although it's probably just a habit carried over from languages such as Pascal and C where you have to go out of your way to get things in a different order. Apparently I'm not alone in my Pasca

Re: Grepping words for match in a file

2019-12-28 Thread DL Neil via Python-list
On 29/12/19 5:14 AM, Dan Sommers wrote: On 12/28/19 12:29 AM, Mahmood Naderan via Python-list wrote: Hi I have some lines in a text file like ADD R1, R2 ADD3 R4, R5, R6 ADD.MOV R1, R2, [0x10] If I grep words with this code for line in fp: if my_word in line: Then if my_word is "ADD&qu

Re: Friday Finking: Source code organisation

2020-01-01 Thread DL Neil via Python-list
On 29/12/19 5:49 PM, Cameron Simpson wrote: On 29Dec2019 09:49, Chris Angelico wrote: "Define before use" is a broad principle that I try to follow, even when the code itself doesn't mandate this. This generally means that "if name is main" is the very last thing in the file, and if there's a m

Re: Friday Finking: Source code organisation

2020-01-02 Thread DL Neil via Python-list
On 3/01/20 7:36 AM, Terry Reedy wrote: On 1/2/2020 2:46 AM, Cameron Simpson wrote: Inline code under the if...__main__ stuff cannot be called as a function; Which makes it difficult to test app startup. I usually consider the main() function a reusable component. Which, if called (at leas

Re: heap enhancements

2020-01-03 Thread DL Neil via Python-list
On 4/01/20 2:13 PM, rontoto wrote: Hi guys, the code is working, but I want know, what I can improve on this code. It is like implementation of the simulation of shipment clearance in the depot according to priority and available deliveries. How can I do it better? Can u show me? Thnx for your

Re: Python, Be Bold!

2020-01-06 Thread DL Neil via Python-list
On 7/01/20 6:10 AM, Abdur-Rahmaan Janhangeer wrote: On Mon, 6 Jan 2020, 20:50 Rhodri James, wrote: No if you read the thread (please do it), that's the 4th time i'm saying it's a bad idea I have not (been following the thread) - with all due apologies. Podcast of possible interest: Episo

Re: Removing reference to local installed package

2020-01-07 Thread DL Neil via Python-list
On 8/01/20 8:53 AM, Abdur-Rahmaan Janhangeer wrote: Greetings everybody, Salaam, I installed a local package using python -m pip install Now if you install the same package from pypi, it says requirements already satisfied pointing to the location of the local package folder instead of sit

Re: [Python-ideas] Re: Enhancing Zipapp

2020-01-08 Thread Andrew Barnert via Python-list
On Jan 8, 2020, at 01:09, Abdur-Rahmaan Janhangeer wrote: > > But now, a malicious program might try to modify the info file > and modify the hash. One way to protect even the metadata is > to hash the entire content > > folder/ > file.py # we can add those in a folder if needed > __main

Re: [Python-ideas] Re: Enhancing Zipapp

2020-01-08 Thread Andrew Barnert via Python-list
On Jan 8, 2020, at 01:09, Abdur-Rahmaan Janhangeer wrote: > > Using the wheel-included zip (A), we can generate another zip file (B) with > the packages installed. That generated zip file is then executed. But that generated zip B doesn’t have a trustable hash on it, so how can you execute it?

Coding technique: distinguish using type or abc?

2020-01-08 Thread DL Neil via Python-list
Do you prefer to use isinstance() with type() or to refer to collections.abc? This team producing bases statistical analyses for (lesser capable) user-coders to utilise with their own experimental 'control code'; faces situations where a list-parameter is often only one element long. As is s

Re: Understanding of GIL

2020-01-16 Thread Amitesh Sahay via Python-list
Hi, You should also undertand that Python uses GIL for Threading purpose. Yes, if you have functiosn that needs simulataneous execution you should use Threading approach. As well as if Huge data is involved then also use multi-processing concept as well On Thursday, 19 December, 2019, 7

Extension type inherit from Python int

2020-01-16 Thread Mathias Enzensberger via Python-list
Hello, I am trying to write an extension type that inherits from Pythons int. Based on the documentation, this should be possible, but I checked Pythons implementation and the struct defining a PyLongObject u

Re: problem

2020-01-17 Thread DL Neil via Python-list
On 18/01/20 7:39 AM, mrunali wrote: I am face a problem to download MySQL for python as well as I can not able to install kivy on my laptop . please give me solution for it . Sent from Mail for Windows 10 How did you try to download MySQL? Which MySQL Connector? What was the error message?

Re: Modules Objects in Python

2020-01-18 Thread DL Neil via Python-list
On 19/01/20 2:51 PM, M.R.P. wrote: Are modules objects in python? Modules offer an independent namespace implemented by a dictionary object - so you may dir() (or help()) and moduleNM.__dict__, and thus pick-up data values and code-units. So, they have many characteristics and behaviors in

Re: Sandboxing eval() (was: Calculator)

2020-01-19 Thread Jon Ribbens via Python-list
On 2020-01-19, [email protected] wrote: > Is it actually possible to build a "sandbox" around eval, permitting it > only to do some arithmetic and use some math functions, but no > filesystem acces or module imports? > > I have an application that loads calculation recipes (a few lines of > variab

Re: How to hide warning about drop table message to MariaDB

2020-01-19 Thread DL Neil via Python-list
On 20/01/20 4:35 AM, Python wrote: ^Bart wrote: I ran this code: #!/usr/bin/python import MySQLdb # Open database connection db = MySQLdb.connect("localhost","root","MyPwd","MyDB") # prepare a cursor object using cursor() method cursor = db.cursor() # Drop table if it already exist using exe

Re: problem with python 3.8.1

2020-01-20 Thread DL Neil via Python-list
On 20/01/20 7:35 PM, coolguy 12336 wrote: hi I can not install the py launcher and I really need it for something I used repair and tried it again but it still didn't work.Do you know how to fix my issue and if you do please email me back as soon as possible thank you. Hi, are you a student -

Re: TensorFlow with 3.8.1

2020-01-20 Thread DL Neil via Python-list
On 20/01/20 6:13 PM, Fahad Qayyum wrote: Hello, Hope this email finds you well. I am having an issue with the installation of TensorFlow on python 3.8.1. I want to work on TensorFlow, please let me know how can I install it. Give me the compete guide if possible. Hi, and welcome to the Python

Re: installation issue.

2020-01-20 Thread DL Neil via Python-list
On 20/01/20 8:13 PM, NIT Application wrote: Hi Team, I am not able to select the path on command prompt. It gives me an error that python is not recognized as an internal or external command. Please help me with this to set up and perform my activities. Regards, Sandesh Kamble Hi, and welc

Re: Python login screen for MariaDB db

2020-01-20 Thread DL Neil via Python-list
On 21/01/20 8:37 AM, ^Bart wrote: I found this article: https://www.simplifiedpython.net/python-gui-login/ I used PDO on PHP 7.3 with last MariaDB engine but I'd like to start to use Python for a local warehouse software, I found the above guide but I need to understand what I should replace

Re: Clarification on Immutability please

2020-01-21 Thread Jon Ribbens via Python-list
On 2020-01-21, Chris Angelico wrote: > On Wed, Jan 22, 2020 at 4:42 AM Stephen Tucker wrote: >> I am left concluding that mytup is not actually a tuple (even though type >> (mytup) tells me that it is). > > If type(mytup) is tuple, then mytup really truly is a tuple. There is > no other conclusio

Re: Clarification on Immutability please

2020-01-21 Thread Jon Ribbens via Python-list
On 2020-01-21, Chris Angelico wrote: > On Wed, Jan 22, 2020 at 8:01 AM Jon Ribbens via Python-list > wrote: >> On 2020-01-21, Chris Angelico wrote: >> > On Wed, Jan 22, 2020 at 4:42 AM Stephen Tucker >> > wrote: >> >> I am left concluding that mytup

Re: Terry Jones

2020-01-22 Thread DL Neil via Python-list
On 23/01/20 11:32 AM, Terry Reedy wrote: On 1/22/2020 2:49 PM, Stefan Ram wrote: |Terence Graham Parry Jones (1 February 1942 – 21 January |2020) was a Welsh actor, writer, comedian, screenwriter, film |director and historian. He was a member of the Monty Python |comedy team. ... |After living f

Re: A small quiz

2020-01-23 Thread DL Neil via Python-list
On 23/01/20 9:54 PM, Z wrote: what is PLR? Context? Trolling? What does this have to do with Python? https://duckduckgo.com/?q=meaning+plr&t=ffab&ia=web -- Regards =dn -- https://mail.python.org/mailman/listinfo/python-list

Friday Finking: Enum by gum

2020-01-23 Thread DL Neil via Python-list
When, why, and how do you employ Python/PSL enums? TLDR? Fair enough! Much of this text recounts a voyage of discovery. More specific questions appear at the bottom... Last century, when I learned to program (in-between working part-time at the dinosaur farm) neither FORTRAN II/IV nor COBOL

Re: I need help for multidimensional loop

2020-01-26 Thread DL Neil via Python-list
On 27/01/20 12:08 PM, pyotr filipivich wrote: Growth Hacking Formation on Sun, 26 Jan 2020 12:36:05 -0800 (PST) typed in comp.lang.python the following: Hi guys, I need your help please to sold a complicate problem. It is difficult for me to find the solution but in fact, I am sure it is jus

Re: Nested Loop Code Help

2020-01-26 Thread DL Neil via Python-list
On 27/01/20 4:15 AM, ferzan saglam wrote: Hello people, I have written the code below which works fine, but it has one small problem. Instead of printing one (x) on the first line, it prints two. I have tried everything in my knowledge, but cannot fix the problem. Thanks for any help in advance.

PEP-Dilbert

2020-01-26 Thread DL Neil via Python-list
Looks as if Dilbert is about to draft a PEP to change Python's world-view: https://dilbert.com/strip/2020-01-24 Curiously, "canard" whilst a French word for "duck", in English describes a rumor or false-story! -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Nested Loop Code Help

2020-01-26 Thread DL Neil via Python-list
On 27/01/20 1:53 PM, Richard Damon wrote: On 1/26/20 6:52 PM, DL Neil via Python-list wrote: On 27/01/20 4:15 AM, ferzan saglam wrote: Hello people, I have written the code below which works fine, but it has one small problem. Instead of printing one (x) on the first line, it prints two. I

Re: Python-list Digest, Vol 196, Issue 26

2020-01-27 Thread DL Neil via Python-list
On 28/01/20 5:17 AM, Michael Torrie wrote: On 1/27/20 12:03 AM, אורי wrote: Please don't reply to digest. Replying to a digest is just fine. Just make sure to change the subject line in the future so people know what it's referring to. Excepting that whilst this practice (subject to faithful

Re: on sorting things

2020-01-28 Thread Tony Flury via Python-list
On 20/12/2019 18:59, Peter Otten wrote: Chris Angelico wrote: On Sat, Dec 21, 2019 at 5:03 AM Peter Otten <[email protected]> wrote: PS: If you are sorting files by size and checksum as part of a deduplication effort consider using dict-s instead: Yeah, I'd agree if that's the purpose. But l

Re: [docs] Dynamic Data type assignment

2020-01-28 Thread DL Neil via Python-list
On 29/01/20 4:51 PM, sushma ms wrote: Thanks a lot. But why can't we make output of input also dynamic data assignment. 1 please don't 'top post': the normal sequence of a conversation is question THEN answer! 2 ambiguity! It is not possible for the input() mechanism to tell whether you la

Re: Suggestions on mechanism or existing code - maintain persistence of file download history

2020-01-29 Thread DL Neil via Python-list
On 30/01/20 10:38 AM, jkn wrote: On Wednesday, January 29, 2020 at 8:27:03 PM UTC, Chris Angelico wrote: On Thu, Jan 30, 2020 at 7:06 AM jkn wrote: I want to be a able to use a simple 'download manager' which I was going to write (in Python), but then wondered if there was something suitable

Re: Help on dictionaries...

2020-01-29 Thread DL Neil via Python-list
On 30/01/20 2:14 PM, Souvik Dutta wrote: Hey I was thinking how I can save a dictionary in python(obviously) so that the script is rerun it automatically loads the dictionary. Perhaps a YAML or JSON file (which follow a very similar format and structure to Python dicts), or a 'NoSQL' database

Was: Dynamic Data type assignment

2020-01-29 Thread DL Neil via Python-list
Further thoughts on the OP's point:- On 29/01/20 4:51 PM, sushma ms wrote: ... But why can't we make output of input also dynamic data assignment. ... when i'm assigning value dynamically and when we comparing in "if" loop it is throwing compiler error. It should not throw error

Re: Suggestions on mechanism or existing code - maintain persistence of file download history

2020-01-30 Thread DL Neil via Python-list
On 30/01/20 9:35 PM, R.Wieser wrote: MRAB's scheme does have the disadvantages to me that Chris has pointed out. Nothing that can't be countered by keeping copies of the last X number of to-be-dowloaded-URLs files. That's a good idea, but how would the automated system 'know' to give-up on th

Re: Suggestions on mechanism or existing code - maintain persistence of file download history

2020-01-31 Thread DL Neil via Python-list
On 31/01/20 9:30 AM, jkn wrote: Err, well, thanks for that discussion gents... As it happens I do know how to use a database, but I regard it as overkill for what I am trying to do here. I think a combination of hashing the URL, and using a suffix to indicate the result of previous downloaded at

Re: Suggestions on mechanism or existing code - maintain persistence of file download history

2020-01-31 Thread DL Neil via Python-list
On 31/01/20 9:53 PM, R.Wieser wrote: Using ctrl+c is a VERY BAD idea. To have it just exit the program ? Yes, indeed. Though you /could/ keep track of what needs to be finished and have the ctrl-c handler do that for you (barf). Another posibility is to capture the ctrl-c and set a flag, whi

Re: Please answer fast.....

2020-01-31 Thread DL Neil via Python-list
On 1/02/20 1:05 AM, Souvik Dutta wrote: Hi, This is problem from pyqt5. Actually I want to have about 40 labels added into a window when a button is clicked. The text are not the same so the label is not the same. I cannot just add 40 labels before hand and then change its text to something from

Re: data sequencing

2020-02-01 Thread DL Neil via Python-list
On 1/02/20 7:19 PM, [email protected] wrote: I have a data sequence of around 30 sets. I need to batch the sequence into an input-output format. for example data= [1,2,3,4,5,6,7,8,9,10,..,100] X1= [1,2,3,4,5,6,7,8,9,10] y1 = [11,12] X2= [3,4,5,6,7,8,9,11,12] y2 = [13,14] and it

Re: Suggestions on mechanism or existing code - maintain persistence of file download history

2020-02-01 Thread DL Neil via Python-list
On 2/02/20 1:00 AM, R.Wieser wrote: As sent to the OP. I appreciate these discussions, in the expectation of learning something-new. (and with rust-removal paints at the ready!) Indeed. Even if its just a different POV which makes you rethink the reasons of your own one. +1 -- Regards =dn

Re: JavaScript's void operator in Python?

2020-02-02 Thread Jon Ribbens via Python-list
On 2020-02-02, Stefan Ram wrote: > JavaScript has a void operator that maps everything to > undefined. E.g., > > JavaScript console > >|< void( console.log( 2 ) ) >| 2 >|> undefined > > I can easily write a corresponding function in Python. > > main.py > > def void( x ): > pass > >

Re: Pyqt5 help

2020-02-02 Thread Alan Gauld via Python-list
On 01/02/2020 12:06, Souvik Dutta wrote: > I was making a pyqt5 project and I ran into a problem. I want a button in > one window to add a label in another window when clicked upon. But that is > not happening. What is happening? Don't expect us to run your buggy code! > Now the no. Of labels de

Re: Pyqt5 help

2020-02-02 Thread Alan Gauld via Python-list
On 01/02/2020 12:06, Souvik Dutta wrote: > not happening. Now the no. Of labels depend upon something, so I decided to > use a for loop which is not working. Attaching the code below. Can you help? I just spotted something else odd in your code: def initUi(self): ... self.n = {}

Re: Please answer fast.....

2020-02-02 Thread DL Neil via Python-list
On 3/02/20 7:05 AM, Abdur-Rahmaan Janhangeer wrote: ... suggest you put names, birthday in csv the load csv for each row: layout.addWidget(QLabel) On Sun, 2 Feb 2020, 21:21 Souvik Dutta, wrote: Because i want to show the name and date of 40 persons and their birthdays. Why csv? Wh

Re: JavaScript's void operator in Python?

2020-02-02 Thread Jon Ribbens via Python-list
On 2020-02-02, Stefan Ram wrote: > Greg Ewing writes: >>If the functions you're calling all return None, you can >>do this: >> >>> print(2); print(3) > > »print(2); print(3)« is not an expression anymore but an stmt_list. > It cannot be used in all places where an expression is allowed. Why

Re: JavaScript's void operator in Python?

2020-02-02 Thread Jon Ribbens via Python-list
On 2020-02-02, Stefan Ram wrote: > Jon Ribbens writes: >>Why does it matter if the return value is None? > > In a lambda, a return value of None sometimes would be > convenient as by convention it indicates that the return > value does not carry any information and the function is > inten

The source of the PSL*

2020-02-02 Thread DL Neil via Python-list
Is there a set location for PSL project repos? (it used to be GitHub, and before that, Google) I'd like to review some serious PyTest/Unittest examples, eg as are applied to familiar (Python source) library members... * should be easier to find than was the source of the Nile (by Europeans) --

Re: How to instlal pyodbc, without pip

2020-02-04 Thread DL Neil via Python-list
On 5/02/20 6:34 AM, [email protected] wrote: Pip won't work on my desktop, because of the firewalls we have set up. I have the version from github. Assuming my Python 3.8.1 Home Directory is C:\Python, How can I install pyodbc pyodbc-master.zip? Which folders should I unzip it into? I

Re: Pkg iter_module for different versions of python

2020-02-09 Thread DL Neil via Python-list
On 10/02/20 4:46 AM, J A wrote: as a sysadmin I've written several small tools as python command line apps that get installed with python setup.py install. I would now like to create another tool that would quickly list out all of my custom tools that may be installed on the system. so that other

Re: Software not working

2020-02-10 Thread DL Neil via Python-list
On 11/02/20 12:00 AM, Tushita Parashar wrote: Even after installing the software on my system the software isn’t running. Today, an (apparently) identical question, already asked and answered. Please see the Python-Tutor list: "Python Beginner" msg. -- Regards =dn -- https://mail.python.org/

Re: datetime seems to be broken WRT timezones (even when you add them)

2020-02-10 Thread Jon Ribbens via Python-list
On 2020-02-10, Python wrote: > So far, so good. However, when you go to use this object, the time it > represents is in fact wrong. Unsurprisingly for a language feature that's been around for nearly 17 years, no it isn't. > For example: > print dt.strftime("%s") > 1580452245 That's askin

Re: datetime seems to be broken WRT timezones (even when you add them)

2020-02-11 Thread Jon Ribbens via Python-list
On 2020-02-11, Chris Angelico wrote: >> That's the key piece of info. This does appear to work, though still >> not on python2. That, as you say, is my problem. But thankfully Jon >> Ribbens has the save: > > Isn't it time to stop going to great effort to support Python 2? That depends on what

Re: datetime seems to be broken WRT timezones (even when you add them)

2020-02-11 Thread Jon Ribbens via Python-list
On 2020-02-11, Chris Angelico wrote: > On Tue, Feb 11, 2020 at 10:01 PM Jon Ribbens via Python-list > wrote: >> So while it's been about 6 years since anyone should have been >> starting any new projects using Python 2, there are plenty of >> projects that are o

Re: Technical debt - was Re: datetime seems to be broken WRT timezones (even when you add them)

2020-02-12 Thread Jon Ribbens via Python-list
On 2020-02-12, Chris Angelico wrote: > But you CAN rewrite code such that it reduces technical debt. You can > refactor code to make it more logical. ... but if doing so costs more than the debt, you shouldn't do it. -- https://mail.python.org/mailman/listinfo/python-list

RE: Technical debt - was Re: datetime seems to be broken WRT timezones (even when you add them)

2020-02-12 Thread Avi Gross via Python-list
I have to wonder if this is a bit like what happens when something like Windows offers you an upgrade if you pay for it. Some people have noticed how after such things come out, a series of rapid bug fixes come along. So, they wait. Some wait long enough until another entire version has come along

Re: Technical debt - was Re: datetime seems to be broken WRT timezones (even when you add them)

2020-02-12 Thread DL Neil via Python-list
On 13/02/20 9:17 AM, Michael Torrie wrote: On 2/12/20 7:44 AM, Ethan Furman wrote: On 02/11/2020 04:38 PM, Michael Torrie wrote: ... True. Costs can be calculated and planned for. But Technical debt is often impossible to quantify in a real, meaningful, business sense, other than the that we

Re: Can anyone share experience about python backend developer?

2020-02-17 Thread DL Neil via Python-list
On 17/02/20 11:11 PM, lampahome wrote: I have 3+years developer experience in python, but I always develop about peer-to-peer service. Have no backend experience in python. But now I want to change to backend engineer, somebody shares their job is to do like 1. Develop customize API to receive d

Re: insert data in python script

2020-02-17 Thread DL Neil via Python-list
Please help us to help you! 1 is all of this code in a single file or spread across (at least) two modules? What are their names? What is the directory structure? 2 copy-paste the actual error message received. It works for me! 1 not knowing your circumstances, I put all the code in one file 2

Re: insert data in python script

2020-02-18 Thread DL Neil via Python-list
... import preos # pass name, Tc, Pc, omega methane = preos.Molecule("methane", -82.59 + 273.15, 45.99, 0.011) methane.print_params() ... my code preos in one file preos.py my commands are alberto@HENDRIX ~/PREOS $ python3.5 Python 3.5.2 (default, Oct 8 2019, 13:06:37) [GCC 5.4.0 20160609]

Re: insert data in python script

2020-02-18 Thread DL Neil via Python-list
On 19/02/20 4:52 AM, alberto wrote: Hi, I solve it with external file as follows import preos # pass name, Tc, Pc, omega methane = preos.Molecule("methane", -82.59 + 273.15, 45.99, 0.011) methane.print_params() thanks to everyone It is difficult to learn a new programming language, even for

Re: Idiom for partial failures

2020-02-20 Thread DL Neil via Python-list
On 21/02/20 10:05 AM, Stefan Ram wrote: David Wihl writes: I believe that it would be more idiomatic in Python (and other languages lik= e Ruby) to throw an exception when one of these partial errors occur. I wonder whether the term "idiomatic" is too heavily burdened here. Python o

Re: Help with oop

2020-02-23 Thread DL Neil via Python-list
On 22/02/20 10:45 PM, S Y wrote: How can I use remove,add and verify methods in class oop. Which has tuple with allowed values inside class. Like two classes cart and inventory Please show the code you have so-far. What are you removing, adding, and verifying? Are you aware of the Python-Tutor

Re: Help with oop

2020-02-23 Thread DL Neil via Python-list
def add_item(self, item_object):  if len(self.inventory) <= self.capacity:  self.inventory.append(item_object)  return True  else:  print("Reached max capacity")  return False on behalf of DL Neil via Python-list *Sent:* Sunday, February 23, 2020 4:41:54 PM *To:* python-list@

Managing plug-ins

2020-02-23 Thread DL Neil via Python-list
Please recommend a library which will manage plug-ins. (Regret that searching PyPi or using a web SE results in an overwhelming number of 'false positives') Not wanting to 'reinvent the wheel, have been looking for an 'approved' way to manage a set of previously-prepared routines plus user-a

Re: Logging all the requests into a specific file

2020-02-27 Thread DL Neil via Python-list
On 28/02/20 9:29 AM, [email protected] wrote: I am new to python and all of this, I am using this FastAPI, to build API, I want when users hit any endpoint for ex /products, that to be written into a file , how do I do it? The Python Standard Library offers a Logging library. It has "

Re: Mental model of lookahead assertions

2020-02-28 Thread Jon Ribbens via Python-list
On 2020-02-27, Stefan Ram wrote: > One can count overlapping occurences as follows. > >|>>> print(len(findall('(?=aa)','cb'))) >|3 > > Every web page says that lookahead assertions do > not consume nor move the "current position". > > But what mental model can I make of the regex > e

Friday Finking: Poly more thick

2020-02-28 Thread DL Neil via Python-list
How does one code a function/method signature so that it will accept either a set of key-value pairs, or the same data enclosed as a dict, as part of a general-case and polymorphic solution? Wikipedia: polymorphism is the provision of a single interface to entities of different types. ( https

Have you some experience / link about difference between Python builded with gcc and clang?

2020-03-01 Thread Marco Sulla via Python-list
As title. Currently I'm using gcc 9.2.0 and its compilation seems to work well and fast. But I would know by your experience if clang can produce, on a *nix system, a "faster Python". -- https://mail.python.org/mailman/listinfo/python-list

Re: Have you some experience / link about difference between Python builded with gcc and clang?

2020-03-01 Thread Marco Sulla via Python-list
Good! Have you compiled it optimized (--enable-optimizations --with-lto)? On Sun, 1 Mar 2020 at 23:48, Skip Montanaro wrote: > > > As title. Currently I'm using gcc 9.2.0 and its compilation seems to > > work well and fast. But I would know by your experience if clang can > > produce, on a *nix s

Re: Have you some experience / link about difference between Python builded with gcc and clang?

2020-03-01 Thread Skip Montanaro via Python-list
I didn't have clang installed. It was just "sudo apt install clang-8". From there all I had to do was build Python from scratch twice, install pyperformance using pip after the first build, then run it after each build. It's not difficult. Going beyond that right now is not an itch I need to scratc

Re: Have you some experience / link about difference between Python builded with gcc and clang?

2020-03-02 Thread Marco Sulla via Python-list
Oooohhh uff, I have to install latest clang... or better, compile it as I did for gcc. And I have to read the install docs to see if there's some trick to optimize it... and I have to read the docs of pyperformance too (I only used pyperf until now)... Oh well, tomorrow :-D On Mon, 2 Mar 2020

Re: Have you some experience / link about difference between Python builded with gcc and clang?

2020-03-02 Thread Skip Montanaro via Python-list
> > Have you compiled it optimized (--enable-optimizations --with-lto)? > Nope, just ./configure. Further investigation is left as an exercise for the reader. :-) Skip > -- https://mail.python.org/mailman/listinfo/python-list

Re: Data model and attribute resolution in subclasses

2020-03-02 Thread Marco Sulla via Python-list
On Fri, 28 Feb 2020 at 08:28, Adam Preble wrote: > > I have been making some progress on my custom interpreter project Is your project published somewhere? What changes have you done to the interpreter? -- https://mail.python.org/mailman/listinfo/python-list

Why this message was rejected?

2020-03-02 Thread Marco Sulla via Python-list
One of my post on this list was rejected. The reason is: > Blind carbon copies or other implicit destinations are not allowed. >Try reposting your message by explicitly including the list address in > the To: or Cc: fields. I rechecked my mail and I added the user to the To: field, and the python

Re: Why this message was rejected?

2020-03-02 Thread Marco Sulla via Python-list
On Mon, 2 Mar 2020 at 22:36, Ethan Furman wrote: > Questions like this should go to python-list-owner at python dot org. If > this message hadn't been flagged we may not have noticed it. Sorry, I posted to python-list-owner before reading this message. > When the mailing list software received

Re: Why this message was rejected?

2020-03-02 Thread Marco Sulla via Python-list
Ok, I sent a message as I did before to the discussion "Re: Friday Finking: Poly more thick", with only "test" as body. On Mon, 2 Mar 2020 at 22:48, Marco Sulla wrote: > > On Mon, 2 Mar 2020 at 22:36, Ethan Furman wrote: > > Questions like this should go to python-list-owner at python dot org

Why there's no __json__()?

2020-03-02 Thread Marco Sulla via Python-list
As title. For example, `copy.copy` can use the __copy__() method of a class, if defined. Is this not possible with `json`? -- https://mail.python.org/mailman/listinfo/python-list

`async def` breaks encapsulation?

2020-03-04 Thread Marco Sulla via Python-list
I worked a lot with `asyncio` many years ago, when `aiohttp` was first born. Now I'm working again with it, since a library that I need requires it. asyncio is much more simple to use now, but there's something that still make me doubtful: the require of the `async` keyword for coroutines. When I

Re: Help building python application from source

2020-03-04 Thread Marco Sulla via Python-list
Mh. I hoped not, but unluckily I expected a response like this. People of Python List, I strongly discourage you to support this user. He is quite suspicious for the following reasons: 1. he go so far as he offers money for, IMHO, a trivial task 2. he does not trust binaries from pip. He is so ca

Re: ÿ in Unicode

2020-03-06 Thread Jon Ribbens via Python-list
On 2020-03-06, moi wrote: > Le jeudi 5 mars 2020 13:20:38 UTC+1, Ben Bacarisse a écrit : >> moi writes: >> 'ÿ'.encode('utf-8') >> > b'\xc3\xbf' >> 'ÿ'.encode('utf-16-le') >> > b'\xff\x00' >> 'ÿ'.encode('utf-32-le') >> > b'\xff\x00\x00\x00' > >> That all looks as expected. > Yes > >

Re: ÿ in Unicode

2020-03-06 Thread Jon Ribbens via Python-list
On 2020-03-06, Pieter van Oostrum wrote: > Jon Ribbens writes: >> On 2020-03-06, moi wrote: >>> Le jeudi 5 mars 2020 13:20:38 UTC+1, Ben Bacarisse a écrit : moi writes: 'ÿ'.encode('utf-8') > b'\xc3\xbf' 'ÿ'.encode('utf-16-le') > b'\xff\x00' 'ÿ'.encod

Re: ÿ in Unicode

2020-03-06 Thread Jon Ribbens via Python-list
On 2020-03-06, Pieter van Oostrum wrote: > Jon Ribbens writes: >> On 2020-03-06, moi wrote: >>> Le jeudi 5 mars 2020 13:20:38 UTC+1, Ben Bacarisse a ÄCcritâ : moi writes: 'Ä¿'.encode('utf-8') > b'\xc3\xbf' 'Ä¿'.encode('utf-16-le') > b'\xff\x00' 'Ä¿'.

Re: ÿ in Unicode

2020-03-06 Thread Jon Ribbens via Python-list
On 2020-03-06, moi wrote: > Le jeudi 5 mars 2020 13:20:38 UTC+1, Ben Bacarisse a ÄCcritâ : >> moi writes: >> 'Ä¿'.encode('utf-8') >> > b'\xc3\xbf' >> 'Ä¿'.encode('utf-16-le') >> > b'\xff\x00' >> 'Ä¿'.encode('utf-32-le') >> > b'\xff\x00\x00\x00' > >> That all looks as expected. > Ye

Re: ÿ in Unicode

2020-03-06 Thread Jon Ribbens via Python-list
On 2020-03-06, moi wrote: > Le jeudi 5 mars 2020 13:20:38 UTC+1, Ben Bacarisse a ÄäCcritÄø : >> moi writes: >> 'Ääâ¿'.encode('utf-8') >> > b'\xc3\xbf' >> 'Ääâ¿'.encode('utf-16-le') >> > b'\xff\x00' >> 'Ääâ¿'.encode('utf-32-le') >> > b'\xff\x00\x00\x00' > >> That all looks as expect

Re: ÿ in Unicode

2020-03-06 Thread Jon Ribbens via Python-list
On 2020-03-06, Pieter van Oostrum wrote: > Jon Ribbens writes: >> On 2020-03-06, moi wrote: >>> Le jeudi 5 mars 2020 13:20:38 UTC+1, Ben Bacarisse a ÄäCcritÄø : moi writes: 'Ääâ¿'.encode('utf-8') > b'\xc3\xbf' 'Ääâ¿'.encode('utf-16-le') > b'\xff\x00'

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

2020-03-06 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. Iam just try

Re: ÿ in Unicode

2020-03-06 Thread Jon Ribbens via Python-list
On 2020-03-06, Jon Ribbens wrote: > What's the bug, or source of amusement? Oh, that's fun. There's a Russian Fidonet gateway, that somehow still exists, that's re-injecting usenet posts back into the group. -- https://mail.python.org/mailman/listinfo/python-list

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