Re: TypeError: can only concatenate str (not "int") to str

2023-02-26 Thread Larry Martell
On Sun, Feb 26, 2023 at 5:46 PM Chris Angelico wrote: > On Mon, 27 Feb 2023 at 12:44, MRAB wrote: > > Oh dear. An example of Godwin's Law. > > Yeah, is that finally enough to get this user banned ? I hope so > -- https://mail.python.org/mailman/listinfo/python-list

Re: comparing two lists

2021-02-24 Thread Larry Martell
On Wed, Feb 24, 2021 at 4:45 PM Davor Levicki wrote: > > i have two lists > > list1 = ['01:15', 'abc', '01:15', 'def', '01:45', 'ghi' ] > list2 = ['01:15', 'abc', '01:15', 'uvz', '01:45', 'ghi' ] > > and when I loop through the list > > > list_difference = [] > for item in list1: > > if item no

Re: yield from () Was: Re: weirdness with list()

2021-03-02 Thread Larry Martell
On Tue, Mar 2, 2021 at 2:16 PM Chris Angelico wrote: > > On Tue, Mar 2, 2021 at 5:51 AM Alan Gauld via Python-list > wrote: > > > > On 28/02/2021 00:17, Cameron Simpson wrote: > > > > > BUT... It also has a __iter__ value, which like any Box iterates over > > > the subboxes. For MDAT that is impl

Best practices regarding PYTHONPATH

2021-03-09 Thread Larry Martell
Which is considered better? Having a long import path or setting PYTHONPATH? For example, in a project where 50% of the imports come from the same top level directory is it better to add that dir to the path or reference it in the import statements? -- https://mail.python.org/mailman/listinfo/pyt

creating raw AWS log event

2021-06-23 Thread Larry Martell
When an AWS cloudwatch event is passed to a consumer it looks like this: { "awslogs": { "data": "ewogICAgIm1l..." } } To get the actual message I do this: def _decode(data): compressed_payload = b64decode(data) json_payload = zlib.decompress(compressed_payload, 16+zlib.

Re: creating raw AWS log event

2021-06-23 Thread Larry Martell
On Wed, Jun 23, 2021 at 7:05 PM Dennis Lee Bieber wrote: > > On Wed, 23 Jun 2021 10:42:42 -0700, Larry Martell > declaimed the following: > > >def _decode(data): > >compressed_payload = b64decode(data) > >json_payload = zlib.decompress(compressed_payload, 16

Re: creating raw AWS log event

2021-06-24 Thread Larry Martell
On Thu, Jun 24, 2021 at 12:20 AM Peter Otten <__pete...@web.de> wrote: > > On 23/06/2021 19:42, Larry Martell wrote: > > When an AWS cloudwatch event is passed to a consumer it looks like this: > > > > { > > "awslogs": { > > "

Re: creating raw AWS log event

2021-06-24 Thread Larry Martell
On Thu, Jun 24, 2021 at 10:38 AM Larry Martell wrote: > > On Thu, Jun 24, 2021 at 12:20 AM Peter Otten <__pete...@web.de> wrote: > > > > On 23/06/2021 19:42, Larry Martell wrote: > > > When an AWS cloudwatch event is passed to a consumer it looks like this:

Re: Is there a conference in the US that is similar to EuroPython?

2021-07-19 Thread Larry Martell
On Mon, Jul 19, 2021 at 10:01 AM Schachner, Joseph wrote: > > I am not going to fly to Europe for a Python conference. But, would consider > going if in the U.S.A. Especially if drivable ... NYC area would be ideal. > > I ask because I have seen ads for EuroPython over several years, and I don

SQLALchemy: update with in clause from kwargs

2021-08-03 Thread Larry Martell
I am trying to write a function that takes kwargs as a param and generates an update statement where the rows to be updated are specified in an in clause. Something like this: def update_by_in(self, **kwargs): filter_group = [] for col in kwargs['query_params']: #

Re: SQLALchemy: update with in clause from kwargs

2021-08-04 Thread Larry Martell
On Tue, Aug 3, 2021 at 7:26 PM dn via Python-list wrote: > > On 04/08/2021 13.08, Larry Martell wrote: > > I am trying to write a function that takes kwargs as a param and > > generates an update statement where the rows to be updated are > > specified in an in clause. >

python problem

2021-12-08 Thread Larry Warner
I am new at Python. I have installed Python 3.10.1 and the latest Pycharm. When I attempt to execute anything via Pycharm or the command line, I receive a message it can not find Python. I do not know where Python was loaded or where to find and to update PATH to the program. Larry -- https

problem reading a CSV file

2021-12-13 Thread Larry Warner
Win 10, Chrome, Python 3.10.1 New at python error on open statement Probably simple error but I do not see it. The program is a python example with the file name being changed. I want to experiment with changing the literal file name in the open statement to a variable name later. Larry

All permutations from 2 lists

2022-03-01 Thread Larry Martell
If I have 2 lists, e.g.: os = ["Linux","Windows"] region = ["us-east-1", "us-east-2"] How can I get a list of tuples with all possible permutations? So for this example I'd want: [("Linux", "us-east-1"), ("Linux", "us-east-2"), ("Windows", "us-east-1"), "Windows", "us-east-2')] The lists can b

Re: All permutations from 2 lists

2022-03-02 Thread Larry Martell
On Tue, Mar 1, 2022 at 7:21 PM <2qdxy4rzwzuui...@potatochowder.com> wrote: > > On 2022-03-01 at 19:12:10 -0500, > Larry Martell wrote: > > > If I have 2 lists, e.g.: > > > > os = ["Linux","Windows"] > > region = ["us-east-1"

Re: All permutations from 2 lists

2022-03-02 Thread Larry Martell
le, I'm not sure of the > correct technical term). > If you only want to use the result once you can write e.g. > > for ops, reg in itertools.product(opsys, region): > etc. > > If you need it more than once, you can convert it to a list (or tuple), > as above. > Best

Re: All permutations from 2 lists

2022-03-02 Thread Larry Martell
On Wed, Mar 2, 2022 at 8:37 AM Antoon Pardon wrote: > > > Op 2/03/2022 om 14:27 schreef Larry Martell: > > On Tue, Mar 1, 2022 at 7:21 PM<2qdxy4rzwzuui...@potatochowder.com> wrote: > >> On 2022-03-01 at 19:12:10 -0500, > >> Larry Martell wrote: > >&g

Re: All permutations from 2 lists

2022-03-02 Thread Larry Martell
On Wed, Mar 2, 2022 at 8:54 AM Joel Goldstick wrote: > > On Wed, Mar 2, 2022 at 8:46 AM Larry Martell wrote: > > > > On Wed, Mar 2, 2022 at 8:37 AM Antoon Pardon wrote: > > > > > > > > > Op 2/03/2022 om 14:27 schreef Larry Martell: > &g

Re: All permutations from 2 lists

2022-03-02 Thread Larry Martell
On Wed, Mar 2, 2022 at 9:10 AM Antoon Pardon wrote: > > Op 2/03/2022 om 14:44 schreef Larry Martell: > > On Wed, Mar 2, 2022 at 8:37 AM Antoon Pardon wrote: > >> > >> Op 2/03/2022 om 14:27 schreef Larry Martell: > >>> On Tue, Mar 1, 2022 at

Re: All permutations from 2 lists

2022-03-02 Thread Larry Martell
On Wed, Mar 2, 2022 at 9:37 AM Antoon Pardon wrote: > > > > Op 2/03/2022 om 15:29 schreef Larry Martell: > > On Wed, Mar 2, 2022 at 9:10 AM Antoon Pardon wrote: > >> Op 2/03/2022 om 14:44 schreef Larry Martell: > >>> On Wed, Mar 2, 2022 at 8:37 AM Antoo

Re: All permutations from 2 lists

2022-03-02 Thread Larry Martell
On Wed, Mar 2, 2022 at 10:26 AM Antoon Pardon wrote: > > > > Op 2/03/2022 om 15:58 schreef Larry Martell: > > On Wed, Mar 2, 2022 at 9:37 AM Antoon Pardon wrote: > >> > >>>>> If one list is empty I want just the other list. What I am doing is >

Re: All permutations from 2 lists

2022-03-02 Thread Larry Martell
On Wed, Mar 2, 2022 at 5:00 PM Cameron Simpson wrote: > > On 02Mar2022 08:29, Larry Martell wrote: > >On Tue, Mar 1, 2022 at 7:32 PM Rob Cliffe wrote: > >> I think itertools.product is what you need. > >> Example program: > >> > >> import iterto

Re: All permutations from 2 lists

2022-03-02 Thread Larry Martell
On Wed, Mar 2, 2022 at 5:31 PM Joel Goldstick wrote: > > On Wed, Mar 2, 2022 at 5:07 PM Larry Martell wrote: > > > > On Wed, Mar 2, 2022 at 5:00 PM Cameron Simpson wrote: > > > > > > On 02Mar2022 08:29, Larry Martell wrote: > > > >On Tue,

Re: All permutations from 2 lists

2022-03-03 Thread Larry Martell
On Wed, Mar 2, 2022 at 9:42 PM Avi Gross via Python-list wrote: > > Larry, > > i waited patiently to see what others will write and perhaps see if you > explain better what you need. You seem to gleefully swat down anything > offered. So I am not tempted to engage. But then

calling a function asynchronously

2022-03-30 Thread Larry Martell
I have a django app, and for a certain request I need to kick off a long running task. I want to do this asynchronously and immediately return a response. I tried using subprocess.Process() but the forked process does not have a django database connection. I then tried posting a request using ajax

Re: calling a function asynchronously

2022-03-30 Thread Larry Martell
I do not get the errors I was getting before but it does not appear that my long running task is running at all. Still debugging. But concerting asyncio - doesn't run_until_complete block until long() completes? > > 30.03.2022 19:10, Larry Martell пишет: > > import asyncio > >

Re: type lookuperror

2016-08-18 Thread Larry Martell
On Thu, Aug 18, 2016 at 10:02 AM, Gene Heskett wrote: > On Thursday 18 August 2016 07:28:06 Chris Angelico wrote: > >> On Thu, Aug 18, 2016 at 7:55 PM, meInvent bbird > wrote: >> > actually i would like to remove try except code in all function >> > >> > and i feel that try except code for a larg

saving octet-stream png file

2016-08-19 Thread Larry Martell
I have some python code (part of a django app) that processes a request that contains a png file. The request is send with content_type = 'application/octet-stream' In the python code I want to write this data to a file and still have it still be a valid png file. The data I get looks like this:

Re: saving octet-stream png file

2016-08-19 Thread Larry Martell
On Fri, Aug 19, 2016 at 1:24 PM, Chris Angelico wrote: > On Sat, Aug 20, 2016 at 3:10 AM, Larry Martell > wrote: >> I have some python code (part of a django app) that processes a >> request that contains a png file. The request is send with >> content_type = 'appli

Re: saving octet-stream png file

2016-08-19 Thread Larry Martell
On Fri, Aug 19, 2016 at 3:00 PM, Larry Martell wrote: > On Fri, Aug 19, 2016 at 1:24 PM, Chris Angelico wrote: >> On Sat, Aug 20, 2016 at 3:10 AM, Larry Martell >> wrote: >>> I have some python code (part of a django app) that processes a >>> request that co

Re: saving octet-stream png file

2016-08-22 Thread Larry Martell
On Sun, Aug 21, 2016 at 5:24 PM, Jon Ribbens wrote: > On 2016-08-19, Larry Martell wrote: >> fd.write(request.POST[key]) > > You could try: > > request.encoding = "iso-8859-1" > fd.write(request.POST[key].encode("iso-8859-1")) > > It'

Re: saving octet-stream png file

2016-08-22 Thread Larry Martell
On Fri, Aug 19, 2016 at 4:24 PM, Chris Kaynor wrote: > On Fri, Aug 19, 2016 at 12:00 PM, Larry Martell > wrote: > >> On Fri, Aug 19, 2016 at 1:24 PM, Chris Angelico wrote: >> > On Sat, Aug 20, 2016 at 3:10 AM, Larry Martell >> wrote: >> >> I have so

Re: saving octet-stream png file

2016-08-22 Thread Larry Martell
On Mon, Aug 22, 2016 at 10:36 AM, Larry Martell wrote: > On Fri, Aug 19, 2016 at 4:24 PM, Chris Kaynor > wrote: >> On Fri, Aug 19, 2016 at 12:00 PM, Larry Martell >> wrote: >> >>> On Fri, Aug 19, 2016 at 1:24 PM, Chris Angelico wrote: >>> > O

Re: saving octet-stream png file

2016-08-22 Thread Larry Martell
On Fri, Aug 19, 2016 at 4:51 PM, Lawrence D’Oliveiro wrote: > On Saturday, August 20, 2016 at 6:03:53 AM UTC+12, Terry Reedy wrote: >> >> An 'octet' is a byte of 8 bits. > > Is there any other size of byte? Many, many years ago, probably c. 1982 my Dad came into my house and saw a Byte Magazine l

Re: DED processing

2016-08-22 Thread Larry Martell
On Mon, Aug 22, 2016 at 1:52 PM, Gary Sublett wrote: > I have to go out for a while, so for DED processing two options from > my end: > > 1. Process as you all have been in the past for now. If you all do > this, the records that have not been mailed prior to the latest list > are contained in a

Re: saving octet-stream png file

2016-08-22 Thread Larry Martell
On Mon, Aug 22, 2016 at 1:25 PM, Jon Ribbens wrote: > On 2016-08-22, Larry Martell wrote: >> On Sun, Aug 21, 2016 at 5:24 PM, Jon Ribbens >> wrote: >>> On 2016-08-19, Larry Martell wrote: >>>> fd.write(request.POST[key]) >>> >>> Y

Re: Is duck-typing misnamed?

2016-08-27 Thread Larry Martell
On Fri, Aug 26, 2016 at 7:58 PM, ROGER GRAYDON CHRISTMAN wrote: > "If it walks like a duck, quacks like a duck,... " > > so there is indeed precedence for this so-called 'duck typing' > > > but wouldn't it be more Pythonic to call this 'witch typing'? > > "How do you know she is a witch?" > > "She

Re: while loop

2016-10-11 Thread Larry Martell
On Tue, Oct 11, 2016 at 1:58 PM, wrote: > > n=6 > x=1 > while x<=n: > print "*"*x > x+=1 > while n>=x: > n=n-1 > print "*"* n > > > Only first loop is executing not the second one? Because after the first loop n < x -- https://mail.python.org/mailman/listinfo/python-list

Re: Can somebody tell me what's wrong wrong with my code? I don't understand

2016-11-21 Thread Larry Martell
On Mon, Nov 21, 2016 at 10:10 PM, wrote: > Hi! This is my first post! I'm having trouble understanding my code. I get > "SyntaxError:invalid syntax" on line 49. I'm trying to code a simple > text-based rpg on repl.it. Thank you for reading. > > > > print("Welcome to Gladiator Game! Choose your

dateutil timezone question

2016-12-23 Thread Larry Martell
I have a datetime that looks like this: '2016-11-11T18:10:09-05:00' and when I pass it to dateutil.parser.parse I get back this: datetime.datetime(2016, 11, 11, 18, 10, 9, tzinfo=tzoffset(None, -18000)) And I have other datetimes like this: '2016-04-27T00:00:00', which went passed to dateutil.par

Re: dateutil timezone question

2016-12-23 Thread Larry Martell
On Fri, Dec 23, 2016 at 2:18 PM, Chris Angelico wrote: > On Sat, Dec 24, 2016 at 3:30 AM, Larry Martell > wrote: >> I have a datetime that looks like this: '2016-11-11T18:10:09-05:00' >> and when I pass it to dateutil.parser.parse I get back this: >> >> d

Re: dateutil timezone question

2016-12-23 Thread Larry Martell
On Fri, Dec 23, 2016 at 2:27 PM, Skip Montanaro wrote: >> I need to compare these datetimes, and if I do that I get the dreaded >> "can't compare offset-naive and offset-aware datetimes" error. > > If you're sure the naive datetimes are UTC, this should work: > > import pytz > > dt = pytz.utc.loca

sorting strings numerically while dealing with missing values

2016-12-28 Thread Larry Martell
I have a list containing a list of strings that I want to sort numerically by one of the fields. I am doing this: sorted(rows, key=float(itemgetter(sortby))) Which works fine as long as all the sort keys convert to a float. Problem is that some are blank or None and those throw an exception. How

Re: sorting strings numerically while dealing with missing values

2016-12-29 Thread Larry Martell
On Wed, Dec 28, 2016 at 3:43 PM, Ian Kelly wrote: > On Wed, Dec 28, 2016 at 2:14 PM, Larry Martell > wrote: >> >> I have a list containing a list of strings that I want to sort >> numerically by one of the fields. I am doing this: >> >> sorted(rows, ke

[RELEASED] Python 3.4.6rc1 and Python 3.5.3rc1 are now available

2017-01-02 Thread Larry Hastings
On behalf of the Python development community and the Python 3.4 and Python 3.5 release teams, I'm pleased to announce the availability of Python 3.4.6rc1 and Python 3.5.6rc1. Python 3.4 is now in "security fixes only" mode. This is the final stage of support for Python 3.4. Python 3.4 now

Re: Clickable hyperlinks

2017-01-09 Thread Larry Martell
On Mon, Jan 9, 2017 at 5:33 PM, Deborah Swanson wrote: > Ok, here is the crux of this thread's communication problem. I didn't > ask, or particularly care for all these lectures on the technology of > terminal emulators. I asked how to code Python to make clickable links. > > Since all of you are

[RELEASED] Python 3.4.6 and Python 3.5.3 are now available

2017-01-17 Thread Larry Hastings
On behalf of the Python development community and the Python 3.4 and Python 3.5 release teams, I'm delighted to announce the availability of Python 3.4.6 and Python 3.5.3. Python 3.4 is now in "security fixes only" mode. This is the final stage of support for Python 3.4. Python 3.4 now onl

sorting a list of dicts by a computed field

2017-01-31 Thread Larry Martell
I have a list of dicts and one item of the dict is a date in m/d/Y format. I want to sort by that. I tried this: sorted(data['trends'], key=lambda k: datetime.strptime(k['date_time'],'%m/%d/%Y')) But that fails with: Exception Type: AttributeError at /report/CDSEM/WaferAlignment/ajax/waChart.jso

Re: sorting a list of dicts by a computed field

2017-01-31 Thread Larry Martell
On Tue, Jan 31, 2017 at 3:30 PM, Chris Angelico wrote: > On Wed, Feb 1, 2017 at 7:26 AM, Larry Martell wrote: >> I have a list of dicts and one item of the dict is a date in m/d/Y >> format. I want to sort by that. I tried this: >> >> sorted(data['trends'],

Re: macOS specific - reading calendar information

2018-03-14 Thread Larry Martell
On Wed, Mar 14, 2018 at 4:31 PM, Jan Erik Moström wrote: > I've been trying to find some example of how to read calendar info on macOS > but I haven't found anything ... I'm probably just bad at searching !! > > What I want to do is to read calendar info for a date range. Does anyone > know of an

Re: Thank you Python community!

2018-03-19 Thread Larry Martell
On Mon, Mar 19, 2018 at 12:08 PM, Etienne Robillard wrote: > You guys just made me realize something very obvious. :-) > > I'm in the process right now of watching the excellent documentary named > "Drugs Inc." on Netflix and I'm basically stunned and deeply concerned about > the major opioid epid

Re: [OT] Re: Thank you Python community!

2018-03-20 Thread Larry Martell
decades, so entire industries can keep profiting. Until you > fix the problems in society the demand will not go away and the problems > will stay. > > > Cheers. > > > *) Drug use also correlates with boredom and low amounts of sunlight and an > amount of predisposition.

Multiprocessing on a remote host

2018-03-20 Thread Larry Martell
Is there a way to use the multiprocessing lib to run a job on a remote host? -- https://mail.python.org/mailman/listinfo/python-list

Re: Multiprocessing on a remote host

2018-03-21 Thread Larry Martell
On Tue, Mar 20, 2018 at 11:15 PM, Steven D'Aprano wrote: > On Wed, 21 Mar 2018 02:20:16 +0000, Larry Martell wrote: > >> Is there a way to use the multiprocessing lib to run a job on a remote >> host? > > Don't try to re-invent the wheel. This is a solved prob

Re: I keep getting this error message when i try to run a program in Python

2018-03-22 Thread Larry Martell
On Thu, Mar 22, 2018 at 2:37 PM, Damjan Stojanovski wrote: > i am sorry but i can not find a way to attach an image here so you can see > what i mean. Please someone tell me how to add an image here. You can't. Copy/paste the error. And please include the post you are replying to. -- https://ma

Re: install MySQL-python failed ....

2018-04-05 Thread Larry Martell
On Thu, Apr 5, 2018 at 7:12 PM, yi zhao wrote: > $ python -m pip install MySQL-python > Collecting MySQL-python > Downloading MySQL-python-1.2.5.zip (108kB) > 100% || 112kB 260kB/s > 930 [main] python2.7 12948 child_info_fork::abort: address space needed

specifying the same argument multiple times with argparse

2018-04-16 Thread Larry Martell
Is there a way using argparse to be able to specify the same argument multiple times and have them all go into the same list? For example, I'd like to do this: script.py -foo bar -foo baz -foo blah and have the dest for foo have ['bar', 'baz', 'blah'] -- https://mail.python.org/mailman/listinfo

Re: specifying the same argument multiple times with argparse

2018-04-16 Thread Larry Martell
On Mon, Apr 16, 2018 at 6:19 PM, Gary Herron wrote: > On 04/16/2018 02:31 PM, larry.mart...@gmail.com wrote: >> >> Is there a way using argparse to be able to specify the same argument >> multiple times and have them all go into the same list? >> >> For example, I'd like to do this: >> >> script.p

Re: Stefan's headers [was:Names and identifiers]

2018-06-08 Thread Larry Martell
On Fri, Jun 8, 2018 at 3:16 PM, Marko Rauhamaa wrote: > At the moment nobody pays > the government to enforce copyrights. No, everyone pays for what the government does. -- https://mail.python.org/mailman/listinfo/python-list

Re: mutable sequences

2018-06-14 Thread Larry Martell
On Wed, Jun 13, 2018 at 10:56 PM, Sharan Basappa wrote: > The term mutable appears quite often in Python. > Can anyone explain what is meant by mutable and immutable sequences. A string and a list go into a bar. The string asks for a cup of coffee. The bartender says "We don't have coffee." The s

Re: Python list vs google group

2018-06-15 Thread Larry Martell
On Fri, Jun 15, 2018 at 12:49 PM T Berger wrote: > On Friday, June 15, 2018 at 12:32:17 PM UTC-4, T Berger wrote: > > On Friday, June 15, 2018 at 11:55:59 AM UTC-4, Chris Angelico wrote: > > > Perhaps quantity is not the important thing here. > > > > It is the important thing. I'm stuck with a pr

Re: Python list vs google group

2018-06-15 Thread Larry Martell
On Fri, Jun 15, 2018 at 1:14 PM Rich Shepard wrote: > On Fri, 15 Jun 2018, T Berger wrote: > > > Please define YMMV, MUA. > >Oh, ... MUA == Mail User Agent. I thought it was Made Up Acronym > > -- https://mail.python.org/mailman/listinfo/python-list

Re: Python list vs google group

2018-06-15 Thread Larry Martell
On Fri, Jun 15, 2018 at 2:08 PM, Rich Shepard wrote: > On Fri, 15 Jun 2018, Larry Martell wrote: > >>>Oh, ... MUA == Mail User Agent. >> >> I thought it was Made Up Acronym > > > Larry, > > Could be; depends on the context. My favor

Re: Python list vs google group

2018-06-15 Thread Larry Martell
On Fri, Jun 15, 2018 at 2:52 PM, Rob Gaddi wrote: > On 06/15/2018 11:44 AM, Larry Martell wrote: >> >> On Fri, Jun 15, 2018 at 2:08 PM, Rich Shepard >> wrote: >>> >>> On Fri, 15 Jun 2018, Larry Martell wrote: >>> >>>>> Oh, ...

Re: Guido van Rossum resigns as Python leader

2018-07-13 Thread Larry Martell
On Fri, Jul 13, 2018 at 2:05 PM, Chris Angelico wrote: > On Sat, Jul 14, 2018 at 3:37 AM, Alexandre Brault > wrote: >> The important question we should ask ourselves: Do we have a replacement >> Dutch person to figure out the one obvious way to do things that may not >> be obvious at first? >> >

Re: Guido van Rossum resigns as Python leader

2018-07-13 Thread Larry Martell
On Fri, Jul 13, 2018 at 2:26 PM, Chris Angelico wrote: > On Sat, Jul 14, 2018 at 4:14 AM, Larry Martell > wrote: >> On Fri, Jul 13, 2018 at 2:05 PM, Chris Angelico wrote: >>> On Sat, Jul 14, 2018 at 3:37 AM, Alexandre Brault >>> wrote: >>>> The impo

Re: OT Why Germany? [was Re: Guido van Rossum resigns as Python leader]

2018-07-14 Thread Larry Martell
On Sat, Jul 14, 2018 at 3:11 AM Steven D'Aprano < steve+comp.lang.pyt...@pearwood.info> wrote: > On Sat, 14 Jul 2018 07:41:43 +, Bob Martin wrote: > > > in 796624 20180714 064331 Gregory Ewing > > wrote: > >>Larry Martell wrote: > >>> A

Re: Unicode [was Re: Cult-like behaviour]

2018-07-16 Thread Larry Martell
On Mon, Jul 16, 2018 at 12:05 PM, Mark Lawrence wrote: > On 16/07/18 15:17, Dan Sommers wrote: >> >> On Mon, 16 Jul 2018 10:39:49 +, Steven D'Aprano wrote: >> >>> ... people who think that if ISO-8859-7 was good enough for Jesus ... >> >> >> It may have been good enough for his disciples, but

doubling the number of tests, but not taking twice as long

2018-07-16 Thread Larry Martell
I had some code that did this: meas_regex = '_M\d+_' meas_re = re.compile(meas_regex) if meas_re.search(filename): stuff1() else: stuff2() I then had to change it to this: if meas_re.search(filename): if 'MeasDisplay' in filename: stuff1a() else: stuff1() else:

Re: doubling the number of tests, but not taking twice as long

2018-07-16 Thread Larry Martell
On Mon, Jul 16, 2018 at 6:01 PM, Gilmeh Serda wrote: > On Mon, 16 Jul 2018 14:17:57 -0400, Larry Martell wrote: > >> This code needs to process many tens of 1000's of files, and it runs >> often, so it needs to run very fast. Needless to say, my change has made >> i

Re: doubling the number of tests, but not taking twice as long

2018-07-18 Thread Larry Martell
On Tue, Jul 17, 2018 at 11:43 AM, Neil Cerutti wrote: > On 2018-07-16, Larry Martell wrote: >> I had some code that did this: >> >> meas_regex = '_M\d+_' >> meas_re = re.compile(meas_regex) >> >> if meas_re.search(filename): >> stuff1()

Re: doubling the number of tests, but not taking twice as long

2018-07-18 Thread Larry Martell
On Wed, Jul 18, 2018 at 7:59 PM, MRAB wrote: > On 2018-07-18 22:40, Larry Martell wrote: >> >> On Tue, Jul 17, 2018 at 11:43 AM, Neil Cerutti wrote: >>> >>> On 2018-07-16, Larry Martell wrote: >>>> >>>> I had some code that did this:

[RELEASED] Python 3.4.9rc1 and Python 3.5.6rc1 are now available

2018-07-19 Thread Larry Hastings
On behalf of the Python development community, I'm pleased to announce the availability of Python 3.4.9rc1 and Python 3.5.6rc1. Both Python 3.4 and 3.5 are in "security fixes only" mode.  Both versions only accept security fixes, not conventional bug fixes, and both releases are source-only.

Want to be a rockstar programmer?

2018-07-23 Thread Larry Martell
https://github.com/dylanbeattie/rockstar -- https://mail.python.org/mailman/listinfo/python-list

[RELEASED] Python 3.4.9 and Python 3.5.6 are now available

2018-08-02 Thread Larry Hastings
On behalf of the Python development community, I'm happy to announce the availability of Python 3.4.9 and Python 3.5.6. Both Python 3.4 and 3.5 are in "security fixes only" mode.  Both versions only accept security fixes, not conventional bug fixes, and both releases are source-only. You

tabs vs. spaces

2018-08-09 Thread Larry Martell
https://www.youtube.com/watch?v=SsoOG6ZeyUI&feature=youtu.be -- https://mail.python.org/mailman/listinfo/python-list

New books by O’Reilly

2018-08-18 Thread Larry Martell
https://imgur.com/gallery/tW1lwEl -- https://mail.python.org/mailman/listinfo/python-list

Re: New books by O’Reilly

2018-08-20 Thread Larry Martell
On Mon, Aug 20, 2018 at 10:06 AM, Abdur-Rahmaan Janhangeer wrote: > some accompanying explanations appreciated with the link. That would ruin the joke. > > yours, > > Abdur-Rahmaan Janhangeer > https://github.com/Abdur-rahmaanJ > Mauritius > > On Sun, 19 Aug 2018,

Re: Module not found

2018-08-27 Thread Larry Martell
On Mon, Aug 27, 2018 at 11:20 AM, Sharan Basappa wrote: > I am running a program that I got as reference from GitHub. > I am running on windows OS. > > Here is a snippet of the code (initial few lines). > > #!/usr/bin/env python > # -*- coding: utf-8 -*- > __author__ = 'Shilin He' > > import sys >

Re: Broken pip

2018-08-28 Thread Larry Martell
On Tue, Aug 28, 2018 at 2:10 PM, Michael F. Stemper wrote: > > I'm trying to upgrade my pip on Ubuntu 16.04. I appear to have > buggered things up pretty well. (Details follow) Any suggestions > on how to undo this and get everything back to proper operation? > > Based on the information that I fo

Re: [OT] master/slave debate in Python

2018-09-26 Thread Larry Martell
On Wed, Sep 26, 2018 at 4:41 AM, Brian Oney via Python-list wrote: > "I have a vewwy great fwiend in Wome called 'Biggus Dickus'" > ... > "Can I go now, sir?" He has a wife, you know. You know what she's called? She's called... 'Incontinentia'. 'Incontinentia Buttocks'. -- https://mail.python.or

Re: Querying MariaDB from python

2018-10-02 Thread Larry Martell
On Tue, Oct 2, 2018 at 11:34 AM Tony van der Hoff wrote: > > I'm writing a database application, in python 3,5 under Debian9. > > My code: > > def get_albums(self, parent_id = 0 ): > cursor = self.cnx.cursor() > sql =( "select" > "id" > ",

Re: Querying MariaDB from python

2018-10-02 Thread Larry Martell
On Tue, Oct 2, 2018 at 12:09 PM Tony van der Hoff wrote: > > On 02/10/18 16:47, Ervin Hegedüs wrote: > > hi, > > > > now rows will looks like this: > > ({'id':...,...},{'id':...,}...) > > Thanks Ervin, but: > >cursor = cnx.cursor(pymysql.cursors.DictCursor) > NameError: name 'pymysql' is not d

Re: Observations on the List - "Be More Kind"

2018-10-10 Thread Larry Martell
On Fri, Oct 5, 2018 at 6:54 AM Bruce Coram wrote: > > I will declare at the outset, I am a lurker. I don't know enough about > Python to give advice that I could 100% guarantee would be helpful. > > There have been two recent threads that summarise for me where the > Python Mailing List has lost

Re: check whether a process is still running on remote hosts

2018-10-16 Thread Larry Martell
On Tue, Oct 16, 2018 at 5:15 PM tina_zy_qian--- via Python-list wrote: > > I newly learned Python, and I need to wrap up a script to do following. > > Env: > 1: One launcher Linux VM (from where to run the Python script) > 2. 100+ Linux VM > > requirement: > In general, run a remote_script on remo

Re: Overwhelmed by the Simplicity of Python. Any Recommendation?

2018-11-04 Thread Larry Martell
On Sun, Nov 4, 2018 at 11:56 AM Mike C wrote: > > Same here. Debugging in Python is annoying, I like to step through my code > line by line, it's impossible to do it with object-oriented programming > language. > > Also, there's no good REPL IDE. > > Spyder barely works with some basic features.

Convert set to list

2016-03-31 Thread Larry Martell
I feel like I've converted sets to lists before. But maybe not. Or maybe I am losing it from having worked 70 hours this week. Shouldn't this work? (Pdb) print block['relative_chart1']['vessel_names'] set([u'Common Carotid', u'External Carotid', u'Internal Carotid']) (Pdb) type(block['relative_ch

Re: Convert set to list

2016-03-31 Thread Larry Martell
On Thursday, March 31, 2016, Ben Finney wrote: > Larry Martell > writes: > > > I feel like I've converted sets to lists before. But maybe not. Or > > maybe I am losing it from having worked 70 hours this week. > > > > Shouldn't this work? > > I

Re: [beginner] What's wrong?

2016-04-03 Thread Larry Martell
On Sun, Apr 3, 2016 at 11:46 AM, Rustom Mody wrote: > Personal note: I once was idiot enough to have root with password root123 I changed my password to "incorrect," so whenever I forget it the computer will say, "Your password is incorrect." -- https://mail.python.org/mailman/listinfo/python-li

Re: Promoting Python

2016-04-06 Thread Larry Martell
On Wed, Apr 6, 2016 at 10:08 AM, Marko Rauhamaa wrote: > BartC : > >> But you're right in that little is actually essential. Basic has shown >> that. >> >> You need expressions, IF, GOTO, variables and assignments, and some >> means of doing I/O. >> >> Pretty much every language has (had) those, a

Re: script exits prematurely with no stderr output, but with system errors

2016-04-07 Thread Larry Martell
On Sun, Mar 20, 2016 at 4:55 PM, Larry Martell wrote: > On Sun, Mar 20, 2016 at 4:47 PM, Joel Goldstick > wrote: >> On Sun, Mar 20, 2016 at 4:32 PM, Larry Martell >> wrote: >> >>> I have a script that I run a lot - at least 10 time every day. Usually >&g

Re: Guido sees the light: PEP 8 updated

2016-04-16 Thread Larry Martell
On Sat, Apr 16, 2016 at 8:32 AM, Stephen Hansen wrote: > On Sat, Apr 16, 2016, at 01:51 AM, Marko Rauhamaa wrote: >> Chris Angelico : >> >> > On Sat, Apr 16, 2016 at 6:06 PM, Marko Rauhamaa wrote: >> >> It doesn't really matter one way or another. The true WTF is that it's >> >> been changed. >>

Re: Guido sees the light: PEP 8 updated

2016-04-16 Thread Larry Martell
On Sat, Apr 16, 2016 at 12:51 PM, Marko Rauhamaa wrote: > Larry Martell : > >> I have worked for many companies where you are required to get a clean >> run of pep8 on your code before your pull request will even be >> considered for approval. I don't agree wi

Re: Guido sees the light: PEP 8 updated

2016-04-16 Thread Larry Martell
On Sat, Apr 16, 2016 at 2:18 PM, BartC wrote: > On 16/04/2016 17:58, Larry Martell wrote: >> >> On Sat, Apr 16, 2016 at 12:51 PM, Marko Rauhamaa wrote: >>> >>> Larry Martell : >>> >>>> I have worked for many companies where you are requir

Re: read datas from sensors and plotting

2016-04-17 Thread Larry Martell
On Sunday, April 17, 2016, ranran wrote: > I'm reading in python some values from some sensors and I write them in a > csv file. > My problem now is to use this datas to plot a realtime graph for a example > in a web server. > Is it possible to read in the same time the values, writing in the fil

Re: Guido sees the light: PEP 8 updated

2016-04-19 Thread Larry Martell
On Tue, Apr 19, 2016 at 11:50 AM, Steven D'Aprano wrote: > On Wed, 20 Apr 2016 12:54 am, Rustom Mody wrote: > > >> I wonder who the joke is on: >> >> | A study comparing Canadian and Chinese students found that the latter >> | were better at complex maths > > Most published studies are wrong. > >

starting docker container messes up terminal settings

2016-05-02 Thread Larry Martell
I am starting a docker container from a subprocess.Popen and it works, but when the script returns, the terminal settings of my shell are messed up. Nothing is echoed and return doesn't cause a newline. I can fix this with 'tset' in the terminal, but I don't want to require that. Has anyone here wo

Re: starting docker container messes up terminal settings

2016-05-02 Thread Larry Martell
On Mon, May 2, 2016 at 10:08 AM, Joaquin Alzola wrote: >>I am starting a docker container from a subprocess.Popen and it works, but >>when the script returns, the terminal settings of my shell are messed up. >>Nothing is echoed and return doesn't cause a >newline. I can fix this with >>'tset' i

Re: You gotta love a 2-line python solution

2016-05-02 Thread Larry Martell
On Mon, May 2, 2016 at 11:15 AM, DFS wrote: > Of course. Taken to its extreme, I could eventually replace you with one > line of code :) That reminds me of something I heard many years ago. Every non-trivial program can be simplified by at least one line of code. Every non trivial program has a

Broken pipe from gevent/pywsgi.py

2016-05-03 Thread Larry Martell
I have a python server that has this in the main: from gevent import pywsgi try: httpd = pywsgi.WSGIServer(('0.0.0.0', 8000), app) httpd.serve_forever() except KeyboardInterrupt: pass Recently we began getting HTTPError: 504 Server Error: Gateway Time-out on requests to the server. L

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