Re: Help? How do i solve this problem with Python List Concept

2019-05-11 Thread Richard Damon
On 5/11/19 5:02 PM, Ben Bacarisse wrote: > Donald Tripdarlinq writes: > >> In the traditional Yoruba tribal Set-Up in Nigeria,West Africa the >> tradition of inheritance is very important. Now, The relative position >> of a child in the family counts when the issue of inheritance is >> considered

Re: Handle foreign character web input

2019-06-29 Thread Richard Damon
nerated codes). All the various 'codepages' were useful in their day, when machines were less capable, and Unicode hadn't been invented or wasn't supported well or was too expensive to use. Now (as I understand it), all Python (3) 'Strings' are internally Unicode, if yo

Re: Handle foreign character web input

2019-06-30 Thread Richard Damon
On 6/30/19 4:00 AM, moi wrote: > Le samedi 29 juin 2019 19:25:40 UTC+2, Richard Damon a écrit : >> >> Now (as I understand it), all Python (3) 'Strings' are internally >> Unicode, if you need something with a different encoding it needs to be >> in Bytes. >&

Re: Handle foreign character web input

2019-06-30 Thread Richard Damon
On 6/30/19 10:04 AM, Chris Angelico wrote: > On Sun, Jun 30, 2019 at 10:26 PM Richard Damon > wrote: >> On 6/30/19 4:00 AM, moi wrote: >> > I didn't see who you were quoting, but it looks like our old "Py3's > Unicode is buggy" troll is back (or maybe

Re: Books for Python 3.7

2019-07-12 Thread Richard Mok
On Friday, July 12, 2019 at 11:04:57 AM UTC-4, sjm...@gmail.com wrote: > On Friday, July 12, 2019 at 11:37:08 AM UTC-3, mok...@gmail.com wrote: > > Can anyone help me. > > New to Python. > > Installed version 3.7 > > I purchased the "Python for Dummies" book But this book was written for an > > ol

Re: How to sort the files based on the date?

2019-07-15 Thread Richard Damon
ble, as it relies on changing the file name format would be to switch the file names to using something like an ISO date format fo the name, ISO dates are in the format -MM-DD (Month is a two digit number) which has the nice attribute that the alphabetical sort is also a date sort. If you can

Re: join and split with empty delimiter

2019-07-18 Thread Richard Damon
e significant, that unless the join list was built of exactly 1 character strings, the split won't match, and that seems somewhat special case for a variable delimiter. -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: Why am I getting duplicate values in my output?

2019-07-26 Thread Richard Damon
atter on, the list is still refering to that now changed dictionary. Either you need to copy the dictionary, and add the new copy, or create a new copy with each iteration of the loop. At the end of the loop, ap_list is a list of all the same dictionary, the same one that ap_dict is bound to, you just kept changing it every time through the loop. if ap_dict was set to a new empty dictionary in the loop, then all the copies would be distinct. -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: Definite or indefinite article for non-singletons?

2019-07-28 Thread Richard Damon
licated history), can be filled with all sorts of strangeness, and this can get compounded when it wants to be harmonized with a technical subject which can't deal with some of the naturalness of language, thus we can't try to use some sort of rule matching the type of article to the appropriateness of the python word "is". -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: Definite or indefinite article for non-singletons?

2019-07-28 Thread Richard Damon
category, some part, but the phrase "all the things", we aren't looking at any category, but literally ALL the things. "All of the things" implies all of the things within some group, possibly implied by context. The category "thing" is implied by the word thing, so

Re: Boolean comparison & PEP8

2019-07-28 Thread Richard Damon
ess it all depends on what you need to do. If you just need to > check truthiness, just do "if greeting" If you need to know if the > variable is some particular sentinel, use the "if greeting is whatever". I thought the recommended value was None, not False (so you don't

Re: Boolean comparison & PEP8

2019-07-28 Thread Richard Damon
On 7/28/19 8:25 PM, Chris Angelico wrote: > On Mon, Jul 29, 2019 at 10:15 AM Richard Damon > wrote: >> On 7/28/19 7:46 PM, Michael Torrie wrote: >>> On 7/28/19 5:55 AM, Jonathan Moules wrote: >>>> But this appears to be explicitly called out as being "Wo

Re: Boolean comparison & PEP8

2019-07-28 Thread Richard Damon
On 7/28/19 8:46 PM, Chris Angelico wrote: > On Mon, Jul 29, 2019 at 10:43 AM Richard Damon > wrote: >> On 7/28/19 8:25 PM, Chris Angelico wrote: >>> Of course, if the third value can be simplified away (eg None means >>> "use the global default"), th

Re: Why they use this: duration = time.time() - self.start_time + 1

2019-08-04 Thread Richard Damon
d the 0 duration, and after a human scale duration, doesn't perturb the value enough to make much of a difference. -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: Installing python3 packages using pip

2019-08-08 Thread Richard Moseley
f possible always create a new 'venv' and install the packages in there instead of the system, it avoids polluting the environment and makes it easier to tidy up unwanted packages at a later stage. Hope this helps, Richard Moseley. On Thu, 8 Aug 2019 at 16:03, Rich Shepard wrote:

Re: absolute path to a file

2019-08-17 Thread Richard Damon
on??? I don't think it has its own Python, but it sounds like it sort of extends the file system, and uses a leading // for something special. That means files that begin with // need to be processes through the blender library and not be used directly to the OS. -- Richard Damon --

Re: absolute path to a file

2019-08-20 Thread Richard Damon
ately that is likely fine, and I've misread the event (provided > gmane backfeeds to the mailing list). I think gmane feed the newsgroup comp.lang.python which feeds python-list@python.org. Python-list probably then sees that you already were getting a direct copy so omits sending you

Re: How should we use global variables correctly?

2019-08-22 Thread Richard Damon
he C/C++ file scoped 'static' which is less bad that fully global variables (the extern variable). -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: How to create a list and append to list inside a mqtt and GUI program?

2019-09-01 Thread Richard Damon
GUI.py to test this and test1.py and > test2.py are the files which can be used to import GUI . To make the list persistent you need to create it as a module global or as a class member of a persistent object (like your MainWindow) -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: WedWonder: Scripts and Modules

2019-09-12 Thread Richard Damon
. > Well technically, def and class are statements that are executed when the module is imported, you need to execute them to add the definitions into the appropriate namespace. Perhaps the 'rule' needs to be somewhat restated to a form where the only thing that should execute when importing a module are the statements needed to create the definitions for the module. -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: exec and globals and locals ...

2019-09-19 Thread Richard Damon
this is one case that shows it. x = x + 1 is an assignment to the symbol x, which makes x a local, and thus the read becomes an undefined symbol. x += 1 is different, it isn't a plain assignment so doesn't create the local. The read of x is inherently tied to the writing of x so x stays referring to the global. -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: exec and globals and locals ...

2019-09-19 Thread Richard Damon
On 9/19/19 6:52 AM, Eko palypse wrote: > Am Donnerstag, 19. September 2019 12:45:35 UTC+2 schrieb Richard Damon: >> On 9/19/19 6:16 AM, Eko palypse wrote: >>>> In all cases, if the optional parts are omitted, the code is executed in >>>> the current scope. ... &

Re: Most efficient way to replace ", " with "." in a array and/or dataframe

2019-09-22 Thread Richard Damon
ze that I could avoid formatting problems in the > dataframe or array simply by using the read_csv command with the > correct parameters (sep and decimal). > > I searched for information about the meaning of the letter "b" in the > parameter decimal=b','  but didn't find. > > I found that it also works without the letter b. > > Best Regards, > Markos The b indicates that the string is a 'bytes' string vs a text string. This isn't so important to differentiate for ASCII characters, but can make a difference if you have extended characters and the file might not be in Unicode. -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: pathlib

2019-10-01 Thread Richard Damon
ple files that exist at the same time (create the file and keep it open, unlink or rename the file, and you can create another with the original name). We also have relative paths, relative paths specify a file path relative to something, but don't keep track of that something, and as such may truly represent multiple real files. These show that these paths CAN'T actually represent the files, -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: Recursive method in class

2019-10-02 Thread Richard Damon
at purpose, like invalid. If you want to use an invalid email address, then you could use something like 'ast@invalid' or 'ast@email.invalid' and then you know that you can't be accidentally impersonating someone else. -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: pathlib

2019-10-03 Thread Richard Damon
he right term here, but the beginning of the documentation for Pathlib does sort of define what it means here: Path classes are divided between pure paths <https://docs.python.org/3/library/pathlib.html#pure-paths>, which provide purely computational operations without I/O, and concrete paths <https://docs.python.org/3/library/pathlib.html#concrete-paths>, which inherit from pure paths but also provide I/O operations. So for Pathlib, Concrete means that it provides access to I/O operations and thus can only handle paths of the flavor of the OS the program is running on. -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: python3, regular expression and bytes text

2019-10-12 Thread Richard Damon
UCS-4) at input (if needed) and process in that domain. You do need to be prepared to run into files which are encoded in some locally defined 8-bit code page. In Python3,  strings are unicode encoded, and you don't need to worry about the details of which encoding is used internally, Python will deal with that itself. -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: Convert a scientific notation to decimal number, and still keeping the data format as float64

2019-10-18 Thread Richard Damon
on format for floating point). Scientific notation vs fixed point notation is purely an OUTPUT configuration, not a function on how the number is stored (so in one sense IS more closely linked to a string than the float itself). -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: Convert a scientific notation to decimal number, and still keeping the data format as float64

2019-10-18 Thread Richard Damon
print(x) >> 4.449e-05 >> >> hth >> Gys > Hello, > > I don't only need a human readable representation of number, I need to use it > further, do things such as putting it in a pandas object and saving it to an > excel file. > > Doing thi

Re: Convert a scientific notation to decimal number, and still keeping the data format as float64

2019-10-18 Thread Richard Damon
On 10/18/19 9:03 AM, doganad...@gmail.com wrote: > On Friday, October 18, 2019 at 2:21:34 PM UTC+3, Richard Damon wrote: >> On 10/18/19 4:35 AM, doganad...@gmail.com wrote: >>> Here is my question: >>> >>> >>> I am using the numpy.std formula to calcul

Re: Convert a scientific notation to decimal number, and still keeping the data format as float64

2019-10-18 Thread Richard Damon
On 10/18/19 9:45 AM, doganad...@gmail.com wrote: > On Friday, October 18, 2019 at 4:17:51 PM UTC+3, Richard Damon wrote: >> On 10/18/19 9:03 AM, doganad...@gmail.com wrote: >>> On Friday, October 18, 2019 at 2:21:34 PM UTC+3, Richard Damon wrote: >>>> On 10/18/19

Re: What's the purpose the hook method showing in a class definition?

2019-10-20 Thread Richard Damon
#x27;t > find document about it also:-( > > --Jach The simple answer is that the attribute lookup happens at run time, not compile time (unlike some other languages). Thus attributes/member functions can be added by sub-classes, or even just to that instance at run time an

Re: Convert a scientific notation to decimal number, and still keeping the data format as float64

2019-10-22 Thread Richard Damon
mber takes more space to represent than the exponential. 1.2E-05 takes 7 characters, 0.15 takes 8 so the exponential is shorter. As an aside, I would be very leery of numbers like 0.1 or 1e-05 as they only show 1 significant digit, so unless I have good reason to believe that they are exact numbers, I would have concern of them being very imprecise, and possibly just noise. -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: How execute at least two python files at once when imported?

2019-11-06 Thread Richard Damon
mmunication between themselves, and you would need to manually add what ever communication was needed. A second option is to create a second thread, and do one if the imports in that thread, and one in the main thread. This is likely the closest to the stated goal, but likely, due to the GIL,

Re: nonlocal fails ?

2019-11-14 Thread Richard Damon
On Nov 14, 2019, at 12:18 PM, R.Wieser wrote: > > Rhodri, > >> MyVar is a global here, so nonlocal explicitly doesn't pick it up. > > I do not agree with you there (the variable being global). If it where than > I would have been able to alter the variable inside the procedure without > ha

Re: nonlocal fails ?

2019-11-14 Thread Richard Damon
> > On Nov 14, 2019, at 12:20 PM, R.Wieser wrote: > > MRAB, > >> 'nonlocal' is used where the function is nested in another function > > The problem is that that was not clear to me from the description - nor is > it logical to me why it exludes the main context from its use. > > Regards, >

Re: nonlocal fails ?

2019-11-14 Thread Richard Damon
> On Nov 14, 2019, at 12:56 PM, R.Wieser wrote: > > Jan, > >> So what you want to do is dynamic scope? > > No, not really.I was looking for method to let one procedure share a > variable with its caller - or callers, selectable by me. And as a "by > reference" argument does not seem t

Re: nonlocal fails ?

2019-11-14 Thread Richard Damon
On 11/14/19 1:43 PM, R.Wieser wrote: > Richard, > >> Assuming that one language works like another is a danger > Abitrarily redefining words and using misnomers is another ... ("global" > and "nonlocal" respecivily if you wonder) > >> First, Pytho

Re: nonlocal fails ?

2019-11-14 Thread Richard Damon
tion was looking for? > Handle it the same as any other mistake, and throw an error ? > > Regards, > Rudy Wieser > > -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: nonlocal fails ?

2019-11-15 Thread Richard Damon
to a different model, and I think it helps to accept that it is different rather than trying to keep trying to translate how Python does things into how some other language does it, as the latter make you focus on the things it can't do, not the things it can. -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: nonlocal fails ?

2019-11-15 Thread Richard Damon
On 11/15/19 11:04 AM, Random832 wrote: > On Fri, Nov 15, 2019, at 10:48, Richard Damon wrote: >> On 11/15/19 6:56 AM, R.Wieser wrote: >>> There are quite a number of languages where /every/ type of argument >>> (including values) can be transfered "by referenc

Re: nonlocal fails ?

2019-11-15 Thread Richard Damon
return then elsewhere you could do foo(j) and after that j is 2 you also could do foo(1) and after that if you did j = 1 then now j might have the value 2 as the constant 1 was changed to the value 2 (this can cause great confusion) later I believe they added the ability to specify by value

Re: nonlocal fails ?

2019-11-15 Thread Richard Damon
On 11/15/19 12:21 PM, Random832 wrote: > On Fri, Nov 15, 2019, at 11:47, Richard Damon wrote: >> The issue with calling it a Reference, is that part of the meaning of a >> Reference is that it refers to a Object, and in Python, Names are >> conceptually something very much dif

Re: nonlocal fails ?

2019-11-17 Thread Richard Damon
ces, but that assignment, rather than being applied to the referred to object, re-seat the reference to point to the new object. As such, you can't get a reference to the name, to let one name re-seat where another name refers to. -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: wordsearch

2019-11-19 Thread Richard Damon
Look at our code, and what controls the order you data is output. Change it so that the data is processed in the order you want the output. -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: wordsearch

2019-11-19 Thread Richard Damon
On Nov 19, 2019, at 10:56 AM, Chris Angelico wrote: > > On Wed, Nov 20, 2019 at 2:46 AM wrote: >> >> Dne úterý 19. listopadu 2019 13:33:53 UTC+1 Richard Damon napsal(a): >>>> On 11/19/19 6:47 AM, jezka...@gmail.com wrote: >>>>> Hi, I have go

Re: nonlocal fails ?

2019-11-23 Thread Richard Damon
something fundamentally different than a box to hold a value. If you show names as boxes with arrows in them, someone is going to ask how to get one name point to another name (re the discussion about is it call by value or call by reference) -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: Fit to function values with numpy/scipy

2019-11-25 Thread Richard Damon
a weighted average or weighted standard deviation, I don't know scipy to know if it has something like that built in. A quick scan shows that numpy.average allows a weighting array to be provided, so it shouldn't be hard to look at the code for sci[y.norm.fit and convert it to use weighted averages. -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: Pickle caching objects?

2019-11-30 Thread Richard Damon
ely using, as when objects go away there memory is returned to the free pool INSIDE Python, to be used for other requests before asking the OS for more. -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: "Don't install on the system Python"

2019-12-01 Thread Richard Damon
ubles as some packages become incompatible because one needs a version greater than x, while another needs a version less than x. -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: array and struct 64-bit Linux change in behavior Python 3.7 and 2.7

2019-12-02 Thread Richard Damon
On Dec 2, 2019, at 12:32 PM, Chris Clark wrote: > > Test case: > > import array > array.array('L', [0]) > # x.itemsize == 8 rather than 4 > > This works fine (returns 4) under Windows Python 3.7.3 64-bit build. > > Under Ubuntu; Python 2.7.15rc1, 3.6.5, 3.70b3 64

Re: array and struct 64-bit Linux change in behavior Python 3.7 and 2.7

2019-12-02 Thread Richard Damon
types. Welcome to the ambiguity in the C type system, the basic types are NOT fixed in size. L means 'Long' and as Christian said, that is 8 byte long on Linux-64 bit. 'L' is exactly the right type for interfacing with a routine defined as taking a long. The issue is that you don

Re: urllib unqoute providing string mismatch between string found using os.walk (Python3)

2019-12-21 Thread Richard Damon
f codepoints, the o and U+0301 (the accent). If you want to make the strings compare equal then you need to make sure that you have normalized both strings the same way. I beleive that the Mac OS always converts file names into the NFD format when it uses them (that is what the first (a) string is in) -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: Most elegant way to do something N times

2019-12-22 Thread Richard Damon
uld of course use something like a while loop to build this, but in my mind that is just making things less clear. -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: Lists And Missing Commas

2019-12-24 Thread Richard Damon
ical on some systems using fixed length lines, so allowing a constant to be built on multiple lines was useful. -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: Does the argparse generate a wrong help message?

2019-12-27 Thread Richard Damon
Can you elaborate on why you expect this? You've declared one of them to have a single mandatory argument, and the other a single optional argument. This corresponds to what I'm seeing. ChrisA So the square bracket means optional, not list? My misunderstanding:-( --Jach Yes, the norm

Re: Friday Finking: Source code organisation

2019-12-28 Thread Richard Damon
ule b needs resources from module a, it needs to import module a before it can use them. If module a also needs resources from module b, and imports it, then stuff from b might not be available while doing the running of module a that is defining the items in a. -- Richard Damon -- https:/

Re: Clarification on Immutability please

2020-01-22 Thread Richard Damon
p.mutate() can change the value of the shared object, but there is no way to make v refer to some new object. The key distinction is that in Python, names are NOT objects, they only bind to objects, and thus names can't refer to some other name to let us rebind them remotely. -- Richa

Re: Nested Loop Code Help

2020-01-26 Thread Richard Damon
mes (for starting values of count = 0, 1, 2, 3, 4, 5, 6, 7, 8 Think about what you wanted to do and what the code actually did. The first for x in range (0, 10) doesn't really do what I think you wanted, did you mean for the second loop to be nested in it? If you do nest the seco

Re: Nested Loop Code Help

2020-01-26 Thread Richard Damon
while loop, which would add x 'x's to the string. -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: Nested Loop Code Help

2020-01-26 Thread Richard Damon
;t solve his problem, as his expected was lines of 1 to 10 stars, not 0 to 9. Second, this smells a bit like homework, and if they haven't learned the results of string times integer, then using that operation wouldn't be in their tool kit, so having a loop to build that operator makes sense. -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: Is there a character that never appears in the output of zlib.compress?

2020-01-29 Thread Richard Damon
be to take some byte value, (like FF) and where ever it occurs in the compressed data, replace it with a doubled value FF FF, and then add a single FF to the end. -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: Documentation of __hash__

2020-02-07 Thread Richard Damon
function, which uses some of the 'value' of the object, then presumably you intend for objects where that 'value' matches to be equal, which won't happen with the default __eq__. -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: Idiom for partial failures

2020-02-20 Thread Richard Damon
if the code was going to iterate through the success anyway, then there isn't as much of a cost to detect the errors that occured. -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: ÿ in Unicode

2020-03-07 Thread Richard Damon
On 3/7/20 12:52 PM, Ben Bacarisse wrote: > moi writes: > >> Le samedi 7 mars 2020 16:41:10 UTC+1, R.Wieser a écrit : >>> Moi, >>> Fortunately, UTF-8 has not been created the Python devs. >>> >>> And there we go again, making vague statements/accusations - without >>> /anything/ to back it u

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

2020-03-07 Thread Richard Damon
tive path, so the path is relative to the SERVER, not the current page, so it would be superhost.gr/mailform The other format goes through a function which might re-interpret the path and either make it page relative or add in the path of the current page to get to /test/mailform -- Ri

Re: Confusing textwrap parameters, and request for RE help

2020-03-25 Thread Richard Damon
ce between words through the line. The varying spaces between words can be a bit annoying, but it was done. My thought is that variable width fonts tend to put more characters per inch. and with wider screens we are no longer trying as hard to keep to less than 80 characters per line (or

Re: Confusing textwrap parameters, and request for RE help

2020-03-26 Thread Richard Damon
> -- > Grant > > > Back in the day it was FREQUENTLY done, in part to show off, anyone could type with a typewriter and get jagged right margins, but with a computer you could get justified margins with uneven internal spacing!! Status! -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

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

2020-04-16 Thread Richard Damon
it is more important if the object quacks like a duck then if it technically IS a duck. (And strangely, I believe you can have something that technically is a duck, but doesn't quack like one, as well as something totally unrelated to the duck type but quacks just like one). Files are such an animal, 'fileness' is not based on type, but on capability. -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: "pip" error message

2020-04-20 Thread Richard Guinn
ara3.xml\\setup.py'"'"'; When I 'Google' the error - I find that there's an apparent bug https://stackoverflow.com/questions/60937863/error-command-errored-out-with-exit-status-1 Doesn't sound like there's an easy workaround. Richard On Mon, Apr

Re: Floating point problem

2020-04-20 Thread Richard Damon
ith reducing precision. With Binary floating point, you only have denormals near underflow. Now Decimal Floating point doesn't have this implied leading 1, but can have denormals at almost all of the ranges. -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: Floating point problem

2020-04-21 Thread Richard Damon
oint number has only 1 significant digit (leading 0's are NOT significant), so the second smallest floating point number is twice that number. The key is that once you hit the denormals, you no longer have a relative accuracy like in the normal numbers, but all the denormals have the same absolute a

Re: why no camelCase in PEP 8?

2020-05-19 Thread Richard Damon
rs. > > grep '\bsnake_case\b *.py > > Barry > I think the issue is that you can easy search for all 'snake_case' and get them, but you have more difficulty searching for all 'camelCase', needing to go case insensitive, but if leading case matters (like there

Re: Getting value of a variable without changing the expression in Python

2020-05-21 Thread Richard Damon
a  veloctiy = solve(flowrate_fun, flowrate) i.e. you pass a function and it finds what input make the function have a give value. -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: Enums are Singletons - but not always?

2020-05-23 Thread Richard Damon
ou should be checking for equality (==) not identity (is) -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: Data structures and Algorithms

2020-06-30 Thread Richard Damon
al structure of the Data Structure, and seeing the explicit pointers can be helpful here. Python may be better for the Algorithms side, where hiding some of the gritty detail can be more useful, though that hiding might obscure some details if you want to think about what is the complexity of an

Re: Confused about np.polyfit()

2020-07-19 Thread Richard Damon
ng to a polynomial is that you can get a closed form set of equations to solve to find the 'optimal' values. The primary effect of transforming the data before doing the fit is the error is now defined in terms of the difference of the transformed values, not the original values. In many cases, this is actually a reasonable way to define your error, so it works. -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: questions re: calendar module

2020-08-02 Thread Richard Damon
that you may want to trim them out when possible. I would likely just build the formatter to start by assuming 6 week months, and then near the end, after stacking the side by side months, see if it can be trimmed out (easier to remove at the end then add if needed) -- Richard Damon

Re: questions re: calendar module

2020-08-02 Thread Richard Damon
27;Academic' calendars that might start in July or August and go to maybe the following September -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: questions re: calendar module

2020-08-02 Thread Richard Damon
iar with what you are doing. The second method would be to write a program to do this. Maybe use the 'canned' routine as a base for the program, but accept that your actual desired output is unusual enough it won't be something you can get with a single call. Maybe accept you can't get exactly what you want, so be willing to accept something close. Maybe the chart goes from January of your start year to December of the final year if the library likes doing a full year at a time. -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: Are instances of user-defined classes mutable?

2020-08-06 Thread Richard Damon
s that requirement. To find that element in the dictionary, you would need to build a tuple using that exact same me object, you couldn't create another object, and set it to the same 'value', as they won't compare equal. -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: Are instances of user-defined classes mutable?

2020-08-06 Thread Richard Damon
>): 23} >>>>> hash(h) >> 2 >>>>> hash(list(d.keys())[0]) >> -3550055125485641917 >>>>> h.a=33 >>>>> hash(list(d.keys())[0]) >> -3656087029879219665 >>>>> > so the dict itself doesn't enforce immutability of its keys Yes, here you have defined a hash that violates the requirements of the Dictionary (and most things that use hashes) so your class is broken, and you can expect to get strangeness out of your dictionary. > -- > Robin Becker > -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: How explain why Python is easier/nicer than Lisp which has a simpler grammar/syntax?

2020-08-06 Thread Richard Damon
ce you are not using an iterator of the list, changing it shouldn't cause any problems. You loop (for its control) looks at the loop once, before it starts, so as long as you don't delete any elements (which would cause the index to go to high) you can't have an issue mutating the li

Re: Are instances of user-defined classes mutable?

2020-08-07 Thread Richard Damon
at least to the tuple, immutable, as the only part of it that matters is the value of id() which WILL be unchanging. -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: How explain why Python is easier/nicer than Lisp which has a simpler grammar/syntax?

2020-08-07 Thread Richard Damon
e of statement, so = can't be misused in an expression thinking it means an equality test (and then added recently the := operator, so that for the cases you actually want to do assignments in the middle of an expression you can). -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: How explain why Python is easier/nicer than Lisp which has a simpler grammar/syntax?

2020-08-07 Thread Richard Damon
n alleviate some of the issues (at other costs). -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: How explain why Python is easier/nicer than Lisp which has a simpler grammar/syntax?

2020-08-07 Thread Richard Damon
On 8/7/20 12:52 PM, Marco Sulla wrote: > About statement vs expression: maybe you, Richard and > 2QdxY4RzWzUUiLuE, are right, maybe not. This is hard to say, since the > official C documentation is not public and you have to pay a small fee > to obtain it. > > Anyway, I said &qu

Re: How explain why Python is easier/nicer than Lisp which has a simpler grammar/syntax?

2020-08-07 Thread Richard Damon
ng basically the iterative solution, so that the recursive call to fir(0, ...) doesn't actually calculate the fib(0) value, but fib(n). Yes, this shows that you can convert an iterative solution into a recursive solution with a bit of hand waving, but you still end up with a program based on th

Re: How explain why Python is easier/nicer than Lisp which has a simpler grammar/syntax?

2020-08-07 Thread Richard Damon
On 8/7/20 3:54 PM, Marco Sulla wrote: > On Fri, 7 Aug 2020 at 19:48, Richard Damon wrote: >> The difference is that the two languages define 'expression' differently. >> [...] > I don't know if this is interesting or pertinent to the topic. > > Christian Se

Re: How explain why Python is easier/nicer than Lisp which has a simpler grammar/syntax?

2020-08-07 Thread Richard Damon
On 8/7/20 6:55 PM, Marco Sulla wrote: > On Sat, 8 Aug 2020 at 00:28, Richard Damon wrote: >> The really interesting part is that since Lisp programs manipulate lists >> as data, and the program is just a list, Lisp programs have the >> theoretical ability to edit the

Re: Including a Variable In the HTML Tags When Sending An Email

2020-08-08 Thread Richard Damon
#x27;Cc'] = ', '.join(CC_Address) > msg['Subject'] = Subject_Email > > message = MIMEText(html,'html') > msg.attach(message) > mail.sendmail(From_Address, (To_Address + CC_Address), msg.as_string()) > [/python] > > In this case the variable Name is Tom and i want to include Tom in the email. > > Can anyone help? > > Still a newbie; approx 3 weeks playing with Python (cut and past most of this > code) > > Any help will be greatly appericated. > > Thank you. -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: Including a Variable In the HTML Tags When Sending An Email

2020-08-08 Thread Richard Damon
On 8/8/20 10:58 AM, sammy.jackson...@gmail.com wrote: > Thank you Richard for your response. > > I have moved all the text i want the user to see into the body of the email. > > I still cannot get my email to display the name. > > Name = "Tim" > > How wou

Re: Including a Variable In the HTML Tags When Sending An Email

2020-08-08 Thread Richard Damon
ted differently to get them into clean html. -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: Including a Variable In the HTML Tags When Sending An Email

2020-08-09 Thread Richard Damon
On 8/9/20 6:22 PM, sammy.jackson...@gmail.com wrote: > On Sunday, August 9, 2020 at 1:32:30 AM UTC+1, Richard Damon wrote: >> On 8/8/20 8:03 PM, sammy.jackson...@gmail.com wrote: >>> If i use place holders i.e. {0} and {1} where {0} is the name and {1} is >>> the dataf

Re: How explain why Python is easier/nicer than Lisp which has a simpler grammar/syntax?

2020-08-15 Thread Richard Damon
A few comments come to mind about this discussion about TCO. First, TCO, Tail Call Optimization, is talking about something that is an optimization. Optimizations, are generally some OPTIONAL improvement in the method of executing the code that doesn't alter its DEFINED meaning. First big point,

Re: Final statement from Steering Council on politically-charged commit messages

2020-08-18 Thread Richard Damon
asking how would it feel to be that 'slave node', maybe even needing to wait for your 'master' to ask before you went to the bathroom, or be considered to be 'malfunctioning'. -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: Final statement from Steering Council on politically-charged commit messages

2020-08-18 Thread Richard Damon
er power, it has no authority, except might, to enforce it. If we accept might as the right and power to rule, we need to accept that it was and will be the right and power, and accept what it brought and will bring. -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: About float/double type number in range.

2020-08-26 Thread Richard Damon
ou get the expected value) or slightly lower (where you would get the top 'excluded' value listed). This sort of unpredictability is part of the difficulty dealing with floating point. As was pointed out, you can scale the range, or build your own generator to get what you want. -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: Why __hash__() does not return an UUID4?

2020-08-26 Thread Richard Damon
Since the typical use of hash will be followed by a real equality test if the hashes match, we don't need the level of a UUID -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: Why __hash__() does not return an UUID4?

2020-08-26 Thread Richard Damon
sh(y) were random numbers, then how would this property be maintained? > > Or do UUID4 mean something else to you than a random number? Looking up which UUID type 4 is, yes it is a random number, so could only be applicable for objects that currently return id(), which could instead make id

<    1   2   3   4   5   6   7   8   9   10   >