://mail.python.org/mailman/listinfo/python-list
the
repository as an installable package. The package
names are python-psutil and python3-psutil.
--
GNU/Linux user #557453
The cow died so I don't need your bull!
--
https://mail.python.org/mailman/listinfo/python-list
py of py2exe.
--
There are two ways to write error-free programs; only the third one works.
--
https://mail.python.org/mailman/listinfo/python-list
don't need your bull!
--
https://mail.python.org/mailman/listinfo/python-list
On Mon, 05 Mar 2018 08:37:14 +, Faruq Bashir wrote:
> How will i bypass web application firewall
For what purpose?
is this your firewall?
--
https://mail.python.org/mailman/listinfo/python-list
n group theory in there to help somebody who doesn't know what
> those standard terms mean.)
four guidance I would sugest Pep257 as a start point
which would suggest "Return True if permutation is even"
--
I think my career is ruined!
--
https://mail.python.org/mailman/listinfo/python-list
d to write "return true iff this".
>
> BTW: As a language element that helps to construct a boolean
> expression from a file name, some languages, like SQL, use
> "EXISTS", while others, like MS-DOS-batch, use "EXIST".
>
>
> --
> https://mail.python.org/mailman/listinfo/python-list
>
--
https://mail.python.org/mailman/listinfo/python-list
#x27;t be pathologically slow. It's hardly Quicksort's best
> feature, but it could easily be a lot worse. I'd have to check, but I
> think it still manages to be O(n log n). Merge sort, of course, is a
> lot more consistent, but the asymptotic cost is still broadly the
> same.
>
> But Timsort manages to be close to O(n) for sorted data, reversed
> data, nearly-sorted or nearly-reversed data, etc. Makes it very handy
> for jobs like "click a heading to sort by it", where you might add
> multiple sort keys.
>
> (Plus, Python's implementation has some cool tricks for small
> collections that make it quite efficient.)
>
> ChrisA
> --
> https://mail.python.org/mailman/listinfo/python-list
>
--
https://mail.python.org/mailman/listinfo/python-list
Why not do :
def TempsOneDayDT(date:datetime.date):
return TempsOneDay(date.year, date.month, date.day)
No repeat of code - just a different interface to the same
functionality.
-- Original Message --
From: "Michael F. Stemper"
To: python-list@
were almost identical but had some boilerplate -
and m4 was able to handle that nicely at the cost of lines being 1-1.
HTH
--
Anthony Flury
*Moble*: +44 07743 282707
*Home*: +44 (0)1206 391294
*email*: anthony.fl...@btinternet.com
--
https://mail.python.org/mailman/listinfo/python-list
rd
'meaning' nothing else is removed and the new string is returned.
The argument passed to strip(..) method is the set of characters to be
removed - so any characters in that set are removed from the start and
end of the string.
-- Original Message --
From: "Jeff Jeffi&qu
ions worth considering
1) could possibly be handled by a simple bash script (My bash skills are
not great So i would probably still go python myself anyway)
2) Instead of checking availability just try to send & react appropriately
if it fails (Ask for forgiveness not permission), the client could fail
after test or during transfer anyway so you will still need this level of
error checking
--
QOTD:
"What women and psychologists call `dropping your armor', we call
"baring your neck."
--
https://mail.python.org/mailman/listinfo/python-list
On 10.06.22 21:29, Grant Edwards wrote:
On 2022-06-10, Yusuf Özdemir wrote:
?
Your question is a bit vague.
--
Grant
Hahahahaha, to say the least!
--
https://mail.python.org/mailman/listinfo/python-list
en you have this huge final module, what do you think
you can do with it to be faster?
If you have performance problems with some module, you have several
options to optimize it:
- Find a better algorithm.
- Rewrite performance-critical parts in Cython or even C and import
the compiled module.
lists from my own mail server before, and
this is the only problem left to dig in.
Sorry for bothering.
Axy
--
https://mail.python.org/mailman/listinfo/python-list
ion?
Firewall usually causes connection to hang and timeout with no response.
But in this case connection looks immediately refused which means either
port number is wrong or mysql is not listening on 127.0.0.1.
Axy
--
https://mail.python.org/mailman/listinfo/python-list
you don't know where you are going, any road will get you
there.
--
https://mail.python.org/mailman/listinfo/python-list
h is quite difficult
to dig out with modern search engines that have already rolled down to
hell a decade ago.
Axy.
--
https://mail.python.org/mailman/listinfo/python-list
lock
(GIL) that prevents full parallelism. Processes work as expected, but
require IPC and pickable objects in and out.
yes, that became a problem.
So, I revoke my question. Went out to redesign the whole approach.
Thanks for reply!
Axy.
--
https://mail.python.org/mailman/listinfo/python-list
e')
for i in [1,2,3]:
print(i)
print(4)
for i in []:
print(i)
print(5)
--
https://mail.python.org/mailman/listinfo/python-list
arios there would be more logic in the for block that
would meet a condition and break out of the loop. If the condition is
never met, the else block runs. To steal from w3schools:
fruits = ["apple", "peach", "cherry"]
for x in fruits:
print(x)
if x == "banana":
break
else:
print("Yes we got no bananas")
--
https://mail.python.org/mailman/listinfo/python-list
On 09/10/2022 05:47, Chris Angelico wrote:
On Sun, 9 Oct 2022 at 15:39, Axy via Python-list wrote:
Got it, thanks!
Actually the reason I never used "else" was the violation of the rule of
beauty "shortest block first". With if--else you can easily follow this
r
st: do easy and quick things first and boring and
difficult ones later.
Axy.
--
https://mail.python.org/mailman/listinfo/python-list
you're paid for SLOC :-)))
By the way, does "else" clause after affect cyclomatic complexity
metric? I mean "for" loops.
Axy.
--
https://mail.python.org/mailman/listinfo/python-list
7;s close it at last.
but the [for...else] is insane.
Not in Python.
Axy.
--
https://mail.python.org/mailman/listinfo/python-list
icipate in it.
Axy.
--
https://mail.python.org/mailman/listinfo/python-list
On 10/10/2022 12:24, Chris Angelico wrote:
On Mon, 10 Oct 2022 at 21:57, Axy via Python-list
wrote:
Not sure what you mean, but a for-else without a break is quite
useless. What exactly ARE you arguing here?
The else is associated with the break to the exact extent that one is
essential
)
TL:DR
The “else” is a historical artificial from the way developers thought during
the transition from unstructured (i.e. “GOTO”) programming to structured
programming. Since we all do structured now, it seems odd.
From: Python-list on behalf of
Calvin Spealman
Date: Monday, October 10, 2022
return False
return True
for node in tree.body:
check_ast(node)
--
https://mail.python.org/mailman/listinfo/python-list
On 10/10/2022 19:25, Weatherby,Gerard wrote:
pylint, at least, provides a warning:
fe.py:4:0: W0120: Else clause on loop without a break statement
(useless-else-on-loop)
I'm using flake8, it does not, alas.
Axy.
--
https://mail.python.org/mailman/listinfo/python-list
ractices
eventually become notorious. There are many point of views to every
feature but in general features aren't divine and worth revising even
this looks disparaging.
Axy.
--
https://mail.python.org/mailman/listinfo/python-list
every column in the DataFrame?
Extra hint: You'll be returning a single number which is the final sum() of
everything.
df['Name'].isnull().sum()
--
https://mail.python.org/mailman/listinfo/python-list
their book: "Please write in C". Same
here: please speak in English.
Although, if you like that idea who can stop you? In such a case I vote
for ภาษาไทย
Axy.
--
https://mail.python.org/mailman/listinfo/python-list
I mean, it's worth to look at BeautifulSoup source how do they do that.
With BS I work with attributes exactly as you want, and I explicitly
tell BS to use lxml parser.
Axy.
On 19/10/2022 14:25, Robert Latest via Python-list wrote:
Hi all,
For the impatient: Below the longish text is a
h SVG, I used BeautifulSoup.
Axy.
--
https://mail.python.org/mailman/listinfo/python-list
aveat: I know very little about Python.
--
https://mail.python.org/mailman/listinfo/python-list
dict):
if (b>dict[a]):
dict[a]=b
else:
dict[a]=b
return(sorted(dict.values()))
--
https://mail.python.org/mailman/listinfo/python-list
On 11/11/2022 20:58, Thomas Passin wrote:
On 11/11/2022 2:22 PM, Pancho via Python-list wrote:
On 11/11/2022 18:53, DFS wrote:
On 11/11/2022 12:49 PM, Dennis Lee Bieber wrote:
On Fri, 11 Nov 2022 02:22:34 -0500, DFS declaimed the
following:
[(0,11), (1,1), (2,1),
(0,1) , (1,41), (2,2
', other)
self.additions.append(other)
return self Full article:
https://declassed.art/en/blog/2022/07/02/a-note-on-multiple-inheritance-in-python
--
https://mail.python.org/mailman/listinfo/python-list
]
-
So now the challenge is making it a one-liner!
x = [(11,1,1),(1,41,2),(9,3,12)]
print(functools.reduce( lambda a,b : [max(w,c) for w,c in zip(a,b)],
x, [0]*len(x[0])))
--
https://mail.python.org/mailman/listinfo/python-list
to pass 6 or 7
parameters down through several layers of logic (function A calling
function B calling ... ) and for results to be passed back.
Nothing fancy here, we used dicts for args and results.
Axy.
--
https://mail.python.org/mailman/listinfo/python-list
On 15/11/2022 04:36, Dan Stromberg wrote:
On Mon, Nov 14, 2022 at 11:33 AM Axy via Python-list
wrote:
On 14/11/2022 17:14, Stephen Tucker wrote:
> Hi,
>
> I have two related issues I'd like comments on.
>
> Issue 1 - Global Values
Your "
n be regarded as bad.
However, if nothing else works (including suggested globals.py module),
then os.environ could be a better way.
Axy.
--
https://mail.python.org/mailman/listinfo/python-list
ilman/listinfo/python-list
ight order. For dynamic content you can use class properties,
and inline invocations, such as 'hello, {my_db:get_name({person_id!r})}'
https://github.com/declassed-art/clabate
Axy
--
https://mail.python.org/mailman/listinfo/python-list
int('Hello, world!')
--
https://mail.python.org/mailman/listinfo/python-list
rocess. Why not clean the infrastructure up and make a
modern environment or IDE or something better than it is now. Or at least
good error messages that explain exactly what to do. Even getting this
email to the list took numerous steps.
-- A frustrated user
--
https://mail.python.org/mailman/
Passin wrote:
On 12/19/2022 12:28 PM, j via Python-list wrote:
I agree. Wasted too much time on last few installs.
It got to the point I downloaded python-embedded, unzipped it and set
the path manually for my work (needed it as part of a compiler).
I don't set those paths. If you have se
- and bearing-in-mind that the demands for response-time
may vary by type of query/data-access.
So many variables to consider ...
--
Regards,
=dn
--
https://mail.python.org/mailman/listinfo/python-list
s/phases of a program[me]'s
construction and execution. Some such thinking no doubt lingers...
--
Regards,
=dn
--
https://mail.python.org/mailman/listinfo/python-list
esired, without
eval().
dn $ ... python
Python 3.11.1 (main, Jan 6 2023, 00:00:00) [GCC 12.2.1 20221121 (Red
Hat 12.2.1-4)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> 1+1
2
>>> print( 123 )
12
On 29/01/2023 09.28, Chris Angelico wrote:
The REAL boolean is the friends we made along the way?
By REAL did you mean float - True or False?
(for the FORTRAN-free: https://fortranwiki.org/fortran/show/real)
--
--
Regards,
=dn
--
https://mail.python.org/mailman/listinfo/python-list
learn a new,
replacement, language!
--
Regards,
=dn
--
https://mail.python.org/mailman/listinfo/python-list
the "D" of SOLID,
ie Dependency Inversion.
You may pick-up some ideas or reassurance from "Making a Simple Data
Pipeline Part 1: The ETL Pattern"
(https://www.codeproject.com/Articles/5324207/Making-a-Simple-Data-Pipeline-Part-1-The-ETL-Patte).
Let us know how it turns-out...
--
Regards,
=dn
--
https://mail.python.org/mailman/listinfo/python-list
t
to think de-cluttering is a good idea!
Do you know of another way to attack this/more properly?
--
Regards,
=dn
--
https://mail.python.org/mailman/listinfo/python-list
rint(double(Fraction(7, 8)))
/# print(double("7")) PyCharm properly complains/
*From: *Python-list
on behalf of dn via Python-list
*Date: *Saturday, February 4, 2023 at 9:32 PM
*To: *'Python'
*Subject: *Typing Number, PyCharm
*** Attention: This is an external email. Use caution
BY readline() and readlines()# Expected behaviour:
new content should be added to the beginning of the file (as in
Example 1)
file.write("new city\n")
file.readlines()
file.close()
I could not find anything in documentation to explain this strange
behaviour. Why is this happening?
--
https://mail.python.org/mailman/listinfo/python-list
, but the
inconsistency is weird.
My response is absolutely useless, just two cents on the issue. Maybe
someone will fix that.
Axy.
--
https://mail.python.org/mailman/listinfo/python-list
y existing programs.
Yes, consistency is a good goal. Reality is a better goal.
I don't think overengineering is a good thing. Good design utilizes
associativity so a person don't get amazed by inconsistency in things
that expected to be similar.
Axy.
--
https://mail.python.org/mailman/listinfo/python-list
On 22/02/2023 21.49, Robert Latest via Python-list wrote:
I found myself building a complicated logical condition with many ands and ors
which I made more manageable by putting the various terms on individual lines
and breaking them with the "\" line continuation character. In this
ut prefer to trade that for
'readability'.
Perhaps that came from AWS CodeWhisperer which I have since abandoned,
or maybe from SonarLint (which I've just checked to discover it is not
working properly...)
--
Regards,
=dn
--
https://mail.python.org/mailman/listinfo/python-list
nd is typing. The IDE should catch most of the situations where an
int would be used as an str, or v-v. Remember though, Python's typing is
(a) not part of the language, and (b) probably won't help at run-time.
PS are you aware that there is a Python-Tutor list for the use of people
learning Python?
--
Regards,
=dn
--
https://mail.python.org/mailman/listinfo/python-list
on anagram
dictionary.
--
https://mail.python.org/mailman/listinfo/python-list
On 25/02/2023 08.12, Peter J. Holzer wrote:
On 2023-02-24 16:12:10 +1300, dn via Python-list wrote:
In some ways, providing this information seems appropriate. Curiously, this
does not even occur during an assert exception - despite the
value/relationship being the whole point of using the
for line continuation anyway. You could almost
think of "\
(newline)" in a multiline string as being like an escape sequence
meaning "don't actually put a newline character in the string here", in
a similar way to "\n" meaning "put a newline character here" and "\t"
meaning "put a tab character here".
Book title: "Don't Make Me Think"
(thoroughly recommended. Author: Steve Krug)
--
Regards,
=dn
--
https://mail.python.org/mailman/listinfo/python-list
u to demand others only directly-address you
(and only your questions)?
--
Regards,
=dn
--
https://mail.python.org/mailman/listinfo/python-list
On 28/02/2023 12.55, Rob Cliffe via Python-list wrote:
On 27/02/2023 21:04, Ethan Furman wrote:
On 2/27/23 12:20, rbowman wrote:
> "By using Black, you agree to cede control over minutiae of hand-
> formatting. In return, Black gives you speed, determinism, and freedom
> fr
egards,
=dn
--
https://mail.python.org/mailman/listinfo/python-list
ou want that in a DO-loop with a FORMAT?
--
Regards,
=dn
--
https://mail.python.org/mailman/listinfo/python-list
() and translate() to
convert all the separators to a single character, eg white-space, which
can then be split using any of the previously-mentioned methods.
If the problem is sufficiently complicated and the OP is prepared to go
whole-hog, then PSL's tokenize library or various parser libraries may
be worth consideration...
--
Regards,
=dn
--
https://mail.python.org/mailman/listinfo/python-list
On 08/03/2023 11.48, Jim Byrnes wrote:
haven't received anything from the list for quite awhile. Got no
response when I tried to contact the administrator.
ACK
--
Regards,
=dn
--
https://mail.python.org/mailman/listinfo/python-list
tinfo/python-list
96171-plug-in-architecture
There is a PyPi library called pluggy (not used it). I've used informal
approaches using an ABC as a framework/reminder (see @George's response).
--
Regards,
=dn
--
https://mail.python.org/mailman/listinfo/python-list
es employed at pretty-much the NotePad level?
Web.Refs:
https://www.jetbrains.com/help/pycharm/settings-postfix-completion.html
https://www.jetbrains.com/help/pycharm/using-live-templates.html#live_templates_types
--
Regards,
=dn
--
https://mail.python.org/mailman/listinfo/python-list
have quickly defined an
identifier without a lot of thought, but later (ie when come to make use
of it) realise a better alternative and more descriptive name.
--
Regards,
=dn
--
https://mail.python.org/mailman/listinfo/python-list
more recently, which helps reinforce said learning.
Yes...
(guilty as charged!)
Equally, may promulgate old habits and a lower-quality (related to the
depth of learning, back-then cf 'now').
--
Regards,
=dn
--
https://mail.python.org/mailman/listinfo/python-list
t to open a can-of-worms...
--
Regards,
=dn
--
https://mail.python.org/mailman/listinfo/python-list
file called "Allan.py", for example), and from which a
suggested-solution may be posted afterwards...
YMMV!
* New Zealand Open Source Society perq of membership
--
Regards,
=dn
--
https://mail.python.org/mailman/listinfo/python-list
e/choe/courses/20fall/315/lectures/slide23-solid.pdf
https://www.hanselminutes.com/145/solid-principles-with-uncle-bob-robert-c-martin
https://idioms.thefreedictionary.com/sword+of+Damocles
https://en.wikipedia.org/wiki/Damocles
--
Regards,
=dn
--
https://mail.python.org/mailman/listinfo/python-list
e with
later-maintenance) can one start using one approach, switch to using the
other, and then go back to the first?
--
Regards,
=dn
--
https://mail.python.org/mailman/listinfo/python-list
.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at
https://mail.python.org/archives/list/python-...@python.org/message/Q62W2Q6R6XMX57WK2CUGEENHMT3C3REF/
Code of Conduct: http://python.org/psf/codeofconduct/
--
Regards,
=dn
--
https://mail.python.org/mailman/listinfo/python-list
that
there are no surprises...
Change is inevitable. Thus, consider that your throne as code-author is
illusory - the user/client is able/likely to want change.
Then, if the code is organised according to functionality, the logging
environment (for example) can be changed without any need to re-code
somewhere else - and/or that tinkering with cmdLN arguments and such
code-changes can be done quite separately from the establishment of logging.
Ultimately, the smaller the function (think of establishing logging),
the more likely it will be able to be re-used in the next assignment
which requires a log! (whereas if it is mixed-in with argparse, re-use
is unlikely because the cmdLN args will be different)
There's plenty of references about such on the web. Will be happy to
discuss whichever sub-topics might be of-interest, further...
--
Regards,
=dn
--
https://mail.python.org/mailman/listinfo/python-list
ble into the config class - how to collect
environment-data, and satisfying any/all demands for its use. Then, the
application can be relieved of all detail ("give me what I want"), only
asking for whatever it requires, when it requires, and in the format it
requires - tailored and ready for immediate-use...
--
Regards,
=dn
--
https://mail.python.org/mailman/listinfo/python-list
ion immutability (wrt to dataclasses) in that it is possible to
add a __hash__() method (any object defined with is (technically)
immutable). However, apart from the default_factory argument, there
doesn't appear to be other discussion of [im]mutability.
Anything I've 'missed'?
- or a salutary tale of not depending upon ChatGPT etc?
--
Regards,
=dn
--
https://mail.python.org/mailman/listinfo/python-list
On 19/04/2023 11.18, Kevin M. Wilson via Python-list wrote:
Greetings... Kevin here:I need help, as you have guessed!I have this line: The
Print Statement... Why complain about a 'comma', or a ')'???def play_game():
number = random.randint(1, LIMIT)
print (f'&
;s previous code which defines LIMIT
On 19/04/2023 17.27, Kevin M. Wilson via Python-list wrote:
Ok, I got rid of the "print (f'"I am thinking of a number between 1 to {LIMIT}\n")"print
("I am thinking of a number between 1 to {LIMIT}\n"),
and Pycharm stopped c
e list communications and ReplyList -
you may need to do that manually...
--
Regards,
=dn
--
https://mail.python.org/mailman/listinfo/python-list
On 20/04/2023 04.25, Alan Gauld wrote:
On 19/04/2023 10:51, Kevin M. Wilson via Python-list wrote:
I'm in a bit of a quandary, I want some strict syntax errors to be flagged,
OK, You might want to use a "linter" in that case because most
tools use the interpreter itself
there'll be many who are unable to understand your/my aphorisms and
allusions. Hence trying to stay with a more 'international English'.
"When you pass through the waters, I will be with you: and when you pass
through the rivers, they will not sweep over you. When you wal
ause we
didn't have 'all those braces' (and other punctuation-characters)
cluttering-up the code???
--
Regards,
=dn
--
https://mail.python.org/mailman/listinfo/python-list
42
So, it rather depends upon what you want returned from the actual
myint() function.
Web.Refs:
https://docs.python.org/3/reference/datamodel.html?highlight=context%20manager#with-statement-context-managers
https://docs.python.org/3/reference/compound_stmts.html?highlight=context%20manager#the-with-statement
I'm curious though, why not:
class X:
def __enter__( etc
def __exit__( etc
with the actual code from myint9) as the suite/body of the __enter__()?
(in which case, the rôle of self is 'standard operating procedure' and
may be more obvious)
--
Regards,
=dn
--
https://mail.python.org/mailman/listinfo/python-list
On 05/05/2023 04.28, Kevin M. Wilson via Python-list wrote:
Hi... How do I set Pycharm to find only syntax errors?!!
Please review response to previous message re:configuring PyCharm's
helpful features towards to coders and quality-coding...
--
Regards,
=dn
--
https://mail.pytho
---
A custom-class wrapper?
Even, a decorator-able function?
--
Regards,
=dn
--
https://mail.python.org/mailman/listinfo/python-list
On 24/05/2023 10.21, Rob Cliffe via Python-list wrote:
This sort of code might be better as a single expression. For example:
user = (
request.GET["user"]
.decode("utf-8")
.strip()
.lower()
)
user = orm.user.get(name=user)
LOL. And I thought I was
On 24/05/2023 12.27, Chris Angelico wrote:
On Wed, 24 May 2023 at 10:12, dn via Python-list wrote:
However, (continuing @Peter's theme) such confuses things when something
goes wrong - was the error in the input() or in the float()?
- particularly for 'beginners'
- and yes, we
do not use MS-Windows (which is an assumption - not stated in OP),
and thus cannot vouch for the veracity of this advice, nor for its
accuracy - caveat emptor!
Hope one of those sets of ideas will help...
- will be interested to hear how you get on...
--
Regards,
=dn
--
https://mail.python.org/mailman/listinfo/python-list
e) because the RDBMS-interactions are few-and-far
between, or only a small part of the total.
I don't use one, but others enthuse about ORMs, eg SQLAlchemy. This
suits those who combine RDBMS and OOP, and has its own persistence
methodology.
--
Regards,
=dn
--
https://mail.python.org/mailman/listinfo/python-list
ttps://mail.python.org/mailman/listinfo/python-list
> On 7 Jun 2023, at 16:39, Florian Guilbault via Python-list
> wrote:
>
> Dear Python Technical Team,
>
> I hope this email finds you well. I am reaching out to you today to seek
> assistance with an issue I am facing regarding the installation of 'pip'
&g
On 2023-06-07 15:54, Florian Guilbault via Python-list wrote:
Dear Python Technical Team,
I hope this email finds you well. I am reaching out to you today to seek
assistance with an issue I am facing regarding the installation of 'pip'
despite my numerous attempts to resolve t
101 - 200 of 5713 matches
Mail list logo