Re: What you can do about legalese nonsense on email (was: How to split value where is comma ?)

2016-09-09 Thread Steve D'Aprano
On Fri, 9 Sep 2016 08:13 am, Grant Edwards wrote: > After all, that boilerplate just makes the corporation look stupid and > incompetent. I wish that were true. Unfortunately, in the corporate world, it *doesn't* make them look stupid and incompetent. It makes them look conventional, careful,

Re: python3 regex?

2016-09-09 Thread Jussi Piitulainen
Jussi Piitulainen writes: > dkole...@olearycomputers.com writes: >> [- -] > import re > p = re.compile('"?[1-9]*\.') That should be a raw string: r'"?[1-9]*\.' Sorry about that. I wish Python would complain. -- https://mail.python.org/mailman/listinfo/python-list

How do I automatically download files from a pop up dialog using selenium-python?

2016-09-09 Thread John
Please help. Thanks. -- https://mail.python.org/mailman/listinfo/python-list

Re: python3 regex?

2016-09-09 Thread Jussi Piitulainen
dkole...@olearycomputers.com writes: > Hey; > > Long term perl ahderent finally making the leap to python. From my > reading, python, for the most part, uses perl regex.. except, I can't > seem to make it work... > > I have a txt file from which I can grab specific titles via a perl > one-liner:

Re: python3 regex?

2016-09-09 Thread Christian Gollwitzer
Am 10.09.16 um 05:12 schrieb dkole...@olearycomputers.com: Hey; Long term perl ahderent finally making the leap to python. From my reading, python, for the most part, uses perl regex.. except, I can't seem to make it work... I have a txt file from which I can grab specific titles via a perl

Re: pymssql

2016-09-09 Thread Miki Tebeka
> for row in cus: >print(row.budget_code) > > > NameError: name 'budget_code' is not defined You'll need to use a DictCursor to be able to access rows by name and not position (which IMO is the preferred way). cus = conn.cursor(pymysql.cursors.DictCursor) cus.execute("SELECT * FROM

Re: how to set paramiko to use ssh version 1?

2016-09-09 Thread Lawrence D’Oliveiro
On Thursday, September 1, 2016 at 3:26:26 PM UTC+12, meInvent bbird wrote: > how to set paramiko to use ssh version 1? Be polite, but firm. Tell it “paramiko, this is ssh version 1, use it”. Then, when it responds “but SSHv1 is an obsolete stinking pile of crap that nobody in their right mind sh

Re: How to extend a tuple of tuples?

2016-09-09 Thread Lawrence D’Oliveiro
On Saturday, September 10, 2016 at 12:21:48 AM UTC+12, Frank Millman wrote: > The short answer is that I am using it as a dictionary key. Another option is, if it takes several steps to construct the tuple, to build it incrementally as a list and then cast it to a tuple. -- https://mail.python.o

Re: python3 regex?

2016-09-09 Thread Lawrence D’Oliveiro
On Saturday, September 10, 2016 at 3:12:17 PM UTC+12, Doug OLeary wrote: > $ perl -ne 'print if (m{^("?)[1-9]*\.})' tables Perl has this feature of being able to use alternate delimiter symbols for the pattern; Python does not. > >>> regex = r'^("?)[1-9]*\.' Try putting a backslash in front of

python3 regex?

2016-09-09 Thread dkoleary
Hey; Long term perl ahderent finally making the leap to python. From my reading, python, for the most part, uses perl regex.. except, I can't seem to make it work... I have a txt file from which I can grab specific titles via a perl one-liner: $ perl -ne 'print if (m{^("?)[1-9]*\.})' tables 1

Re: PEP suggestion: Uniform way to indicate Python language version

2016-09-09 Thread Steve D'Aprano
On Tue, 23 Aug 2016 12:29 am, Random832 wrote: > Receiving a SyntaxError or whatever other exception, which provides no > suggestion about how to actually fix the issue (install a later version > of python / run with "python3" instead of "python"), is a bad user > experience. Er wot? If I run th

Re: PEP suggestion: Uniform way to indicate Python language version

2016-09-09 Thread Lawrence D’Oliveiro
On Tuesday, August 23, 2016 at 2:30:10 AM UTC+12, Random832 wrote: > Receiving a SyntaxError or whatever other exception, which provides no > suggestion about how to actually fix the issue (install a later version > of python / run with "python3" instead of "python"), is a bad user > experience. W

Re: PEP 492: isn't the "await" redundant?

2016-09-09 Thread Lawrence D’Oliveiro
On Saturday, September 10, 2016 at 12:39:04 AM UTC+12, Chris Angelico wrote: > In contrast, you want to use threads if you need the ability to > quickly and easily share mutable data, or if you want all resource > usage to be lumped together - eg if you're not really doing several > separate jobs,

Re: Is it possible to process dist files before they are build via a setuptools hook?

2016-09-09 Thread Lawrence D’Oliveiro
On Friday, September 9, 2016 at 7:52:32 PM UTC+12, Mark Summerfield wrote: > So, I need to have some hook that lets me run a python script after the build > dir has been populated but before the distributable is made -- is this > possible? You can subclass distutils.command.build with your own cus

Re: ldap or active directory module

2016-09-09 Thread John Gordon
In Robert Clove writes: > I want to find if the particular group exist in my active directory Search on the group's DN, specifying SCOPE_BASE as the search scope. If you get a result, then the group exists, otherwise it doesn't. > also another function to find the user in a particular group

Re: Mysterious Logging Handlers

2016-09-09 Thread Peter Otten
Josh English wrote: > I have a Python script that imports a utility script. Both scripts use > logging, but the logs don't work as advertised. I'm getting logging output > from the utility script but none from the main file. Worse, the format of > the utility script's logs don't match anything I d

Re: Mysterious Logging Handlers

2016-09-09 Thread John Gordon
In <247db0ab-efe7-484b-a418-dd219f68a...@googlegroups.com> Josh English writes: > When I run the scriptI get logging information from only xlreader, not > from the main script: > DEBUG:XLREADER:Creating Excel Reader > This format isn't defined anywhere. That is the default logging format; it'

Re: ldap or active directory module

2016-09-09 Thread Shyam Parimal Katti
Sure, have you tried it and failed? I remember using this: https://www.python-ldap.org/docs.html year back and was able to do many operations including lookups. On Fri, Sep 9, 2016 at 5:41 AM, Robert Clove wrote: > Is it possible to find the following things using python ldap or active > direc

Mysterious Logging Handlers

2016-09-09 Thread Josh English
I have a Python script that imports a utility script. Both scripts use logging, but the logs don't work as advertised. I'm getting logging output from the utility script but none from the main file. Worse, the format of the utility script's logs don't match anything I define. The utility script

Re: Where to store finalized python programs

2016-09-09 Thread Python
Le 09/09/2016 à 15:32, ast a écrit : hi Is there a web site to store python programs in order to make them accessible for every boby ? I know pypy, but I understood that it is for modules only. Not only, it is for programs too, for instance: pip install weboob -- https://mail.python.org/ma

Re: What you can do about legalese nonsense on email (was: How to split value where is comma ?)

2016-09-09 Thread Grant Edwards
On 2016-09-08, Random832 wrote: > On Thu, Sep 8, 2016, at 18:13, Grant Edwards wrote: >> After all, that boilerplate just makes the corporation look stupid and >> incompetent. Any email that leaves the corporate network must be >> assumed to be visible to world+dog. Anybody who thinks differentl

Re: Where to store finalized python programs

2016-09-09 Thread Chris Angelico
On Fri, Sep 9, 2016 at 11:32 PM, ast wrote: > hi > > Is there a web site to store python programs > in order to make them accessible for every boby ? > > I know pypy, but I understood that it is for modules > only. I would recommend source code hosting sites - gitlab.com, github.com, bitbucket.or

Where to store finalized python programs

2016-09-09 Thread ast
hi Is there a web site to store python programs in order to make them accessible for every boby ? I know pypy, but I understood that it is for modules only. -- https://mail.python.org/mailman/listinfo/python-list

Re: What you can do about legalese nonsense on email

2016-09-09 Thread jmp
On 09/08/2016 10:52 PM, Ben Finney wrote: Joaquin Alzola writes: That's not true; you can do more than we. Added by the MTA of the company not by my client. Right. So, here are things you can do (that we cannot) about this: * Complain, with reasoned explanation, to the management respon

Re: How to extend a tuple of tuples?

2016-09-09 Thread Rustom Mody
On Friday, September 9, 2016 at 5:58:16 PM UTC+5:30, Chris Angelico wrote: > On Fri, Sep 9, 2016 at 10:21 PM, Frank Millman wrote: > > I am building a series of JOINs for a SQL statement. Some of them can be > > nested - table A is joined from table B is joined from table C. In other > > parts of t

Re: PEP 492: isn't the "await" redundant?

2016-09-09 Thread Chris Angelico
On Fri, Sep 9, 2016 at 10:27 PM, Steve D'Aprano wrote: > On Fri, 9 Sep 2016 07:28 pm, Chris Angelico wrote: > >> We don't >> have a problem with threading and multiprocessing having very similar >> APIs, do we? Yet they exist to solve distinctly different problems. > > Surely not? > > I would thin

Re: PEP 492: isn't the "await" redundant?

2016-09-09 Thread Steve D'Aprano
On Fri, 9 Sep 2016 07:28 pm, Chris Angelico wrote: > We don't > have a problem with threading and multiprocessing having very similar > APIs, do we? Yet they exist to solve distinctly different problems. Surely not? I would think that threading and multiprocessing are two distinct implementation

Re: How to extend a tuple of tuples?

2016-09-09 Thread Chris Angelico
On Fri, Sep 9, 2016 at 10:21 PM, Frank Millman wrote: > I am building a series of JOINs for a SQL statement. Some of them can be > nested - table A is joined from table B is joined from table C. In other > parts of the same SQL statement, table A could be joined from table D which > is joined from

Re: How to extend a tuple of tuples?

2016-09-09 Thread Frank Millman
"Ned Batchelder" wrote in message news:44e067ce-f499-4ca8-87bd-94b18dfc0...@googlegroups.com... On Friday, September 9, 2016 at 6:13:37 AM UTC-4, Frank Millman wrote: > "Frank Millman" wrote in message news:nqtlue$unj$1...@blaine.gmane.org... > > The one I was looking for was > > a += (5,

Re: PEP 492: isn't the "await" redundant?

2016-09-09 Thread Chris Angelico
On Fri, Sep 9, 2016 at 9:26 PM, Marko Rauhamaa wrote: > Chris Angelico : >> FWIW I think it's great that they have similar coding styles. We don't >> have a problem with threading and multiprocessing having very similar >> APIs, do we? Yet they exist to solve distinctly different problems. > > Wel

Re: How to extend a tuple of tuples?

2016-09-09 Thread Ned Batchelder
On Friday, September 9, 2016 at 6:13:37 AM UTC-4, Frank Millman wrote: > "Frank Millman" wrote in message news:nqtlue$unj$1...@blaine.gmane.org... > > > Assume you have a tuple of tuples - > > > a = ((1, 2), (3, 4)) > > > You want to add a new tuple to it, so that it becomes - > > > ((1,

Re: Suggestions to improve a code

2016-09-09 Thread jmp
On 09/06/2016 04:55 PM, GP wrote: I have a list: shelves2 =[{'Part No': '1', 'Length': 610.0, 'Width': 50.0}, {'Part No': '2', 'Length': 2319.0, 'Width': 465.0 }, {'Part No': '3', 'Length': 5.0,'Width': 465.0}] The length of shelf is calculated as follows: 1. Calculate the max

Re: import pybel in python error code

2016-09-09 Thread Peter Otten
talari.gopiprashanth.go...@gmail.com wrote: > ValueErrorTraceback (most recent call > last) in () > 1 from django.conf import settings > > 2 import pybel > 3 import random, os > > C:\Miniconda2\lib\site-packages\pybel.py in () > 67 _obconv = o

Re: PEP 492: isn't the "await" redundant?

2016-09-09 Thread Marko Rauhamaa
Chris Angelico : > FWIW I think it's great that they have similar coding styles. We don't > have a problem with threading and multiprocessing having very similar > APIs, do we? Yet they exist to solve distinctly different problems. Well, Ext4, BtrFS, XFS and ReiserFS have very similar APIs. In fac

Re: What you can do about legalese nonsense on email (was: How to split value where is comma ?)

2016-09-09 Thread D'Arcy J.M. Cain
On Thu, 08 Sep 2016 18:27:44 -0400 Random832 wrote: > If every lawyer in the world benefits from the interpretation that > this sort of notice is legally effective (since tomorrow it may be > they who accidentaly send privileged information), who will argue in > court that it's not? The reality is

Re: nested loops in Python

2016-09-09 Thread Igor Kozin
I think you are right, it's the assignment itself which is slow. Merged loop is only a tad quicker. On Thursday, September 8, 2016 at 6:04:41 PM UTC+1, Christian Gollwitzer wrote: > > Why nested loops are so slow in Python? Is it because new contexts are > > created? > > For more details, see > >

Re: What you can do about legalese nonsense on email (was: How to split value where is comma ?)

2016-09-09 Thread Steve D'Aprano
On Fri, 9 Sep 2016 04:59 pm, Rustom Mody wrote: > On Friday, September 9, 2016 at 2:37:48 AM UTC+5:30, Ben Finney wrote: >> Joaquin Alzola writes: >> > Added by the MTA of the company not by my client. >> >> Right. So, here are things you can do (that we cannot) about this: >> * Switch to a diffe

Re: libdivecomputer

2016-09-09 Thread alister
On Fri, 09 Sep 2016 02:26:02 -0700, Lawrence D’Oliveiro wrote: > On Wednesday, August 24, 2016 at 1:29:55 AM UTC+12, alister wrote: >> I already have an application that works fine (sub-surface) so this is >> more of a curiosity, delving into ctypes is not something I want to try >> just yet. > >

Re: How to extend a tuple of tuples?

2016-09-09 Thread Frank Millman
"Frank Millman" wrote in message news:nqtlue$unj$1...@blaine.gmane.org... Assume you have a tuple of tuples - a = ((1, 2), (3, 4)) You want to add a new tuple to it, so that it becomes - ((1, 2), (3, 4), (5, 6)) Thanks all. The one I was looking for was a += (5, 6), I und

Re: How to extend a tuple of tuples?

2016-09-09 Thread Steve D'Aprano
On Fri, 9 Sep 2016 04:47 pm, Frank Millman wrote: > Hi all > > This should be easy, but I cannot figure it out. > > Assume you have a tuple of tuples - > > a = ((1, 2), (3, 4)) > > You want to add a new tuple to it, so that it becomes - > > ((1, 2), (3, 4), (5, 6)) a = a + ((5, 6),) Y

Re: How to diagnose CERTIFICATE_VERIFY_FAILED on Windows for websites working in browsers?

2016-09-09 Thread Chi Hsuan Yen
On Fri, Sep 9, 2016 at 5:52 PM, Chris Angelico wrote: > On Fri, Sep 9, 2016 at 7:47 PM, Chi Hsuan Yen wrote: > > I found that OpenSSL provides an X509 callback hook that allows clients > to > > know why the verification process fails. Seems CPython does not use it > yet. > > I hope it can be add

Re: How to diagnose CERTIFICATE_VERIFY_FAILED on Windows for websites working in browsers?

2016-09-09 Thread Chris Angelico
On Fri, Sep 9, 2016 at 7:47 PM, Chi Hsuan Yen wrote: > I found that OpenSSL provides an X509 callback hook that allows clients to > know why the verification process fails. Seems CPython does not use it yet. > I hope it can be added to CPython. Where should I go next, python-dev, > python-ideas or

import pybel in python error code

2016-09-09 Thread talari . gopiprashanth . gopi2
ValueErrorTraceback (most recent call last) in () 1 from django.conf import settings > 2 import pybel 3 import random, os C:\Miniconda2\lib\site-packages\pybel.py in () 67 _obconv = ob.OBConversion() 68 _builder = ob.OBBuilder() ---> 69 in

Re: How to diagnose CERTIFICATE_VERIFY_FAILED on Windows for websites working in browsers?

2016-09-09 Thread Chi Hsuan Yen
On Fri, Sep 9, 2016 at 4:18 PM, Chi Hsuan Yen wrote: > > > On Fri, Sep 9, 2016 at 2:54 PM, dieter wrote: > >> Chi Hsuan Yen writes: >> > ... >> > Thanks a lot! I just lost my direction when trying to understand how >> > certificate verification works in Python. >> >> It sets things up for "Open

ldap or active directory module

2016-09-09 Thread Robert Clove
Is it possible to find the following things using python ldap or active directory module I want to find if the particular group exist in my active directory also another function to find the user in a particular group -- https://mail.python.org/mailman/listinfo/python-list

Re: libdivecomputer

2016-09-09 Thread Lawrence D’Oliveiro
On Wednesday, August 24, 2016 at 1:29:55 AM UTC+12, alister wrote: > I already have an application that works fine (sub-surface) so this is > more of a curiosity, delving into ctypes is not something I want to try > just yet. Why not? It would be a great way to learn ctypes. :) -- https://mail.

Re: PEP 492: isn't the "await" redundant?

2016-09-09 Thread Chris Angelico
On Fri, Sep 9, 2016 at 7:23 PM, Lawrence D’Oliveiro wrote: > On Friday, August 26, 2016 at 10:08:25 PM UTC+12, Marko Rauhamaa wrote: >> Ultimately, asyncio and multithreading might well merge. It will be >> difficult for a programmer to decide in the beginning of the design >> which way to go as t

Re: PEP 492: isn't the "await" redundant?

2016-09-09 Thread Lawrence D’Oliveiro
On Friday, August 26, 2016 at 10:08:25 PM UTC+12, Marko Rauhamaa wrote: > Ultimately, asyncio and multithreading might well merge. It will be > difficult for a programmer to decide in the beginning of the design > which way to go as the programming models are almost identical. The two will never m

Re: Suggestions to improve a code

2016-09-09 Thread Lawrence D’Oliveiro
On Wednesday, September 7, 2016 at 2:55:37 AM UTC+12, GP wrote: > MaxLengthOfItem_Index =f_LMax(shelves2,MaxLengthOfItem) MaxLengthOfItem_Index = max(range(len(shelves2)), key = lambda i : shelves2[i]["Length"]) -- https://mail.python.org/mailman/listinfo/python-list

Re: How to split value where is comma ?

2016-09-09 Thread Chris Angelico
On Fri, Sep 9, 2016 at 4:20 PM, Rustom Mody wrote: > [Personal note: When I was a kid I thought that doctors removed fever by > sticking > a thermometer into one’s mouth. > Those who teach that programming needs to start with writing print statements > are the same except for not having the excus

Re: How to diagnose CERTIFICATE_VERIFY_FAILED on Windows for websites working in browsers?

2016-09-09 Thread Chi Hsuan Yen
On Fri, Sep 9, 2016 at 2:54 PM, dieter wrote: > Chi Hsuan Yen writes: > > ... > > Thanks a lot! I just lost my direction when trying to understand how > > certificate verification works in Python. > > It sets things up for "OpenSSL" and then delegates all details > to it. > > Thanks, sounds a gr

Re: How to extend a tuple of tuples?

2016-09-09 Thread Jussi Piitulainen
Ben Finney writes: > Frank Millman writes: > >> Assume you have a tuple of tuples - >> >> a = ((1, 2), (3, 4)) >> >> You want to add a new tuple to it, so that it becomes > > As you acknowledge, the tuple ‘a’ can't become anything else. Instead, > you need to create a different value. > >> The obv

Is it possible to process dist files before they are build via a setuptools hook?

2016-09-09 Thread Mark Summerfield
Hi, I use setuptools (in my case with cx_Freeze) to package some of my Python applications. As part of this process a build\exe.win-amd64-3.4 dir is created with all the necessary files, and then a separate dist\ dir is created with the distributable package (e.g., a .msi file). I'd like to r

Re: How to extend a tuple of tuples?

2016-09-09 Thread Ben Finney
"Frank Millman" writes: > Assume you have a tuple of tuples - > > a = ((1, 2), (3, 4)) > > You want to add a new tuple to it, so that it becomes As you acknowledge, the tuple ‘a’ can't become anything else. Instead, you need to create a different value. > The obvious way does not work - > > a +

Re: What you can do about legalese nonsense on email

2016-09-09 Thread Rustom Mody
On Friday, September 9, 2016 at 6:49:52 AM UTC+5:30, Terry Reedy wrote: > On 9/8/2016 4:52 PM, Ben Finney wrote: > > Joaquin Alzola writes: > >> >> the world? > >> > >> Cannot do anything. > > > > That's not true; you can do more than we. > > > >> Added by the MTA of the company not by my client.

Re: How to extend a tuple of tuples?

2016-09-09 Thread Rustom Mody
On Friday, September 9, 2016 at 12:18:24 PM UTC+5:30, Frank Millman wrote: > Hi all > > This should be easy, but I cannot figure it out. > > Assume you have a tuple of tuples - > > a = ((1, 2), (3, 4)) > > You want to add a new tuple to it, so that it becomes - > > ((1, 2), (3, 4), (5, 6))

Re: How to extend a tuple of tuples?

2016-09-09 Thread dieter
"Frank Millman" writes: > Hi all > > This should be easy, but I cannot figure it out. > > Assume you have a tuple of tuples - > > a = ((1, 2), (3, 4)) > > You want to add a new tuple to it, so that it becomes - > >((1, 2), (3, 4), (5, 6)) > > The obvious way does not work - > > a += (5, 6) >

Re: What you can do about legalese nonsense on email (was: How to split value where is comma ?)

2016-09-09 Thread Rustom Mody
On Friday, September 9, 2016 at 2:37:48 AM UTC+5:30, Ben Finney wrote: > Joaquin Alzola writes: > > Added by the MTA of the company not by my client. > > Right. So, here are things you can do (that we cannot) about this: > * Switch to a different mail service, one which does not add that > nonse