Re: From JoyceUlysses.txt -- words occurring exactly once

2024-06-08 Thread Larry Martell via Python-list
On Sat, Jun 8, 2024 at 10:39 AM Mats Wichmann via Python-list < python-list@python.org> wrote: > On 6/5/24 05:10, Thomas Passin via Python-list wrote: > > > Of course, we see this lack of clarity all the time in questions to the > > list. I often wonder how these askers can possibly come up with

Re: Serializing pydantic enums

2024-05-29 Thread Larry Martell via Python-list
On Wed, May 29, 2024 at 12:27 PM Larry Martell wrote: > > On Tue, May 28, 2024 at 11:46 AM Left Right via Python-list > wrote: > > > > Most Python objects aren't serializable into JSON. Pydantic isn't > > special in this sense. > > > > What ca

Re: Serializing pydantic enums

2024-05-29 Thread Larry Martell via Python-list
Yeah, I know I can do this, but I seem to recall reading that pydantic handled serialization. Guess not. > On Tue, May 28, 2024 at 2:50 PM Larry Martell via Python-list > wrote: > > > > Just getting started with pydantic. I have this example code: > > > > class

Serializing pydantic enums

2024-05-28 Thread Larry Martell via Python-list
Just getting started with pydantic. I have this example code: class FinishReason(Enum): stop = 'stop' class Choice(BaseModel): finish_reason: FinishReason = Field(...) But I cannot serialize this: json.dumps(Choice(finish_reason=FinishReason.stop).dict()) *** TypeError: Object of type

Re: PyCon

2024-05-17 Thread Larry Martell via Python-list
LOn Fri, May 17, 2024 at 8:57 PM Larry Martell wrote: > I’m at PyCon in Pittsburgh and I’m haven’t an amazing time! s/haven’t/having/ -- https://mail.python.org/mailman/listinfo/python-list

PyCon

2024-05-17 Thread Larry Martell via Python-list
I’m at PyCon in Pittsburgh and I’m haven’t an amazing time! -- https://mail.python.org/mailman/listinfo/python-list

Re: Version of NymPy

2024-05-15 Thread Larry Martell via Python-list
On Wed, May 15, 2024 at 2:43 PM Popov, Dmitry Yu via Python-list wrote: > > What would be the easiest way to learn which version of NumPy I have with my > Anaconda distribution? >>> import numpy >>> numpy.__version__ '1.24.4' -- https://mail.python.org/mailman/listinfo/python-list

Re: Extract lines from file, add to new files

2024-01-30 Thread Larry Martell via Python-list
On Tue, Jan 30, 2024 at 1:13 AM AVI GROSS via Python-list wrote: > > It can be quite frustrating figuring out what someone wants, Grant, > especially when they just change it. > > It is worse when instead of starting a new thread with an appropriate > subject line, it continues and old one that wa

Re: Running a subprocess in a venv

2023-10-21 Thread Larry Martell via Python-list
On Sat, Oct 21, 2023 at 12:10 PM Johannes Findeisen wrote: > > On Sat, 21 Oct 2023 11:32:03 -0400 > Larry Martell wrote: > > > On Sat, Oct 21, 2023 at 9:49 AM Johannes Findeisen > > wrote: > > > > > > On Sat, 21 Oct 2023 09:01:18 -0400 > > > La

Re: Running a subprocess in a venv

2023-10-21 Thread Larry Martell via Python-list
On Sat, Oct 21, 2023 at 9:49 AM Johannes Findeisen wrote: > > On Sat, 21 Oct 2023 09:01:18 -0400 > Larry Martell via Python-list wrote: > > > I have a python script, and from that I want to run another script in > > a subprocess in a venv. What is the best way to do t

Running a subprocess in a venv

2023-10-21 Thread Larry Martell via Python-list
I have a python script, and from that I want to run another script in a subprocess in a venv. What is the best way to do that? I could write a file that activates the venv then runs the script, then run that file, but that seems messy. Is there a better way? -- https://mail.python.org/mailman/list

Re: path to python in venv

2023-09-27 Thread Larry Martell via Python-list
On Wed, Sep 27, 2023 at 12:53 PM Niktar Lirik wrote: > > Hi Larry, > > You could just create venv with option '—copies' > > > > For example: > > python -m venv -–copies .venv Thanks! That is just what I was looking for. > From: Larry Martell via Py

Re: path to python in venv

2023-09-27 Thread Larry Martell via Python-list
On Wed, Sep 27, 2023 at 12:42 PM Jon Ribbens via Python-list wrote: > > On 2023-09-27, Larry Martell wrote: > > I was under the impression that in a venv the python used would be in > > the venv's bin dir. But in my venvs I see this in the bin dirs: > > > > lrw

path to python in venv

2023-09-27 Thread Larry Martell via Python-list
I was under the impression that in a venv the python used would be in the venv's bin dir. But in my venvs I see this in the bin dirs: lrwxrwxrwx 1 larrymartell larrymartell7 Sep 27 11:21 python -> python3 lrwxrwxrwx 1 larrymartell larrymartell 16 Sep 27 11:21 python3 -> /usr/bin/python3 Goo

Re: Why do I always get an exception raised in this __init__()?

2023-08-31 Thread Larry Martell via Python-list
On Thu, Aug 31, 2023 at 3:19 PM Chris Green via Python-list wrote: > > I'm obviously doing something very silly here but at the moment I > can't see what. > > Here's the code:- > > #!/usr/bin/python3 > # > # > # GPIO > # > import gpiod > # > # > # Simple wrapper

Re: pip-sync

2023-07-24 Thread Larry Martell via Python-list
On Fri, Jul 21, 2023 at 11:08 AM Larry Martell wrote: > > I am trying to set up and maintain a venv with pip-sync. On my bare > metal I have the apparmor python package installed, but it is not > installed in my venv and it's not in my requirements file. When I run > pip-s

pip-sync

2023-07-21 Thread Larry Martell via Python-list
I am trying to set up and maintain a venv with pip-sync. On my bare metal I have the apparmor python package installed, but it is not installed in my venv and it's not in my requirements file. When I run pip-sync I get: Found existing installation: apparmor 2.13.3 ERROR: Cannot uninstall 'apparmor

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: Rob Cliffe should stop sending me rude email messages.

2023-02-26 Thread Larry Martell
On Sun, Feb 26, 2023 at 3:49 PM Hen Hanna wrote: > > Rob Cliffe should stop sending me rude email messages. You should stop spamming this lists with with meaningless posts. -- https://mail.python.org/mailman/listinfo/python-list

Re: flattening lists

2022-10-11 Thread Larry Martell
On Tue, Oct 11, 2022 at 12:48 PM SquidBits _ wrote: > > Does anyone else think there should be a flatten () function, which just > turns a multi-dimensional list into a one-dimensional list in the order it's > in. e.g. > > [[1,2,3],[4,5,6,7],[8,9]] becomes [1,2,3,4,5,6,7,8,9]. > > I have had to

Re: Function to Print a nicely formatted Dictionary or List?

2022-06-09 Thread Larry Martell
On Thu, Jun 9, 2022 at 11:44 AM Dave wrote: > > Hi, > > Before I write my own I wondering if anyone knows of a function that will > print a nicely formatted dictionary? > > By nicely formatted I mean not all on one line! >>> import json >>> d = {'John': 'Cleese', 'Eric': "Idle", 'Micheal': 'Pali

Re: terminate called after throwing an instance of 'boost::python::error_already_set

2022-05-27 Thread Larry Martell
On Fri, May 27, 2022 at 5:51 PM dn wrote: > On 28/05/2022 08.14, Larry Martell wrote: > > I have a script that has literally been running for 10 years. > > Suddenly, for some runs it crashes with the error: > > > > terminate called after throwing an i

terminate called after throwing an instance of 'boost::python::error_already_set

2022-05-27 Thread Larry Martell
I have a script that has literally been running for 10 years. Suddenly, for some runs it crashes with the error: terminate called after throwing an instance of 'boost::python::error_already_set No stack trace. Anyone have any thoughts on what could cause this and/or how I can track it down? -- h

Re: Why no list as dict key?

2022-04-20 Thread Larry Martell
On Wed, Apr 20, 2022 at 2:23 PM Abdur-Rahmaan Janhangeer wrote: > > Greetings list, > > Using Python3.9, i cannot assign a list [1, 2] as key > to a dictionary. Why is that so? Thanks in advanced! Dict keys cannot be mutable. Use a tuple instead. -- https://mail.python.org/mailman/listinfo/pytho

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 > >

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: 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 you gave in to the t

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-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 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 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 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 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 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
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 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"

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: 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. >

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: 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

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: 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-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

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.

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

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

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: How do you find what exceptions a class can throw?

2020-12-21 Thread Larry Martell
On Sun, Dec 20, 2020 at 9:36 PM Chris Angelico wrote: > > On Mon, Dec 21, 2020 at 1:11 PM Julio Di Egidio wrote: > > > Gathering evidence is indeed part of science, and computer science is > > > indeed mathematics, but alas programmering is just a craft and software > > > engineering often ... is

Re: list of dictionaries search using kwargs

2020-12-07 Thread Larry Martell
urn all matches > > Beware though that either of these will be slow if your list of dicts is > large. > If the list is large enough that this becomes slow, consider using a database > (e.g. sqlite or other SQL DB) instead. Thanks! Works perfectly. > On 7 Dec 2020, 22:06 +, La

Re: list of dictionaries search using kwargs

2020-12-07 Thread Larry Martell
On Mon, Dec 7, 2020 at 5:29 PM Marco Sulla wrote: > > You can return dictionaries that returns True if > > (a.items() & kwargs.items()) == kwargs.items() > > when `a` is one of your dicts. But what is passed in kwargs will not necessarily have values for all of the keys and I only want to check f

list of dictionaries search using kwargs

2020-12-07 Thread Larry Martell
I have a class that has an object that contains a list of dicts. I want to have a class method that takes a variable number of key/value pairs and searches the list and returns the item that matches the arguments. If I know the key value pairs I can do something like this: instance = next(item fo

Re: Time Date Conversion?

2020-11-04 Thread Larry Martell
On Wed, Nov 4, 2020 at 6:21 PM Steve wrote: > > The text File entry is: >BPd 2020-11-04 17:28:03.352027 66 > > I bring it into the program using: > with open("_TIME-DATE.txt" , 'r') as infile: > for lineEQN in infile: # loop to find each line in the file for that > dose > and set it in a

Re: python mariadb & html tables

2020-09-15 Thread Larry Martell
On Tue, Sep 15, 2020 at 1:35 PM SS wrote: > > On Tuesday, September 15, 2020 at 2:52:35 PM UTC-4, larry.mart...@gmail.com > wrote: > > On Tue, Sep 15, 2020 at 11:45 AM SS wrote: > > > > > > I'm trying to create an table in html from a Maria DB table, from a > > > python script. I'm getting some

Re: python mariadb & html tables

2020-09-15 Thread Larry Martell
On Tue, Sep 15, 2020 at 11:45 AM SS wrote: > > I'm trying to create an table in html from a Maria DB table, from a python > script. I'm getting some unexpected results. > > The environment is Centos 7, I'm using Python3 with apache. > > Here is copy of the script I'm using: > > *** SCRIPT ST

Re: grouping and sorting within groups using another list

2020-09-02 Thread Larry Martell
On Wed, Sep 2, 2020 at 11:22 AM David Raymond wrote: > > Would it be something as simple as: > > rows.sort(key = lambda x: (x[0], x[3], x[4], sort_list.index(x[6]))) This is perfect - thanks! > -Original Message- > From: Python-list > On Behalf Of Larry Mart

grouping and sorting within groups using another list

2020-09-02 Thread Larry Martell
I have a list of tuples, and I want to group them by 3 items (0, 3, 4) and then within each group sort the data by a 4th item (6) using a sort order from another list. The list is always ordered by the 3 grouping items. For example, if I have this list: rows = [('a', 'b', 'c', 'd', 'e', 'f', 'blue

Re: Python database compatibility

2020-06-12 Thread Larry Martell
On Fri, Jun 12, 2020 at 5:03 PM Siddharth Joshi wrote: > > All, > > I am new in Python world and would like to use it for one of the our > purpose . Before that, I would like to ask if Python has compatibility with > ENSCRIBE database . > > Enscribe database (file structured) is the native databas

Re: exiting a while loop

2020-05-22 Thread Larry Martell
On Fri, May 22, 2020 at 7:51 AM John Yeadon via Python-list wrote: > > Am I unreasonable in expecting this code to exit when required? > > > # Add up the powers of 2 starting with 2**0 until 2 million is met. > n = 1 > target = 200 > sum = 0 > > while True: > x = 2 ** (n - 1) > sum +

Re: Display, EasyProcess

2020-05-21 Thread Larry Martell
On Thu, May 21, 2020 at 3:44 AM Peter Otten <__pete...@web.de> wrote: > > Larry Martell wrote: > > > I have some code that uses the pyvirtualdisplay package and it works fine. > > > > pyvirtualdisplay,Display calls EasyProcess like this: > > > >

Display, EasyProcess

2020-05-20 Thread Larry Martell
I have some code that uses the pyvirtualdisplay package and it works fine. pyvirtualdisplay,Display calls EasyProcess like this: @classmethod def check_installed(cls): EasyProcess([PROGRAM, '-help'], url=URL, ubuntu_package=PACKAGE).check_installed(

Re: Can one make 'in' ungreedy?

2020-05-18 Thread Larry Martell
On Mon, May 18, 2020 at 7:05 AM Chris Green wrote: > > I have a strange/minor problem in a Python program I use for mail > filtering. > > One of the ways it classifies messages is by searching for a specific > string in square brackets [] in the Subject:, the section of code that > does this is:-

Re: pyodbc slowness

2020-03-04 Thread Larry Martell
On Wed, Mar 4, 2020 at 3:20 PM Larry Martell wrote: > > I have some Python code that uses pyodbc to talk to a SQL Server database. In > that code I do an INSERT INTO SELECT * FROM > > That query takes around 3 times longer to run when invoked from Python with > py

pyodbc slowness

2020-03-04 Thread Larry Martell
I have some Python code that uses pyodbc to talk to a SQL Server database. In that code I do an INSERT INTO SELECT * FROM That query takes around 3 times longer to run when invoked from Python with pyodbc than when run with direct SQL. On one system we have 1,667 rows and the timings a

Re: A small quiz

2020-01-23 Thread Larry Martell
On Thu, Jan 23, 2020 at 3:56 AM Z wrote: > > what is PLR? Past Life Regression -- https://mail.python.org/mailman/listinfo/python-list

Re: TechRepublicDEVELOPERCXO JPMorgan's Athena has 35 million lines of Python code, and won't be updated to Python 3 in time

2019-09-14 Thread Larry Martell
On Fri, Sep 13, 2019 at 1:37 PM Skip Montanaro wrote: > > > https://www.techrepublic.com/google-amp/article/jpmorgans-athena-has-35-million-lines-of-python-code-and-wont-be-updated-to-python-3-in-time/ > > I doubt this is unusual, and presume JP Morgan is big enough to handle > the change of stat

TechRepublicDEVELOPERCXO JPMorgan's Athena has 35 million lines of Python code, and won't be updated to Python 3 in time

2019-09-13 Thread Larry Martell
https://www.techrepublic.com/google-amp/article/jpmorgans-athena-has-35-million-lines-of-python-code-and-wont-be-updated-to-python-3-in-time/ -- https://mail.python.org/mailman/listinfo/python-list

Re: MySQLdb for 3.6 on RHEL7

2019-08-13 Thread Larry Martell
On Tue, Aug 13, 2019 at 2:16 PM Chris Angelico wrote: > > On Wed, Aug 14, 2019 at 1:48 AM Larry Martell wrote: > > > > On Tue, Aug 13, 2019 at 9:59 AM Chris Angelico wrote: > > > > > > On Tue, Aug 13, 2019 at 11:33 PM Larry Martell > > > wrote: &

Re: MySQLdb for 3.6 on RHEL7

2019-08-13 Thread Larry Martell
On Tue, Aug 13, 2019 at 9:59 AM Chris Angelico wrote: > > On Tue, Aug 13, 2019 at 11:33 PM Larry Martell > wrote: > > > > I am trying to install MySQLdb (https://pypi.org/project/mysqlclient/) > > for python3.6 on RHEL7. > > > > When I import it, it fail

Re: MySQLdb for 3.6 on RHEL7

2019-08-13 Thread Larry Martell
On Tue, Aug 13, 2019 at 9:43 AM Inada Naoki wrote: > > Why do you use RHEL? That is not my choice. > I believe people use RHEL to get support from Red Hat, instead of community > support. I do not believe Red Hat supports this package. > > 2019年8月13日(火) 22:32 Larry Ma

MySQLdb for 3.6 on RHEL7

2019-08-13 Thread Larry Martell
I am trying to install MySQLdb (https://pypi.org/project/mysqlclient/) for python3.6 on RHEL7. When I import it, it fails: # python3.6 Python 3.6.8 (default, Jun 11 2019, 15:15:01) [GCC 4.8.5 20150623 (Red Hat 4.8.5-39)] on linux Type "help", "copyright", "credits" or "license" for more informati

Re: py2 to 3 base64 issues

2019-08-09 Thread Larry Martell
On Fri, Aug 9, 2019 at 3:17 PM MRAB wrote: > > On 2019-08-09 19:21, Larry Martell wrote: > > On Fri, Aug 9, 2019 at 12:23 PM Chris Angelico wrote: > >> > >> On Sat, Aug 10, 2019 at 2:09 AM Larry Martell > >> wrote: > >> > > >> >

Re: py2 to 3 base64 issues

2019-08-09 Thread Larry Martell
On Fri, Aug 9, 2019 at 12:23 PM Chris Angelico wrote: > > On Sat, Aug 10, 2019 at 2:09 AM Larry Martell wrote: > > > > I have some python 2 code: > > > > def decode(key, string): > >decoded_chars = [] > >string = base64.urlsafe_b64de

py2 to 3 base64 issues

2019-08-09 Thread Larry Martell
I have some python 2 code: def decode(key, string): decoded_chars = [] string = base64.urlsafe_b64decode(string) for i in range(len(string)): key_c = key[i % len(key)] encoded_c = chr(abs(ord(string[i]) - ord(key_c) % 256)) decoded_chars.append

Re: AttributeError: module 'itertools' has no attribute 'imap'

2019-08-08 Thread Larry Martell
On Thu, Aug 8, 2019 at 1:33 PM Peter Otten <__pete...@web.de> wrote: > > Larry Martell wrote: > > >> Pyke has been ported to py3. Here is the code that returns the data I > >> am trying to process: > >> > >> return map(self.doctor_answer, it) >

Re: AttributeError: module 'itertools' has no attribute 'imap'

2019-08-08 Thread Larry Martell
On Thu, Aug 8, 2019 at 12:34 PM Rhodri James wrote: > > On 08/08/2019 17:16, Larry Martell wrote: > > On Thu, Aug 8, 2019 at 11:30 AM Peter Otten <__pete...@web.de> wrote: > >> > >> Larry Martell wrote: > [snip] > >>> But in py3 that fa

Re: AttributeError: module 'itertools' has no attribute 'imap'

2019-08-08 Thread Larry Martell
On Thu, Aug 8, 2019 at 12:16 PM Larry Martell wrote: > > On Thu, Aug 8, 2019 at 11:30 AM Peter Otten <__pete...@web.de> wrote: > > > > Larry Martell wrote: > > > > > I have some code that is using the pyke package > > > (https://sourceforg

Re: AttributeError: module 'itertools' has no attribute 'imap'

2019-08-08 Thread Larry Martell
On Thu, Aug 8, 2019 at 11:30 AM Peter Otten <__pete...@web.de> wrote: > > Larry Martell wrote: > > > I have some code that is using the pyke package > > (https://sourceforge.net/projects/pyke/). That project seems fairly > > dead, so asking here. > > >

AttributeError: module 'itertools' has no attribute 'imap'

2019-08-08 Thread Larry Martell
I have some code that is using the pyke package (https://sourceforge.net/projects/pyke/). That project seems fairly dead, so asking here. There is a pyke function that returns a context manager with an iterable map. In py2.7 I did this: from pyke import knowledge_engine vasculopathy_engine = know

Re: How do you insert an item into a dictionary (in python 3.7.2)?

2019-06-28 Thread Larry Martell
On Fri, Jun 28, 2019 at 11:10 AM CrazyVideoGamez wrote: > > How do you insert an item into a dictionary? For example, I make a dictionary > called "dictionary". > > dictionary = {1: 'value1', 2: 'value3'} > > What if I wanted to add a value2 in the middle of value1 and value3? Dicts are not orde

Re: Friday Filosofical Finking: Import protections

2019-04-17 Thread Larry Martell
On 2019-04-17 21:20, DL Neil wrote: > Do you bother with exception handling for import statements? I often have to do something like this: try: from settings import SITE_WAFER_DIAMETER except ImportError: SITE_WAFER_DIAMETER = 300 -- https://mail.python.org/mailman/listinfo/python-list

python book

2019-04-16 Thread Larry Martell
https://www.reddit.com/r/Python/comments/bc2606/just_found_the_best_python_bookcover/ -- https://mail.python.org/mailman/listinfo/python-list

Re: Might be doing this wrong? (Turtle graphics)

2019-03-25 Thread Larry Martell
On Mon, Mar 25, 2019 at 3:45 PM CrazyVideoGamez wrote: > wait no nevermind im such an idiot Every programmer I have ever known has said that. -- https://mail.python.org/mailman/listinfo/python-list

Re: Can my python program send me a text message?

2019-03-19 Thread Larry Martell
On Tue, Mar 19, 2019 at 3:30 PM Steve wrote: > > I have a program that triggers a reminder timer. When that timer is done, I > would like to receive a text message on my phone to tell me that it is time > to reset the experiment. > > Can this be done using Python? You can send a text with emai

Re: 3D visualizations in Python

2019-03-12 Thread Larry Martell
On Tue, Mar 12, 2019 at 6:55 PM Jakub Bista wrote: > > Hello. I want to do 3D visualization in Python. Which framework do you > recommend me for creating such a Interface? https://plot.ly/python/ -- https://mail.python.org/mailman/listinfo/python-list

Re: OT - need help with PHP

2019-02-01 Thread Larry Martell
On Fri, Feb 1, 2019 at 10:30 AM Bob Gailer wrote: > I can't even figure out how to sign up for a PHP email list. http://php.net/manual/en/faq.mailinglist.php -- https://mail.python.org/mailman/listinfo/python-list

Re: Pythonic Y2K

2019-01-18 Thread Larry Martell
r scripts and communicate with them, may need to > start newer programs that use the 3.X or beyond version as no back-ported > version exists. The bubble may enlarge and may eventually burst. > > -Original Message- > From: Python-list On > Behalf Of Larry Martell

Re: Pythonic Y2K

2019-01-18 Thread Larry Martell
On Fri, Jan 18, 2019 at 10:43 AM Michael Torrie wrote: > > On 01/16/2019 12:02 PM, Avi Gross wrote: > > I recall the days before the year 2000 with the Y2K scare when people > > worried that legacy software might stop working or do horrible things once > > the clock turned. It may even have been s

Re: Pythonic Y2K

2019-01-16 Thread Larry Martell
On Wed, Jan 16, 2019 at 9:35 PM Avi Gross wrote: > > Chris, > > The comparison to Y2K was not a great one. I am not sure what people did in > advance, but all it took was to set the clock forward on a test system and > look for anomalies. Not everything would be found but it gave some hints. Clea

Re: the python name

2019-01-02 Thread Larry Martell
On Wed, Jan 2, 2019 at 8:04 PM Avi Gross wrote: > > Challenge: Can we name any computer language whose name really would suggest > it was a computer language? COBOL (Common Business-Oriented Language) FORTRAN (Formula Translation) PL/1 (Programming Language 1) ALGOL (Algorithmic Language) -- ht

Re: mouse click automation

2019-01-01 Thread Larry Martell
On Tue, Jan 1, 2019 at 12:10 PM Siddha 2305 wrote: > > Hello All, > > I am trying to write a script to emulate mouse clicks. > The script launches Google chrome, navigates to the website. But after that > the script does not go to the specified coordinates. > > Also, I noticed that the screen coo

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.

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: 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: 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: 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: [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: 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: 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: 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,

New books by O’Reilly

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

  1   2   3   4   5   >