Re: Usenet vs. Mailing-list

2023-01-29 Thread Ben Bacarisse
Igor Berger writes: > On Saturday, January 28, 2023 at 10:02:57 PM UTC-5, Ben Bacarisse wrote: >> Jon Ribbens writes: >> >> > On 2023-01-29, Ben Bacarisse wrote: >> >> "Peter J. Holzer" writes: >> >> >> >

Re: Usenet vs. Mailing-list

2023-01-28 Thread Ben Bacarisse
Jon Ribbens writes: > On 2023-01-29, Ben Bacarisse wrote: >> "Peter J. Holzer" writes: >> >>> On 2023-01-27 21:04:58 +, Ben Bacarisse wrote: >>>> mutt...@dastardlyhq.com writes: >>>> >>>> > Hi >>&

Re: Usenet vs. Mailing-list

2023-01-28 Thread Ben Bacarisse
"Peter J. Holzer" writes: > On 2023-01-27 21:04:58 +, Ben Bacarisse wrote: >> mutt...@dastardlyhq.com writes: >> >> > Hi >> >> It looks like you posted this question via Usenet. comp.lang.python is >> essentially dead as a Usenet group

Re: evaluation question

2023-01-27 Thread Ben Bacarisse
complex expressions? It handles only expressions, and "for i in range(1,10): i" is not an expression. You can use >>> exec("for i in range(1,10): i") or, to confirm that something is happening: >>> exec("for i in range(1,10): print(i)") 1 2 3 4 5 6 7 8 9 See: https://docs.python.org/3/library/functions.html?highlight=eval#eval and the immediately following entry. -- Ben. -- https://mail.python.org/mailman/listinfo/python-list

Re: bool and int

2023-01-26 Thread Ben Bacarisse
!" or give false for x == 0. Of course these are not random choices, but it shows that Python's design is very far from universal. But then this is not a numbers game, anyway. A programmer need only to have used one or two languages that are rather more strict about types to find such a thing unsurprising in future. -- Ben. -- https://mail.python.org/mailman/listinfo/python-list

Re: Local variable definition in Python list comprehension

2022-09-01 Thread Ben Bacarisse
thwhile to add a new feature like this in Python? If so, how > can I propose this to PEP? To make any sort of case you'd need to give an example that does not have a clearer way to write it already. Your working version is, to me, clearer that the ones you want to be able to write. --

Fwd: timedelta object recursion bug

2022-07-28 Thread Ben Hirsig
Hi, I noticed this when using the requests library in the response.elapsed object (type timedelta). Tested using the standard datetime library alone with the example displayed on https://docs.python.org/3/library/datetime.html#examples-of-usage-timedelta It appears as though the timedelta object

Re: Unexpected behaviour of math.floor, round and int functions (rounding)

2021-11-20 Thread Ben Bacarisse
Grant Edwards writes: > On 2021-11-20, Ben Bacarisse wrote: > >> You seem to be agreeing with me. It's the floating point part that is >> the issue, not the base itself. > > No, it's the base. Floating point can't represent 3/10 _because_ it's > b

Re: Unexpected behaviour of math.floor, round and int functions (rounding)

2021-11-20 Thread Ben Bacarisse
Chris Angelico writes: > On Sat, Nov 20, 2021 at 3:41 PM Ben Bacarisse wrote: >> >> Chris Angelico writes: >> >> > On Sat, Nov 20, 2021 at 12:43 PM Ben Bacarisse >> > wrote: >> >> >> >> Chris Angelico writes: >> >

Re: Unexpected behaviour of math.floor, round and int functions (rounding)

2021-11-19 Thread Ben Bacarisse
Chris Angelico writes: > On Sat, Nov 20, 2021 at 12:43 PM Ben Bacarisse wrote: >> >> Chris Angelico writes: >> >> > On Sat, Nov 20, 2021 at 9:07 AM Ben Bacarisse wrote: >> >> >> >> Chris Angelico writes: >> >> >> >&g

Re: Unexpected behaviour of math.floor, round and int functions (rounding)

2021-11-19 Thread Ben Bacarisse
Chris Angelico writes: > On Sat, Nov 20, 2021 at 9:07 AM Ben Bacarisse wrote: >> >> Chris Angelico writes: >> >> > On Sat, Nov 20, 2021 at 5:08 AM ast wrote: >> >> >> >>> 0.3 + 0.3 + 0.3 == 0.9 >> >> False >> > >

Re: Unexpected behaviour of math.floor, round and int functions (rounding)

2021-11-19 Thread Ben Bacarisse
asked for. Every 0.3 could come with a warning that 0.3 can not be represented exactly as a floating point value. To avoid the warning, the programmer would write ~0.3 meaning, exactly, the binary (or whatever the base really is) floating point number closest to 0.3. -- Ben. -- https://mail.python.org/mailman/listinfo/python-list

Re: Help with gaussian filter from scipy

2021-07-07 Thread Ben Bacarisse
Arak Rachael writes: > On Wednesday, 7 July 2021 at 12:47:40 UTC+2, Arak Rachael wrote: >> On Wednesday, 7 July 2021 at 12:41:44 UTC+2, Ben Bacarisse wrote: >> > Arak Rachael writes: >> > >> > > this time I am stuck on gaussian_filter scipy returns none

Re: Help with gaussian filter from scipy

2021-07-07 Thread Ben Bacarisse
ink to the code itself so people can look at it without having to load up a project. -- Ben. -- https://mail.python.org/mailman/listinfo/python-list

Re: neonumeric - C++ arbitrary precision arithmetic library

2021-03-06 Thread Ben Bacarisse
ems that stumped others, nothing but what appears to be a false claim about neos can do. If you want this project to be taken seriously, you are going about it the wrong way. -- Ben. -- https://mail.python.org/mailman/listinfo/python-list

Re: New Python implementation

2021-02-16 Thread Ben Bacarisse
n't think there is anything to see here. If the author had come up with some new ways to tackle any of the problems, he would be telling people about these, not saying "be patient" (and bad-mouthing CPython). -- Ben. -- https://mail.python.org/mailman/listinfo/python-list

Re: Mr. Flibble

2021-02-15 Thread Ben Bacarisse
Ethan Furman writes: > On 2/15/21 2:02 PM, Grant Edwards wrote: >> On 2021-02-15, Ben Bacarisse wrote: >> >>> You said you used Usenet (and your reply here was via Usenet). >>> Usenet posts to comp.lang.python don't go to the mailing list (the >>>

Re: Mr. Flibble

2021-02-15 Thread Ben Bacarisse
you used Usenet (and your reply here was via Usenet). Usenet posts to comp.lang.python don't go to the mailing list (the "here" that Ethan is talking about). Mails to the list /are/ sent here, but it's one-way traffic. -- Ben. -- https://mail.python.org/mailman/listinfo/python-list

Re: sqlite3 cannot detect the version of compiled sqlite version at some point in runtime.

2021-01-20 Thread Ben Bacarisse
.3. > > Is there any advice on this issue? thanks. Sorry, no, but I can add a data point. It works for me on my Ubuntu system with these versions: $ python3 Python 3.8.5 (default, Jul 28 2020, 12:59:40) [GCC 9.3.0] on linux Type "help", "copyright", "credits&qu

Re: Find word by given characters

2020-11-03 Thread Ben Bacarisse
u could even make a single pattern like this: (?=.*t.*t)(?=.*a) While there are probably better ways in Python, this is what I'd do on the command line. For example $ grep -P '(?=.*t.*t)(?=.*a)' word-list | wc -l 45677 $ grep 't.*t' word-list | grep a | wc -l 45677 -- Ben. -- https://mail.python.org/mailman/listinfo/python-list

Re: musings on static variables

2020-09-16 Thread Ben Bacarisse
gt; > transcript > > 0 > 1 > 2 def f(i = [0]): i[0] += 1 return i[0] print(f()) print(f()) print(f()) maybe? More than a bit yucky, though. -- Ben. -- https://mail.python.org/mailman/listinfo/python-list

Re: Didn't understand the output of the following Python 3 code with reduce function?

2020-08-28 Thread Ben Bacarisse
t(add) > > output: 9 Hint: reduce(f, [e1, e2]) is f(e1, e2) reduce(f, [e1, e2, e3]) is f(f(e1, e2), e3) reduce(f, [e1, e2, e3, e4]) is f(f(f(e1, e2), e3), e4) Replace f with a function that adds one to its first argument. Does that help? -- Ben. -- https://mail.python.org/mailman/listinfo/python-list

Re: Behaviour of os.path.join

2020-05-27 Thread Ben Bacarisse
Roel Schroeven writes: > Ben Bacarisse schreef op 27/05/2020 om 17:53: >> There is well-known (*nix) software that relies on a/b/c/ meaning >> something different to a/b/c but I don't know anyone who thinks this is >> a good idea. It causes no end of confusion. > &

Re: Behaviour of os.path.join

2020-05-27 Thread Ben Bacarisse
BlindAnagram writes: > On 27/05/2020 16:53, Ben Bacarisse wrote: >> As it should. Relying on a trailing \ having the right effect is >> brittle to say the least. > > In my case less brittle than leaving it out. Brittle does not mean broken. I know you can fix it by mak

Re: Behaviour of os.path.join

2020-05-27 Thread Ben Bacarisse
BlindAnagram writes: > On 27/05/2020 13:30, Ben Bacarisse wrote: >> BlindAnagram writes: >> >>> The issue that I raised here was whether the behaviour of os.path.join() >>> in treating the Windows directory separator '\\' as an absolute path >>

Re: Behaviour of os.path.join

2020-05-27 Thread Ben Bacarisse
. If c:\x\y is a file, calling it c:\x\y\ won't change that, but it might give you an error when you try to access it. That may be what you want. If so, appending '.' is likely to be more portable. -- Ben. -- https://mail.python.org/mailman/listinfo/python-list

Re: Behaviour of os.path.join

2020-05-26 Thread Ben Bacarisse
;t know your intent is far as defaults go.) > The documentation says that an absolute path in the parameter list for > join will discard all previous parameters but '\\' is not an absoute > path! I think it is. The picture is messy on Windows (because of the drive letter) but

Fwd: installed but doesn't boot

2020-05-23 Thread Ben Hansen
-- Forwarded message - From: Ben Hansen Date: Sat, May 23, 2020 at 11:44 AM Subject: Fwd: installed but doesn't boot To: -- Forwarded message - From: Ben Hansen Date: Fri, May 22, 2020 at 3:18 PM Subject: installed but doesn't boot To: I have

Re: ÿ in Unicode

2020-03-07 Thread Ben Bacarisse
uage will > start to work properly. >>> "ÿ".encode('iso-8859-1') b'\xff' -- Ben. -- https://mail.python.org/mailman/listinfo/python-list

Re: ÿ in Unicode

2020-03-06 Thread Ben Bacarisse
moi writes: > 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') >&g

Re: ÿ in Unicode

2020-03-06 Thread Ben Bacarisse
moi writes: > 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') >> >

Re: ÿ in Unicode

2020-03-06 Thread Ben Bacarisse
moi writes: > 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') >> >

Re: ÿ in Unicode

2020-03-05 Thread Ben Bacarisse
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 lo

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

2019-12-22 Thread Ben Hearn
On Saturday, 21 December 2019 21:46:43 UTC, Ben Hearn wrote: > Hello all, > > I am having a bit of trouble with a string mismatch operation in my tool I am > writing. > > I am comparing a database collection or url quoted paths to the paths on the > users drive. &g

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

2019-12-21 Thread Ben Hearn
J.Staaf - ¡Móchate! _PromoMix_.wav ? ^ What am I missing when it comes to unquoting the string, or should I do some other fancy operation on the drive string? Cheers, Ben -- https://mail.python.org/mailman/listinfo/python-list

Re: Extract all words between two keywords in .txt file (Python)

2019-12-12 Thread Ben Bacarisse
A S writes: > On Thursday, 12 December 2019 02:28:09 UTC+8, Ben Bacarisse wrote: >> A S writes: >> >> > I would like to extract all words within specific keywords in a .txt >> > file. For the keywords, there is a starting keyword of "PROC SQL;" (I

Re: Extract all words between two keywords in .txt file (Python)

2019-12-11 Thread Ben Bacarisse
OC SQL;', '')] Your main issue is that | binds weakly. Your whole pattern tries to match any one of just four short sub-patterns: PROC SQL; proc sql;(.*?)RUN; quit; QUIT; -- Ben. -- https://mail.python.org/mailman/listinfo/python-list

Re: How to convert the following IDL program lines to equivalent Python program lines?

2019-11-28 Thread Ben Bacarisse
is duplicated in IDL? If the second one were not there, this: JMP: IF WK(L-1,K-1) EQ 0 THEN BEGIN L=L+1 GOTO, JMP ENDIF would just be a while loop: while WK[L-1,K-1] == 0: L=L+1 By the way, all those -1s suggest that the IDL was itself a translation from a language with 1-based array indexing. All that might be able to be tidied up. -- Ben. -- https://mail.python.org/mailman/listinfo/python-list

Re: join and split with empty delimiter

2019-07-18 Thread Ben Bacarisse
Danilo Coccia writes: > Il 18/07/2019 12:27, Ben Bacarisse ha scritto: >> Irv Kalb writes: >> >>> I have always thought that split and join are opposite functions. For >>> example, you can use a comma as a delimiter: >>> >>>>>> m

Re: join and split with empty delimiter

2019-07-18 Thread Ben Bacarisse
, 'b', 'c', 'd'] > > But my question is: Is there any good reason why the split function > should give an "empty separator" error? I think the meaning of trying > to split a string into a list using the empty string as a delimiter is > unambi

Re: How Do You Replace Variables With Their Values?

2019-07-11 Thread Ben Finney
'Banana Split'] The above code produces this output, without any need for binding new names. So what is it you are actually trying to achieve, and why do you think the new bindings are necessary? -- \“The number of UNIX installations has grown to 10, with more | `\ expected.” —Unix Programmer's Manual, 2nd Ed., 1972-06-12 | _o__) | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: How Do You Replace Variables With Their Values?

2019-07-10 Thread Ben Finney
do you need to also have them bound to separate names; what problem are you trying to solve that you think this will help? -- \ “If [a technology company] has confidence in their future | `\ ability to innovate, the importance they place on protecting | _o__) their pas

Re: repr = expression representation?

2019-05-17 Thread Ben Bacarisse
ry limited way, fudge it like this: def myrepr(e): if isinstance(e, types.BuiltinFunctionType): return e.__name__ return repr(e) The trouble is that print does not always mean print because that identifier can be rebound. Python could try to provide some /other/ name for every object, one that can't be rebound (something like an environment + string lookup) but it's probably not worth it. -- Ben. -- https://mail.python.org/mailman/listinfo/python-list

Re: Instance vs Class variable oddity

2019-05-15 Thread Ben Finney
;s no music, no | `\ choreography, and the dancers hit each other.” —Jack Handey | _o__) | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: convert .py to Android ?

2019-05-14 Thread Ben Finney
imity | `\of the graveyard.” —Justice Roberts in 319 U.S. 624 (1943) | _o__) | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: Testing the data type of a value

2019-05-12 Thread Ben Bacarisse
uot;: > print("Integer") > > Why isn't this working? Advance thanks for your time. See if this helps... >>> type(5) >>> type(type(5)) >>> type("") so you are comparing two things with different types. An analogous situation w

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

2019-05-11 Thread Ben Bacarisse
you need to know at least one actual age, rather than just the age gaps. Maybe the exercise is to write a function that takes the age of, say, the youngest child and then calculates the inheritances? Anyway, your starting point will be to work through an example on paper so you are clear abo

Re: Is this a "gotcha" in Python?

2019-04-20 Thread Ben Bacarisse
d, of course, be loads of /other/ things that would be potential "gotcha"s.) -- Ben. -- https://mail.python.org/mailman/listinfo/python-list

Re: Function to determine list max without itertools

2019-04-19 Thread Ben Bacarisse
r? > PS Since I am going through the list fully the only optimisation I can > think of a generator to feed it seems sort of redundant. Unless of > course it was a list of 10,000 numbers then maybe its useful. I'm not sure what was meant here. I can think of one micro-optimisation but I'd want to test to see if really makes and difference. -- Ben. -- https://mail.python.org/mailman/listinfo/python-list

Re: Design a function that finds all positive numbers

2019-04-09 Thread Ben Bacarisse
r...@zedat.fu-berlin.de (Stefan Ram) writes: > Ben Bacarisse writes: >>Ranjith Bantu writes: >>>can I solve any problems like this by learning python? >>You need to learn how to solve problems as well as learning Python -- > > I do not separate "solv

Re: Design a function that finds all positive numbers

2019-04-09 Thread Ben Bacarisse
s what to do with duplicates. The question should be worded so that it's either clear what is wanted, or so that it is clear that you should decide what to do. -- Ben. -- https://mail.python.org/mailman/listinfo/python-list

Re: Logging cf Reporting = Friday Filosofical Finking

2019-04-05 Thread Ben Coleman
wants changes what he wants. Ben -- Ben Coleman olo...@benshome.net | For the wise man, doing right trumps http://oloryn.benshome.net/ | looking right. For the fool, looking Amateur Radio NJ8J | right trumps doing right. signature.asc Description: OpenPGP digita

Re: formatted docstrings

2019-04-03 Thread Ben Finney
x27;s going to change depending on the environment). -- \ “Courage is not the absence of fear, but the decision that | `\ something else is more important than fear.” —Ambrose Redmoon | _o__) | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: Syntax for one-line "nonymous" functions in "declaration style"

2019-03-27 Thread Ben Finney
ssed before? Too many times to count :-) -- \ “Theology is the effort to explain the unknowable in terms of | `\ the not worth knowing.” —Henry L. Mencken | _o__) | Ben Finney -- https://mail.p

Re: configparser - which one?

2019-03-27 Thread Ben Finney
`\ approaches zero. All non-Free software is a dead end.” —Mark | _o__) Pilgrim, 2006 | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: Your IDE's?

2019-03-27 Thread Ben Finney
is not ignorance but the illusion of | _o__)knowledge.” —Daniel J. Boorstin, historian, 1914–2004 | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: Your IDE's?

2019-03-25 Thread Ben Finney
ex tasks we expect of a programmer's editor like Vim or GNU Emacs. -- \“The reason we come up with new versions is not to fix bugs. | `\ It's absolutely not.” —Bill Gates, 1995-10-23 | _o__)

Re: Reasoning of calling a method on class object instead of class instance object

2019-03-18 Thread Ben Finney
Arup Rakshit writes: Michael Torrie writes: > On 03/18/2019 05:55 PM, Ben Finney wrote: > >> If I call `_c_to_f`, `_f_to_c` methods on `self` instead of > >> `RefrigeratedShippingContainer` class object, still it works. > > > > That's right, and is inde

Re: Reasoning of calling a method on class object instead of class instance object

2019-03-18 Thread Ben Finney
sier when the RefrigeratedShippingContainer encapsulates the conversions of temperature units. -- \ “When we pray to God we must be seeking nothing — nothing.” | `\—Francis of Assisi | _o__)

Re: Not a python question, just programming logic trap?

2019-03-13 Thread Ben Finney
ne by children. | `\ They had all the paintings up on refrigerators.” —Steven Wright | _o__) | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: Totally Legit Signing Key?

2019-03-04 Thread Ben Finney
ovenance of the key that made the signature. -- \“Human reason is snatching everything to itself, leaving | `\ nothing for faith.” —Bernard of Clairvaux, 1090–1153 CE | _o__) | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: Two Tier Cloud Network

2019-02-25 Thread Ben Finney
is to the | _o__) culinary arts.” —Michael Bacarella | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: Feature suggestions: "Using declarations" i.e. context managers ("with" blocks) tied to scope/lifetime of the variable rather than to nesting

2019-02-19 Thread Ben Finney
purpose:: with foo.open() as logfile: frobnicate_the_whelk(logfile=logfile) -- \ “I don't want to live peacefully with difficult realities, and | `\ I see no virtue in savoring excuses for avoiding a search for | _o__) real answers.” —Pau

Re: Multiprocessing performance question

2019-02-18 Thread Ben Finney
e you tried using that library and timing the result? -- \ “You don't need a book of any description to help you have some | `\kind of moral awareness.” —Dr. Francesca Stavrakoloulou, bible | _o__) scholar, 2011-05-08 | Ben Finney -- http

Re: What's the address for?

2019-02-18 Thread Ben Finney
t containers, and thinking of them that way will frequently lead you to the wrong conclusion. https://nedbatchelder.com/text/names1.html> -- \ “Theology is the effort to explain the unknowable in terms of | `\ the not worth knowing.” —Henry L. Mencken | _o__)

Re: The NaNny State

2019-02-18 Thread Ben Finney
n't know what it | `\is. Every once in a while I'll be listening to the radio and I | _o__)say, ‘I think I might have written that.’” —Steven Wright | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: New rules for scope in a function?

2019-02-18 Thread Ben Bacarisse
quot; + x + " y = "+ y) f(x) print("x = " + x) The material I cut did include the explanation so go back and read the message you replied to here if you don't follow. -- Ben. -- https://mail.python.org/mailman/listinfo/python-list

Re: Problem : Generator

2019-02-14 Thread Ben Finney
to information. They are the tool of choice for the internet | _o__) highwayman.” —Anthony Taylor | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: Can't run setup.py offline due to setup_requires - setup.py calls home

2019-02-11 Thread Ben Finney
eve that they own culture, they are so | _o__) self-righteous about it …” —Nina Paley, 2011 | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: The sum of ten numbers inserted from the user

2019-02-07 Thread Ben Bacarisse
Grant Edwards writes: > On 2019-02-07, Ben Bacarisse wrote: >> Ian Clark writes: >> >>> This is my whack at it, I can't wait to hear about it being the wrong big o >>> notation! >>> >>> numbers=[] >>> >>> while len

Re: The sum of ten numbers inserted from the user

2019-02-07 Thread Ben Bacarisse
Bart writes: > On 07/02/2019 20:45, Ben Bacarisse wrote: >> Ian Clark writes: >> >>> This is my whack at it, I can't wait to hear about it being the wrong big o >>> notation! >>> >>> numbers=[] >>> >>> while len(numbers)

Re: The sum of ten numbers inserted from the user

2019-02-07 Thread Ben Bacarisse
; print('that is not a number, try again') > else: > numbers.append(chip) > > print(sum(numbers)) Why would you not keep a running total, rather than list of the numbers? I've not been following assiduously, so maybe I missed some other requirement... -- Ben. -- https://mail.python.org/mailman/listinfo/python-list

Re: Loop with else clause

2019-02-05 Thread Ben Finney
assumes some other code has decided which items to handle; it becomes correspondingly simpler. -- \ “Two possibilities exist: Either we are alone in the Universe | `\ or we are not. Both are equally terrifying.” —Arthur C. Clarke, | _o__)

Re: Bringing Order to programming

2019-01-31 Thread Ben Bacarisse
> transcript > > a 0.0680 s, a 1.2040 s, a 9.5823 s, a 81.9688 s, My times are very nearly linear: a 0.0280 s, a 0.2931 s, a 2.9006 s, a 29.4318 s, -- Ben. -- https://mail.python.org/mailman/listinfo/python-list

Re: the python name

2019-01-02 Thread Ben Oliver
On 18-12-31 22:39:04, pritanshsahs...@gmail.com wrote: why did you kept this name? i want to know the history behind this and the name of this snake python. It's named after Monty Python [0]. [0] https://docs.python.org/3/tutorial/appetite.html signature.asc Description: PGP signature -- ht

Re: graded randomness

2018-12-28 Thread Ben Bacarisse
obabilities? >>> import random >>> random.choice(["green", "green", "red", "red", "blue"]) Not a method that scales particularly well, but there's almost no context to evaluate solutions. -- Ben. -- https://mail.python.org/mailman/listinfo/python-list

Re: random choice from dictionary

2018-12-23 Thread Ben Bacarisse
items -= 1 return keys And there is a variation on /that/ will use fewer random numbers -- essentially picking a number of "skip" distances as you pick one. But it's late, and I need to get ready to eat lots... -- Ben. -- https://mail.python.org/mailman/listinfo/python-list

Re: When to Use Django & Flask frame work

2018-12-12 Thread Ben Finney
without needing to diverge from the default. -- \ “If I ever get real rich, I hope I'm not real mean to poor | `\ people, like I am now.” —Jack Handey | _o__) | Ben Finney -- https://

Re: Help - Python REST API

2018-12-12 Thread Ben Finney
. They can only give you answers.” —Pablo | `\ Picasso | _o__) | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: setup.py and licensing questions

2018-12-12 Thread Ben Finney
license is a statement, preferably brief, that says exactly what the work is, who holds copyright, who receives a grant of license, and what that grants the recipient to do, under what explicit conditions. For example: Copyright © 2018 Ben Finney Purple Drachma is free software: you a

Re: multiple JSON documents in one file, change proposal

2018-12-01 Thread Ben Bacarisse
estream or in > a single file. That means the HTTP content-length would be mandatory. I haven't been following the details of the thread, but I wonder if a multi-part form-data POST would be useful. Way more complex than a simple separator, of course, but more "standard" (for some rather vague meaning of the term). -- Ben. -- https://mail.python.org/mailman/listinfo/python-list

Re: question on the 'calendar' function

2018-11-20 Thread Ben Finney
o1bigtenor writes: > On Tue, Nov 20, 2018 at 12:09 PM Ben Finney > wrote: > > o1bigtenor writes: > > > It could be useful to see the longer time spans as weeks rather > > > than as days but seeing the larger time frames only as months > > > woul

Re: question on the 'calendar' function

2018-11-20 Thread Ben Finney
ied with the | `\best.” —Oscar Wilde, quoted in _Chicago Brothers of the Book_, | _o__) 1917 | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: [Tutor] SyntaxError: can't assign to literal while using ""blkid -o export %s | grep 'TYPE' | cut -d"=" -f3" % (fs)" using subprocess module in Python

2018-11-07 Thread Ben Bacarisse
ort | grep TYPE | cut -d= -f2" Note that "TYPE" and "=" don't really need to be quoted at all. Someone suggested sed, and that too can be used like this: blkid %s -o export | sed -ne '/TYPE=/s///p' -- Ben. -- https://mail.python.org/mailman/listinfo/python-list

Re: PEP 394

2018-10-19 Thread Ben Finney
ing 60 MPH.” | _o__) —Steven Wright | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: snakify issues

2018-10-13 Thread Ben Bacarisse
ot of incorrect terminology. But the material itself is so dull -- numbers, arithmetic, more numbers, factorials, more arithmetic, numbers... And when a string exercise came up (capitalise a word) the hint was to use ord and chr. -- Ben. -- https://mail.python.org/mailman/listinfo/python-list

Re: ESR "Waning of Python" post

2018-10-11 Thread Ben Finney
received and am still receiving” —Albert Einstein | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: Python indentation (3 spaces)

2018-10-08 Thread Ben Finney
“I find the whole business of religion profoundly interesting. | `\ But it does mystify me that otherwise intelligent people take | _o__) it seriously.” —Douglas Adams | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Python indentation (correct behaviour) (was: Python indentation (3 spaces))

2018-10-08 Thread Ben Finney
its speaker a raving lunatic.” —Dresden James | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: This thread is closed [an actual new thread]

2018-10-02 Thread Ben Finney
Ethan Furman writes: > On 10/01/2018 04:26 PM, Ben Finney wrote: > > If there is some specific formal meaning to the above statement, I > > don't know where it's documented. If it's not a specific formal > > statement, that is itself troubling, because it

This thread is closed (was: [OT] master/slave debate in Python)

2018-10-01 Thread Ben Finney
which prompted this instance. -- \ “Truth would quickly cease to become stranger than fiction, | `\ once we got as used to it.” —Henry L. Mencken | _o__) | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: What's an elegant way to test for list index existing?

2018-09-29 Thread Ben Finney
Ben Finney writes: > You can use a comprehension, iterating over the full range of index you > want:: > > words = shlex.split(line) > padding_length = 5 > words_padded = [ > (words[index] if index < len(words)) > for index in range(paddi

Re: What's an elegant way to test for list index existing?

2018-09-28 Thread Ben Finney
whatever optimisations the in-built comprehension mechanics provide. -- \ “Pray, v. To ask that the laws of the universe be annulled in | `\ behalf of a single petitioner confessedly unworthy.” —Ambrose | _o__) Bierce, _The Devil's Dictionary_, 1906 | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: Which class method is being called when we declare below expression?

2018-09-28 Thread Ben Finney
Ben Finney writes: > Ajay Patel writes: > > > L = [1,2,3] > > That's not an expression; it is an assignment statement. > > The right-hand side is an expression. […] in this case, [the object] a new > instance of 'list' […] is the result of evaluating t

Re: Which class method is being called when we declare below expression?

2018-09-27 Thread Ben Finney
hat object. > And > L =[] All the above description also applies to that assignment statement. -- \“If you go parachuting, and your parachute doesn't open, and | `\you friends are all watching you fall, I think a funny gag | _o__) would be to

Re: Enum with nested classes or with types as members

2018-09-12 Thread Ben Finney
ferences.” —David Weinberger | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: Writing bytes to stdout reverses the bytes

2018-08-19 Thread Ben Bacarisse
e might think that dumping out bytes in the correct order ought to > be the default format for hexdump. It is if you run it as hd. -- Ben. -- https://mail.python.org/mailman/listinfo/python-list

Re: How to pass Python command line options (vs arguments) when running script directly vs via Python interpreter?

2018-08-15 Thread Ben Finney
Pilgrim, 2006 | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Good reason not to obfuscate URLs (was: Fishing from PyPI ?)

2018-08-06 Thread Ben Finney
son & Sussman, | _o__) _Structure and Interpretation of Computer Programs_ | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: How to start gnuradio

2018-07-31 Thread Ben Finney
believe in it.” —Neil deGrasse Tyson, 2011-02-04 | _o__) | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

  1   2   3   4   5   6   7   8   9   10   >