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

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

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

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: 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: parsing nested unbounded XML fields with ElementTree

2013-11-25 Thread Larry Martell
On Monday, November 25, 2013 5:30:44 PM UTC-5, Chris Angelico wrote: > On Tue, Nov 26, 2013 at 9:22 AM, larry.mart...@gmail.com > > wrote: > > > I have an XML file that has an element called "Node". These can be nested > > to any depth and the depth of the nesting is not known to me. I need to

Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP !

2013-11-25 Thread Larry Martell
On Mon, Nov 25, 2013 at 6:12 PM, Gregory Ewing wrote: > Ned Batchelder wrote: > >> Let's please avoid veering off into rants about language >> > > and philosophy now. > > Philosophy is totally on topic for this group: > > http://www.youtube.com/watch?v=-2gJamguN04 > > A classic! I hadn't seen that

Re: parsing nested unbounded XML fields with ElementTree

2013-11-25 Thread Larry Martell
On Mon, Nov 25, 2013 at 6:19 PM, Chris Angelico wrote: > On Tue, Nov 26, 2013 at 9:45 AM, Larry Martell > wrote: > > On Monday, November 25, 2013 5:30:44 PM UTC-5, Chris Angelico wrote: > > > >> First off, please clarify: Are there five corresponding tags > >

Re: parsing nested unbounded XML fields with ElementTree

2013-11-26 Thread Larry Martell
On Tue, Nov 26, 2013 at 5:41 AM, Alister wrote: > > On Mon, 25 Nov 2013 18:25:55 -0500, Larry Martell wrote: > > > On Mon, Nov 25, 2013 at 6:19 PM, Chris Angelico > > wrote: > > > >> On Tue, Nov 26, 2013 at 9:45 AM, Larry Martell > >> > >>

Re: parsing nested unbounded XML fields with ElementTree

2013-11-26 Thread Larry Martell
On Tue, Nov 26, 2013 at 2:38 AM, Stefan Behnel wrote: > larry.martell...@gmail.com, 25.11.2013 23:22: >> I have an XML file that has an element called "Node". These can be nested to >> any depth and the depth of the nesting is not known to me. I need to parse >> the file and preserve the nesting

Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP !

2013-11-27 Thread Larry Martell
On Wed, Nov 27, 2013 at 5:31 AM, Paul Rudin wrote: > rusi writes: > >> Propositionally: All languages are equal -- Turing complete > > As an aside, not all languages are Turing complete. For example Charity > is a language with the property that programs are guaranteed to > terminate. > >

Re: parsing nested unbounded XML fields with ElementTree

2013-11-27 Thread Larry Martell
On Tue, Nov 26, 2013 at 8:20 AM, Stefan Behnel wrote: > Larry Martell, 26.11.2013 13:23: >> On Tue, Nov 26, 2013 at 2:38 AM, Stefan Behnel wrote: >>> larry.martell...@gmail.com, 25.11.2013 23:22: >>>> I have an XML file that has an element called "Node". Th

Re: Experiences/guidance on teaching Python as a first programming language

2013-12-09 Thread Larry Martell
On Mon, Dec 9, 2013 at 8:24 AM, Gene Heskett wrote: > On Monday 09 December 2013 07:51:12 Oscar Benjamin did opine: > >> Hi all, >> >> I work in a University Engineering faculty teaching, among other >> things, programming. In our last meeting about improving our teaching >> syllabus and delivery

Re: Experiences/guidance on teaching Python as a first programming language

2013-12-11 Thread Larry Martell
On Tue, Dec 10, 2013 at 9:16 PM, Denis McMahon wrote: > On Tue, 10 Dec 2013 20:35:47 -0500, Dennis Lee Bieber wrote: > >> On Tue, 10 Dec 2013 18:25:48 +1300, Gregory Ewing >> declaimed the following: > >>>That's like saying that when teaching woodwork we shouldn't let people >>>use hammers, we sh

Re: Script Request

2013-12-11 Thread Larry Martell
On Wed, Dec 11, 2013 at 6:53 AM, Jeff James wrote: > Looking for a script which will check connectivity of any or all of our > company URL's first thing in the morning to make sure none or our sites are > down. Any suggestions ? Thank You import urllib sites = ["http://www.amazon.com/";, "

Re: Experiences/guidance on teaching Python as a first programming language

2013-12-11 Thread Larry Martell
On Wed, Dec 11, 2013 at 8:42 PM, Roy Smith wrote: > In article , > rusi wrote: > >> Kernighan and Ritchie set an important "first" in our field by making >> "Hello World" their first program. > > Yup. > >> People tend to under-estimate the importance of this: >> Many assumptions need to be verif

Re: Experiences/guidance on teaching Python as a first programming language

2013-12-12 Thread Larry Martell
On Thu, Dec 12, 2013 at 11:51 AM, bob gailer wrote: > On 12/11/2013 9:07 PM, Larry Martell wrote: > >> Nope. Long before that I was working on computers that didn't boot when >> you powered them up, You had to manually key in a bootstrap program from the >> front

Re: Launching Helium: A Selenium wrapper that makes web automation 50% easier

2013-12-16 Thread Larry Martell
On Mon, Dec 16, 2013 at 5:17 AM, Michael Herrmann wrote: > Hi everyone, > > I'm working for a startup called BugFree Software and would like to announce > that today we're launching our second product! > > Helium is a library that wraps around Selenium to simplify web automation. It > does away

Re: Question RE urllib

2013-12-16 Thread Larry Martell
On Mon, Dec 16, 2013 at 6:40 AM, Jeff James wrote: > So I'm using the following script to check our sites to make sure they are > all up and some of them are reporting they are "down" when, in fact, they > are actually up. These sites do not require a logon in order for the home > page to come u

Re: Question Re urllib (Jeff James)

2013-12-16 Thread Larry Martell
On Monday, December 16, 2013, Jeff James wrote: > I'm not really receiving an "exception" other than those three sites, out > of the 30 or so I have listed, are the only sites which show "is down" at > the end of that line specifying the site. > > > Where " # " has been substituted for our domain

Re: Question RE urllib

2013-12-16 Thread Larry Martell
On Mon, Dec 16, 2013 at 2:55 PM, Jeff James wrote: > Sorry to be a pain here, guys, as I'm also a newbie at this as well. > > Where, exactly in the script would I place the " print str(e) " ? The line after the print site + " is down" line. > > Thanks > > Original message : > >> I'm not really

Re: Question RE urllib

2013-12-17 Thread Larry Martell
On Tue, Dec 17, 2013 at 10:26 AM, Jeff James wrot > > So I'm using the following script to check our sites to make sure they > are all up and some of them are reporting they are "down" when, in fact, > they are actually up. These sites do not require a logon in order for the > home page to come

Re: Experiences/guidance on teaching Python as a first programming language

2013-12-17 Thread Larry Martell
On Tue, Dec 17, 2013 at 10:35 AM, Mark Lawrence wrote: > I was in charge of the team at work that had to make all code Y2K compliant. > I discovered the one bug that to my knowledge slipped through the net. Four > years later back at the same place on contract I fixed the fix!!! >From around 199

Re: Experiences/guidance on teaching Python as a first programming language

2013-12-17 Thread Larry Martell
On Tue, Dec 17, 2013 at 11:59 AM, Grant Edwards wrote: > On 2013-12-17, Wolfgang Keller wrote: > >>> I was also taught C as an undergrad but having already learned Java, C >>> and C++ before arriving at University I found the C course very easy >>> so my own experience is not representative. Many

Re: Deamonify my python script on Android

2013-12-23 Thread Larry Martell
On Sun, Dec 22, 2013 at 10:22 PM, Kevin Peterson wrote: > Hi, > > I want to daemonify my python script on Android device. That is, it should be > automatically invoked on boot up. > > Appreciate your help. I don't know anything about Android programming, but for Linux i followed the advice on t

Re: Python in the news

2013-12-27 Thread Larry Martell
John D. MacDonald fan? On Friday, December 27, 2013, Travis McGee wrote: > From Twitter: > > RT @cjbrummitt Python kills security guard at Sanur Hyatt, Bali (Ind). > bit.ly/1fLCWvn < bad coding has CONSEQUENCES, ppl! > -- > https://mail.python.org/mailman/listinfo/python-list > -- https://mail.p

Creating a list with holes

2014-01-03 Thread Larry Martell
I think I know the answer is no, but is there any package that allows creating a list with holes in it? E.g. I'd want to do something like: x[10] = 12 x[20] = 30 I'm thinking of something like defaultdict but for lists (I know that's very different, but ... ) Thanks! -larry -- https://mail.pyth

Re: Creating a list with holes

2014-01-03 Thread Larry Martell
On Fri, Jan 3, 2014 at 10:30 AM, wrote: > On Friday, January 3, 2014 4:19:09 PM UTC+1, larry@gmail.com wrote: >> I think I know the answer is no, but is there any package that allows >> >> creating a list with holes in it? E.g. I'd want to do something like: >> >> x[10] = 12 >> x[20] = 30 >>

Re: Creating a list with holes

2014-01-03 Thread Larry Martell
On Fri, Jan 3, 2014 at 10:37 AM, Chris Angelico wrote: > On Sat, Jan 4, 2014 at 2:19 AM, Larry Martell wrote: >> I think I know the answer is no, but is there any package that allows >> creating a list with holes in it? E.g. I'd want to do something like: >> >> x[

Re: Creating a list with holes

2014-01-03 Thread Larry Martell
On Fri, Jan 3, 2014 at 1:07 PM, Denis McMahon wrote: > On Fri, 03 Jan 2014 10:41:21 -0500, Larry Martell wrote: > >> The holes would be between the items I put in. In my example above, if I >> assigned to [10] and [20], then the other items ([0..9] and [11..19]) >> wou

Re: Creating a list with holes

2014-01-03 Thread Larry Martell
On Fri, Jan 3, 2014 at 11:07 AM, Chris Angelico wrote: > On Sat, Jan 4, 2014 at 2:55 AM, Larry Martell wrote: >> The use case is that I'm parsing a XML file like this: >> >> >> >>

Re: Strange behaviour with a for loop.

2014-01-03 Thread Larry Martell
On Fri, Jan 3, 2014 at 11:03 PM, Sean Murphy wrote: > Hello all. > > This is a newly question. But I wish to understand why the below code is > providing different results. > > import os, sys > > > if len(sys.argv) > 2: > filenames = sys.argv[1:] > else > print ("no parameters provided\n") >

efficient way to process data

2014-01-12 Thread Larry Martell
I have an python app that queries a MySQL DB. The query has this form: SELECT a, b, c, d, AVG(e), STD(e), CONCAT(x, ',', y) as f FROM t GROUP BY a, b, c, d, f x and y are numbers (378.18, 2213.797 or 378.218, 2213.949 or 10053.490, 2542.094). The business issue is that if either x or y in 2 rows

Re: efficient way to process data

2014-01-12 Thread Larry Martell
On Sun, Jan 12, 2014 at 2:53 PM, Petite Abeille wrote: > > On Jan 12, 2014, at 8:23 PM, Larry Martell wrote: > >> AFAIK, there is no way to do this in SQL. > > Sounds like a job for window functions (aka analytic functions) [1][2]. > > [1] http://www.postgresql.o

Re: efficient way to process data

2014-01-12 Thread Larry Martell
On Sun, Jan 12, 2014 at 5:18 PM, Chris Angelico wrote: > On Mon, Jan 13, 2014 at 6:53 AM, Petite Abeille > wrote: >> On Jan 12, 2014, at 8:23 PM, Larry Martell wrote: >> >>> AFAIK, there is no way to do this in SQL. >> >> Sounds like a job for window f

Re: efficient way to process data

2014-01-12 Thread Larry Martell
On Sun, Jan 12, 2014 at 5:43 PM, Dennis Lee Bieber wrote: > On Sun, 12 Jan 2014 14:23:17 -0500, Larry Martell > declaimed the following: > >>I have an python app that queries a MySQL DB. The query has this form: >> >>SELECT a, b, c, d, AVG(e), STD(e), CONCAT(x, ',

Re: efficient way to process data

2014-01-12 Thread Larry Martell
On Sun, Jan 12, 2014 at 6:27 PM, Chris Angelico wrote: > On Mon, Jan 13, 2014 at 6:23 AM, Larry Martell > wrote: >> I have an python app that queries a MySQL DB. The query has this form: >> >> SELECT a, b, c, d, AVG(e), STD(e), CONCAT(x, ',', y) as f >>

Re: efficient way to process data

2014-01-13 Thread Larry Martell
On Mon, Jan 13, 2014 at 1:09 AM, Chris Angelico wrote: > On Mon, Jan 13, 2014 at 2:35 PM, Larry Martell > wrote: >> Thanks for the reply. I'm going to take a stab at removing the group >> by and doing it all in python. It doesn't look too hard, but I don't >

Re: efficient way to process data

2014-01-13 Thread Larry Martell
On Mon, Jan 13, 2014 at 1:32 PM, Chris Angelico wrote: > On Tue, Jan 14, 2014 at 5:27 AM, Larry Martell > wrote: >> Thanks. Unfortunately this has been made a low priority task and I've >> been put on to something else (I hate when they do that). > > Ugh, I k

Re: efficient way to process data

2014-01-14 Thread Larry Martell
On Mon, Jan 13, 2014 at 11:32 AM, Chris Angelico wrote: > On Tue, Jan 14, 2014 at 5:27 AM, Larry Martell > wrote: >> Thanks. Unfortunately this has been made a low priority task and I've >> been put on to something else (I hate when they do that). > > Ugh, I k

Re: efficient way to process data

2014-01-14 Thread Larry Martell
On Tue, Jan 14, 2014 at 7:26 AM, Chris Angelico wrote: > On Wed, Jan 15, 2014 at 1:18 AM, Larry Martell > wrote: >> if you're interested in what the application is, this is data >> collected with an electron microscope from semiconductor wafers as >> they are being

Re: dictionary with tuples

2014-01-14 Thread Larry Martell
On Tue, Jan 14, 2014 at 2:10 PM, Igor Korot wrote: > Hi, ALL, > C:\Documents and Settings\Igor.FORDANWORK\Desktop\winpdb>python > Python 2.7.5 (default, May 15 2013, 22:43:36) [MSC v.1500 32 bit > (Intel)] on win32 > Type "help", "copyright", "credits" or "license" for more information. dict

Re: question about input() and/or raw_input()

2014-01-19 Thread Larry Martell
On Sun, Jan 19, 2014 at 12:17 PM, Mark Lawrence wrote: > On 19/01/2014 18:15, Grant Edwards wrote: >> >> On 2014-01-19, Mark Lawrence wrote: >>> Actually, to go off at a tangent, I'm just getting into GUIs via >>> wxPython. I've discovered there are distinct advantages having to >>> write endles

Re: python-daemon for Python v3

2014-01-19 Thread Larry Martell
On Sun, Jan 19, 2014 at 3:30 AM, Asaf Las wrote: > Hi Community > > Is there ported to Python v3 python-daemon package? > > https://pypi.python.org/pypi/python-daemon/ > > i am afraid it is not as simple as correction of relative path input > feature and except clauses in mentioned package. I use

Re: question about input() and/or raw_input()

2014-01-19 Thread Larry Martell
On Sun, Jan 19, 2014 at 1:12 PM, Gene Heskett wrote: > On Sunday 19 January 2014 15:11:52 Larry Martell did opine: > >> On Sun, Jan 19, 2014 at 12:17 PM, Mark Lawrence > wrote: >> > On 19/01/2014 18:15, Grant Edwards wrote: >> >> On 2014-01-19, Mark Lawrence

Re: python-daemon for Python v3

2014-01-19 Thread Larry Martell
On Sun, Jan 19, 2014 at 9:57 PM, Asaf Las wrote: > On Sunday, January 19, 2014 9:30:21 PM UTC+2, larry@gmail.com wrote: >> On Sun, Jan 19, 2014 at 3:30 AM, Asaf Las wrote: >> I use this technique for demonizing: >> http://www.jejik.com/articles/2007/02/a_simple_unix_linux_daemon_in_python/ >>

Re: Early retirement project?

2014-01-21 Thread Larry Martell
On Tue, Jan 21, 2014 at 1:30 AM, Devin Jeanpierre wrote: > Congrats on the early retirement! It takes guts to decide to do that. :) I thought it took money. -- https://mail.python.org/mailman/listinfo/python-list

Re: Early retirement project?

2014-01-22 Thread Larry Martell
On Wed, Jan 22, 2014 at 1:18 AM, wrote: > In fact, Python just becomes the last tool I (would) > recommend, especially for non-ascii users. That's right - only Americans should use Python! -- https://mail.python.org/mailman/listinfo/python-list

Re: No overflow in variables?

2014-01-22 Thread Larry Martell
On Wed, Jan 22, 2014 at 11:09 AM, Philip Red wrote: > Hi everyone. First of all sorry if my english is not good. > I have a question about something in Python I can not explain: > in every programming language I know (e.g. C#) if you exceed the max-value of > a certain type (e.g. a long-integer)

Case insensitive exists()?

2014-01-22 Thread Larry Martell
I have the need to check for a files existence against a string, but I need to do case-insensitively. I cannot efficiently get the name of every file in the dir and compare each with my string using lower(), as I have 100's of strings to check for, each in a different dir, and each dir can have 100

Re: Case insensitive exists()?

2014-01-22 Thread Larry Martell
On Wed, Jan 22, 2014 at 6:08 PM, Roy Smith wrote: > In article , > Larry Martell wrote: > >> I have the need to check for a files existence against a string, but I >> need to do case-insensitively. I cannot efficiently get the name of >> every file in the dir and

Re: Case insensitive exists()?

2014-01-22 Thread Larry Martell
On Wed, Jan 22, 2014 at 6:27 PM, Roy Smith wrote: > In article , > Larry Martell wrote: > >> The issue is that I run a database query and get back rows, each with >> a file path (each in a different dir). And I have to check to see if >> that file exists. Each i

Re: Case insensitive exists()?

2014-01-22 Thread Larry Martell
On Wed, Jan 22, 2014 at 6:27 PM, MRAB wrote: > On 2014-01-23 00:58, Larry Martell wrote: >> >> I have the need to check for a files existence against a string, but I >> need to do case-insensitively. I cannot efficiently get the name of >> every file in the dir and

Re: Case insensitive exists()?

2014-01-23 Thread Larry Martell
On Wed, Jan 22, 2014 at 9:29 PM, Chris Angelico wrote: > On Thu, Jan 23, 2014 at 3:24 PM, Larry Martell > wrote: >> I am writing something that is part of a django app, that based on >> some web entry from the user, I run a query, get back a list of files >> and hav

Re: re Questions

2014-01-26 Thread Larry Martell
On Sun, Jan 26, 2014 at 9:59 AM, Blake Adams wrote: > Im pretty new to Python and understand most of the basics of Python re but am > stumped by a unexpected matching dynamics. > > If I want to set up a match replicating the '\w' pattern I would assume that > would be done with '[A-z0-9_]'. How

Re: pytz question: GMT vs. UTC

2014-01-30 Thread Larry Martell
On Thu, Jan 30, 2014 at 10:23 AM, Grant Edwards wrote: > On 2014-01-30, Christian Heimes wrote: >> On 30.01.2014 04:27, Chris Angelico wrote: >>> On Thu, Jan 30, 2014 at 1:40 PM, MRAB wrote: > How cruel... I suspect the smack at 0degC is much more painful > than one > at room

Re: Python prime numbers

2014-02-01 Thread Larry Martell
On Saturday, February 1, 2014, Panagiotis Anastasiou wrote: > Hi i'm new in programming and in python and i have an assignment that i > cant complete. I have to Write a Python program to compute and print the > first 200 prime numbers. The output must be formatted with a title and the > prime num

Re: [newbie] troubles with tuples

2014-02-03 Thread Larry Martell
On Mon, Feb 3, 2014 at 11:50 AM, Jean Dupont wrote: > I'm looking at the way to address tuples > e.g. > tup2 = (1, 2, 3, 4, 5, 6, 7 ); > > As I found out indices start with 0 in Python, so > tup2[0] gives me 1, the first element in the tuple as expected > tup2[1] gives me 2, the second element in

Re: how to reduce bugs due to incorrect indentation

2014-02-06 Thread Larry Martell
On Thu, Feb 6, 2014 at 3:29 PM, Roel Schroeven wrote: > msus...@gmail.com schreef: >> >> I had a bug in a Python script recently. The code in question was >> something along the lines of: >> >> if a == 1: >> x = y >> else: >> x = z >> y = z + y >> z = z + 1 >> >> While editing this file I

Re: how to reduce bugs due to incorrect indentation

2014-02-06 Thread Larry Martell
On Thu, Feb 6, 2014 at 4:32 PM, Ethan Furman wrote: > On 02/06/2014 12:36 PM, Larry Martell wrote: >> >> On Thu, Feb 6, 2014 at 3:29 PM, Roel Schroeven wrote: >>> >>> msus...@gmail.com schreef: >>>> >>>> >>>> While editing this

Re: Flag control variable

2014-02-11 Thread Larry Martell
On Tuesday, February 11, 2014, wrote: > hello, > i'd like to know how to set up a flag to change a variable, > for example, i want a simple script to combine 2 numbers, > > > sum = num + another_num > print "Now the sum of the numbers equals : ", sum > > how could i make it so that if i type pyth

Re: Python programming

2014-02-11 Thread Larry Martell
On Tue, Feb 11, 2014 at 8:21 PM, Walter Hurry wrote: > Dave Angel wrote: > >>> What is the best way i can master thinker? >> >> Never heard of it. Is it a computer language? >> > Socrates himself is particularly missed A lovely little thinker, but a bugger when he's pissed. -- https://mail.pytho

Re: How to connect the MYSQL database to Python program?

2015-12-11 Thread Larry Martell
On Fri, Dec 11, 2015 at 1:36 PM, ICT Ezy wrote: > On Wednesday, December 9, 2015 at 9:58:02 AM UTC-8, Chris Angelico wrote: >> On Thu, Dec 10, 2015 at 4:51 AM, ICT Ezy wrote: >> > Pl explain me how to connect the MYSQL database to Python program? >> >> You start by looking for a module that lets

Re: Need help - How to identify the cell display format?

2015-12-15 Thread Larry Martell
On Tue, Dec 15, 2015 at 2:29 AM, Ezhilarasan Chandrasekar wrote: > Hi folks, > > I just want to find the cell display format in Excel. I have a Expected > excel file and Actual Excel file. > > I have some knowledge about, how to check the cell value, cell font, > alignment. But I also want to know

Emulating plotly's contour map color distribution

2016-02-03 Thread Larry Martell
I am using a javascript ploting package called plotly and I use that to generate a contour map. In that package you define a rangeMin, rangeMax, and binSize, and you give it a color map, e.g.: [["0", "rgb(0,0,0)"], ["0.3", "rgb(230,0,0)"], ["0.6", "rgb(255,210,0)"], ["1", "rgb(255,255,255)"]] Thi

RegExp help

2016-02-10 Thread Larry Martell
Given this string: >>> s = """|Type=Foo ... |Side=Left""" >>> print s |Type=Foo |Side=Left I can match with this: >>> m = re.search(r'^\|Type=(.*)$\n^\|Side=(.*)$',s,re.MULTILINE) >>> print m.group(0) |Type=Foo |Side=Left >>> print m.group(1) Foo >>> print m.group(2) Left But when I try and sub

Re: RegExp help

2016-02-10 Thread Larry Martell
On Wed, Feb 10, 2016 at 10:00 PM, MRAB wrote: > On 2016-02-11 02:48, Larry Martell wrote: >> >> Given this string: >> >>>>> s = """|Type=Foo >> >> ... |Side=Left""" >>>>> >>>>> print

Re: [Off-topic] Requests author discusses MentalHealthError exception

2016-02-29 Thread Larry Martell
On Sat, Feb 27, 2016 at 4:37 AM, Steven D'Aprano wrote: > The author of Requests, Kenneth Reitz, discusses his recent recovery from a > MentalHealthError exception. > > http://www.kennethreitz.org/essays/mentalhealtherror-an-exception-occurred > > Although the connection to Python is only quite sl

Re: [Off-topic] Requests author discusses MentalHealthError exception

2016-02-29 Thread Larry Martell
On Mon, Feb 29, 2016 at 11:47 AM, Ian Kelly wrote: > On Mon, Feb 29, 2016 at 9:21 AM, Larry Martell > wrote: >> On Sat, Feb 27, 2016 at 4:37 AM, Steven D'Aprano wrote: >>> The author of Requests, Kenneth Reitz, discusses his recent recovery from a >>> Mental

Re: [Off-topic] Requests author discusses MentalHealthError exception

2016-02-29 Thread Larry Martell
On Mon, Feb 29, 2016 at 11:56 AM, Ben Finney wrote: > Ian Kelly writes: > >> On Mon, Feb 29, 2016 at 9:21 AM, Larry Martell >> wrote: >> > I found this to be a very sad story. Sure, he had some issues, but I >> > don't think they needed to drug him, a

Re: [Off-topic] Requests author discusses MentalHealthError exception

2016-02-29 Thread Larry Martell
On Mon, Feb 29, 2016 at 12:33 PM, Ben Finney wrote: > Rustom Mody writes: > >> On Monday, February 29, 2016 at 10:26:32 PM UTC+5:30, Ben Finney wrote: >> > Ian Kelly writes: >> > >> > > On Mon, Feb 29, 2016 at 9:21 AM, Larry Martell wrote: >> >

creating zipfile with symlinks

2016-03-03 Thread Larry Martell
I have a script that creates zip files of dirs containing symlinks. I was surprised to find that the zipfiles have zipped the targets of the links as opposed to the links themselves, which is what I wanted and expected. Googling I found this: https://doeidoei.wordpress.com/2010/11/23/compressing-f

Re: creating zipfile with symlinks

2016-03-03 Thread Larry Martell
On Thu, Mar 3, 2016 at 1:37 PM, Larry Martell wrote: > I have a script that creates zip files of dirs containing symlinks. I > was surprised to find that the zipfiles have zipped the targets of the > links as opposed to the links themselves, which is what I wanted and > expected. Goog

Re: creating zipfile with symlinks

2016-03-03 Thread Larry Martell
On Thu, Mar 3, 2016 at 4:58 PM, Chris Angelico wrote: > On Fri, Mar 4, 2016 at 8:38 AM, MRAB wrote: >> Is it even possible to zip a link? >> >> A quick search came up with this: >> >> Are hard links possible within a zip archive? >> http://stackoverflow.com/questions/8859616/are-hard-links-possib

Re: creating zipfile with symlinks

2016-03-04 Thread Larry Martell
On Thu, Mar 3, 2016 at 10:32 PM, Larry Martell wrote: > On Thu, Mar 3, 2016 at 4:58 PM, Chris Angelico wrote: >> On Fri, Mar 4, 2016 at 8:38 AM, MRAB wrote: >>> Is it even possible to zip a link? >>> >>> A quick search came up with this: >>> >

Re: creating zipfile with symlinks

2016-03-04 Thread Larry Martell
On Fri, Mar 4, 2016 at 9:22 AM, Gene Heskett wrote: > On Friday 04 March 2016 07:18:57 Larry Martell wrote: > >> On Thu, Mar 3, 2016 at 10:32 PM, Larry Martell > wrote: >> > On Thu, Mar 3, 2016 at 4:58 PM, Chris Angelico > wrote: >> >> On Fri, Mar 4, 2016

Re: Photon mass (was: [Still off-top] Physics)

2016-03-06 Thread Larry Martell
On Sat, Mar 5, 2016 at 12:36 PM, Gene Heskett wrote: > On Saturday 05 March 2016 10:46:04 Thomas 'PointedEars' Lahn wrote: > >> Gene Heskett wrote: >> > I've never heard of a massless photon, >> >> That is unfortunate as it should be common knowledge by now. >> >> > and they do exert a push on the

Re: Photon mass (was: [Still off-top] Physics)

2016-03-06 Thread Larry Martell
On Sun, Mar 6, 2016 at 4:46 PM, Gene Heskett wrote: > > Has Carol written anything new lately? I replied to Gene privately, but if anyone is wondering, Carol is my wife and these are her blogs: Non-fiction: http://minervaontheroad.com/ Fiction: https://minervamartell.wordpress.com/ -- https:

Re: Phyton

2016-03-06 Thread Larry Martell
On Sun, Mar 6, 2016 at 6:14 PM, Steven D'Aprano wrote: > On Mon, 7 Mar 2016 04:05 am, Mark Lawrence wrote: > >> Why in the year 2016 are people still giving links to the Luddite Python >> 2 docs? > > Because Python 2.7 is still supported, and will be officially supported > until 2020, after which

Re: Simple exercise

2016-03-10 Thread Larry Martell
On Thu, Mar 10, 2016 at 8:45 PM, BartC wrote: > Any other way of traversing two lists in parallel? zip -- https://mail.python.org/mailman/listinfo/python-list

Re: Hello

2016-03-11 Thread Larry Martell
On Fri, Mar 11, 2016 at 4:49 AM, Steven D'Aprano wrote: > On Fri, 11 Mar 2016 02:28 pm, rubengoods...@yahoo.com wrote: > > > I am having trouble installing the Python software. > > Make sure your computer is turned on. I can't tell you how many times I've > tried to install Python, and I type com

Re: argparse

2016-03-11 Thread Larry Martell
On Fri, Mar 11, 2016 at 6:18 PM, Fillmore wrote: > > > Playing with ArgumentParser. I can't find a way to override the -h and --help > options so that it provides my custom help message. > > -h, --help show this help message and exit > > Here is what I am trying: > > parser = argparse.A

Re: Simple exercise

2016-03-14 Thread Larry Martell
On Mon, Mar 14, 2016 at 10:07 AM, Rick Johnson wrote: > On Thursday, March 10, 2016 at 7:22:26 PM UTC-6, Mark Lawrence wrote: >> Always a code smell when range() and len() are combined. > > I would be careful about dealing in absolutes Mark. I always think people should never use absolutes. -- h

Re: retrieve key of only element in a dictionary (Python 3)

2016-03-19 Thread Larry Martell
On Fri, Mar 18, 2016 at 5:33 PM, Fillmore wrote: > > I must be missing something simple, but... > > Python 3.4.0 (default, Apr 11 2014, 13:05:11) > [GCC 4.8.2] on linux > Type "help", "copyright", "credits" or "license" for more information. d = dict() d['squib'] = "007" # I forget

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

2016-03-20 Thread Larry Martell
I have a script that I run a lot - at least 10 time every day. Usually it works fine. But sometime it just stops running with nothing output to stdout or stderr. I've been trying to debug this for a while, and today I looked in the system logs and saw this: abrt: detected unhandled Python exceptio

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

2016-03-20 Thread Larry Martell
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 >> it works fine. But sometime it just stops running with nothing output >> to

Re: Why do you use python?

2016-03-21 Thread Larry Martell
On Mon, Mar 21, 2016 at 4:26 PM, wrote: > On Monday, 21 March 2016 04:13:45 UTC, Chris Angelico wrote: >> On Mon, Mar 21, 2016 at 2:59 PM, wrote: >> > instead, to be efficient, it is best to combine tools to solve problems >> > that contain complexities where there is nothing available off th

Re: [OT'ish] Is there a list as good as this for Javascript

2016-03-24 Thread Larry Martell
On Thu, Mar 24, 2016 at 4:53 PM, wrote: > I use Python wherever I can and find this list (as a usenet group via > gmane) an invaluable help at times. > > Occasionally I have to make forays into Javascript, can anyone > recommend a place similar to this list where Javascript questions can > be ask

Re: [OT'ish] Is there a list as good as this for Javascript

2016-03-26 Thread Larry Martell
On Sat, Mar 26, 2016 at 7:37 AM, Ned Batchelder wrote: > Thomas, you don't have to choose between correct and nice. It's > possible to be both. "I'm not good, I'm not nice, I'm just right." That was written by Stephen Sondheim and it's from his musical Into The Woods. It's said by the witch. Th

Re: [OT'ish] Is there a list as good as this for Javascript

2016-03-26 Thread Larry Martell
On Sat, Mar 26, 2016 at 11:31 AM, Gene Heskett wrote: > On Saturday 26 March 2016 07:52:05 Larry Martell wrote: >> As my wife once said, "If you start with 'Listen, asshole, ...' they >> probably won't hear what you have to say after that. > > She is

Re: variable attribute name

2014-10-27 Thread Larry Martell
On Mon, Oct 27, 2014 at 2:23 PM, Harvey Greenberg wrote: > I want to let the name of an attribute be the string value of a variable. > Here is some code: > > class Object(object): pass > A = Object() > s = 'attr' > A. = 1 > > The last line denotes the variable value by (not a python form). Wha

Re: Understanding "help" command description syntax - explanation needed

2014-11-05 Thread Larry Martell
On Wed, Nov 5, 2014 at 7:13 AM, Ivan Evstegneev wrote: > Firtst of all thanks for reply. > >>>brackets [] means that the argument is optional. > > That's what I'm talking about (asking actually), where do you know it from? I know it because I've been a programmer for 39 years. -- https://mail.py

Re: Understanding "help" command description syntax - explanation needed

2014-11-05 Thread Larry Martell
On Wed, Nov 5, 2014 at 7:41 AM, Chris Angelico wrote: > On Wed, Nov 5, 2014 at 11:31 PM, Ivan Evstegneev > wrote: That's what I'm talking about (asking actually), where do you know it from? >> I know it because I've been a programmer for 39 years. >> >> I didn't intend to offence anyone

Re: Understanding "help" command description syntax - explanation needed

2014-11-07 Thread Larry Martell
On Fri, Nov 7, 2014 at 7:52 AM, Steven D'Aprano wrote: > Dave Angel wrote: > >> Approximately 1968 for me. I wrote programs in 1967, but didn't >> get to run them till 1968. > > > I once used a compiler that slow too. Yeah, I think it was made by Intermetrics. Or maybe Borland. -- https://mail.

Re: I don't read docs and don't know how to use Google. What does the print function do?

2014-11-10 Thread Larry Martell
On Mon, Nov 10, 2014 at 2:49 PM, Roy Smith wrote: > In article , > sohcahto...@gmail.com wrote: > >> Please help me this assignment is due in an hour. Don't give me hints, just >> give me the answer because I only want a grade. I'm not actually interested >> in learning how to program, but I kn

Communicating with a PHP script (and pretending I'm a browser)

2014-11-11 Thread Larry Martell
I have a PHP app that I want to convert to django. But I want to do it stages. All the heavy lifting is in the PHP code, so first, I want to just use templates and views to generate the HTML, but still call the PHP code. Then later convert the PHP to python. My issue is that the PHP code expects t

Re: Communicating with a PHP script (and pretending I'm a browser)

2014-11-11 Thread Larry Martell
On Tue, Nov 11, 2014 at 10:54 AM, Chris Angelico wrote: > On Wed, Nov 12, 2014 at 2:48 AM, Larry Martell > wrote: >> Is there some way python can communicate like curl ... it needs to >> send the request string in the body of a POST request to the URL that >> will rou

<    1   2   3   4   5   >