Re: any json data validation library recommendation? (Reposting on Python-Lists Prohitibited)

2016-10-06 Thread Maciej Dziardziel
On Thursday, October 6, 2016 at 7:20:58 AM UTC+1, Lawrence D’Oliveiro wrote: > What action are users supposed to take on such errors, other than include > them in a bug report? By users I mean API users (developers). Most common action would be to add a missing field, correct typo or change valu

Re: fetchall to python lists

2013-09-30 Thread christensen . jerome
On Monday, September 30, 2013 4:58:25 PM UTC+2, christens...@gmail.com wrote: > Hi - I have some basic programming experience and new to Python. I have > connected to SQL Server as follows: > > > > import pyodbc > > conn = pyodbc.connect('DSN=DBC') > > cursor = conn.cursor() > > cursor.execu

Re: fetchall to python lists

2013-09-30 Thread Joel Goldstick
On Mon, Sep 30, 2013 at 10:58 AM, wrote: > Hi - I have some basic programming experience and new to Python. I have > connected to SQL Server as follows: > > import pyodbc > conn = pyodbc.connect('DSN=DBC') > cursor = conn.cursor() > cursor.execute("select measure,fin_year_no,fin_week_no,location_

fetchall to python lists

2013-09-30 Thread christensen . jerome
Hi - I have some basic programming experience and new to Python. I have connected to SQL Server as follows: import pyodbc conn = pyodbc.connect('DSN=DBC') cursor = conn.cursor() cursor.execute("select measure,fin_year_no,fin_week_no,location_no,value from actual") result=cursor.fetchall() resul

Re: Python lists

2012-12-30 Thread Hans Mulder
On 30/12/12 23:25:39, Evan Driscoll wrote: > On 12/30/2012 4:19 PM, Hans Mulder wrote: >> If it's okay to modify the original list, you can simply do: >> >> l[0] = split(l[0], ", ") >> >> If modifying the original is not okay, the simple solution would >> be to copy it first: >> >> l2 = l >> l2[0]

Re: Re: Python lists

2012-12-30 Thread Evan Driscoll
On 12/30/2012 4:19 PM, Hans Mulder wrote: > If it's okay to modify the original list, you can simply do: > > l[0] = split(l[0], ", ") > > If modifying the original is not okay, the simple solution would > be to copy it first: > > l2 = l > l2[0] = split(l2[0], ", ") Um, that doesn't copy the lis

Re: Python lists

2012-12-30 Thread Hans Mulder
On 28/12/12 18:46:45, Alex wrote: > Manatee wrote: > >> On Friday, December 28, 2012 9:14:57 AM UTC-5, Manatee wrote: >>> I read in this: >>> >>> ['C100, C117', 'X7R 0.033uF 10% 25V 0603', '0603-C_L, 0603-C_N', >>> '10', '2', '', '30', '15463-333', 'MURATA', 'GRM188R71E333KA01D', >>> 'Digi-Key',

Re: Python lists

2012-12-28 Thread Alex
Manatee wrote: > On Friday, December 28, 2012 9:14:57 AM UTC-5, Manatee wrote: > > I read in this: > > > > ['C100, C117', 'X7R 0.033uF 10% 25V 0603', '0603-C_L, 0603-C_N', > > '10', '2', '', '30', '15463-333', 'MURATA', 'GRM188R71E333KA01D', > > 'Digi-Key', '490-1521-1-ND', ''] > > > > > > >

Re: Python lists

2012-12-28 Thread Manatee
On Friday, December 28, 2012 9:14:57 AM UTC-5, Manatee wrote: > I read in this: > > ['C100, C117', 'X7R 0.033uF 10% 25V 0603', '0603-C_L, 0603-C_N', '10', '2', > '', '30', '15463-333', 'MURATA', 'GRM188R71E333KA01D', 'Digi-Key', > '490-1521-1-ND', ''] > > > > Then I need to convert it to thi

Re: Python lists

2012-12-28 Thread Roy Smith
In article <8f5cfb99-d1d7-42d7-858a-89dd23cd5...@googlegroups.com>, Manatee wrote: > I read in this: > ['C100, C117', 'X7R 0.033uF 10% 25V 0603', '0603-C_L, 0603-C_N', '10', '2', > '', '30', '15463-333', 'MURATA', 'GRM188R71E333KA01D', 'Digi-Key', > '490-1521-1-ND', ''] > > Then I need to co

Python lists

2012-12-28 Thread Manatee
I read in this: ['C100, C117', 'X7R 0.033uF 10% 25V 0603', '0603-C_L, 0603-C_N', '10', '2', '', '30', '15463-333', 'MURATA', 'GRM188R71E333KA01D', 'Digi-Key', '490-1521-1-ND', ''] Then I need to convert it to this: [['C100', 'C117'], 'X7R 0.033uF 10% 25V 0603', '0603-C_L', '0603-C_N', '10', '

Re: Simple question about Python lists

2008-11-17 Thread Eric
On Nov 11, 7:31 pm, Ben Finney <[EMAIL PROTECTED]> wrote: > Steven D'Aprano <[EMAIL PROTECTED]> writes: > > On Wed, 12 Nov 2008 10:08:45 +1100, Ben Finney wrote: > > > >Eric<[EMAIL PROTECTED]> writes: > > >> In MATLAB, if  I just want the first, fifth  and eighth element I > > >> might do something

Re: Simple question about Python lists

2008-11-12 Thread Scott David Daniels
Eric wrote: ... In MATLAB, if I just want the first, fifth and eighth element I might do something like this: b = a([1 5 8]); On Nov 11, 1:51 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> replied: b = [a[i] for i in [1, 5, 8]] To which Eric said: Thanks! It makes sense, but in this cas

Re: Simple question about Python lists

2008-11-11 Thread Ben Finney
Steven D'Aprano <[EMAIL PROTECTED]> writes: > On Wed, 12 Nov 2008 10:08:45 +1100, Ben Finney wrote: > > > Eric <[EMAIL PROTECTED]> writes: > >> In MATLAB, if I just want the first, fifth and eighth element I > >> might do something like this: > >> > >> b = a([1 5 8]); > > > > Yes: the above c

Re: Simple question about Python lists

2008-11-11 Thread Robert Kern
Steven D'Aprano wrote: On Wed, 12 Nov 2008 10:08:45 +1100, Ben Finney wrote: Eric <[EMAIL PROTECTED]> writes: I'm learning Python (while coming from MATLAB). One question I have is that if I have a list with say 8 elements, and I want just a few of them how do I select them out. In MATLAB, if

Re: Simple question about Python lists

2008-11-11 Thread Steven D'Aprano
On Wed, 12 Nov 2008 10:08:45 +1100, Ben Finney wrote: > Eric <[EMAIL PROTECTED]> writes: > >> I'm learning Python (while coming from MATLAB). One question I have is >> that if I have a list with say 8 elements, and I want just a few of >> them how do I select them out. In MATLAB, if I just want t

Re: Simple question about Python lists

2008-11-11 Thread Ben Finney
Eric <[EMAIL PROTECTED]> writes: > I'm learning Python (while coming from MATLAB). One question I have is > that if I have a list with say 8 elements, and I want just a few of > them how do I select them out. In MATLAB, if I just want the first, > fifth and eighth element I might do something like

Re: Simple question about Python lists

2008-11-11 Thread Robert Kern
Eric wrote: On Nov 11, 1:51 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: On Tue, 11 Nov 2008 11:47:53 -0800, Eric wrote: I'm learning Python (while coming from MATLAB). One question I have is that if I have a list with say 8 elements, and I want just a few of them how do I select the

Re: Simple question about Python lists

2008-11-11 Thread Eric
On Nov 11, 1:51 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > On Tue, 11 Nov 2008 11:47:53 -0800, Eric wrote: > > I'm learning Python (while coming from MATLAB). One question I have is > > that if I have a list with say 8 elements, and I want just a few of them > > how do I select them

Re: Simple question about Python lists

2008-11-11 Thread Robert Kern
Guilherme Polo wrote: On Tue, Nov 11, 2008 at 5:47 PM, Eric <[EMAIL PROTECTED]> wrote: I'm learning Python (while coming from MATLAB). One question I have is that if I have a list with say 8 elements, and I want just a few of them how do I select them out. In MATLAB, if I just want the first, fi

Re: Simple question about Python lists

2008-11-11 Thread Guilherme Polo
On Tue, Nov 11, 2008 at 5:47 PM, Eric <[EMAIL PROTECTED]> wrote: > I'm learning Python (while coming from MATLAB). One question I have is > that if I have a list with say 8 elements, and I want just a few of > them how do I select them out. In MATLAB, if I just want the first, > fifth and eighth el

Re: Simple question about Python lists

2008-11-11 Thread Marc 'BlackJack' Rintsch
On Tue, 11 Nov 2008 11:47:53 -0800, Eric wrote: > I'm learning Python (while coming from MATLAB). One question I have is > that if I have a list with say 8 elements, and I want just a few of them > how do I select them out. In MATLAB, if I just want the first, fifth and > eighth element I might do

Simple question about Python lists

2008-11-11 Thread Eric
I'm learning Python (while coming from MATLAB). One question I have is that if I have a list with say 8 elements, and I want just a few of them how do I select them out. In MATLAB, if I just want the first, fifth and eighth element I might do something like this: b = a([1 5 8]); I can't seem to f

Re: python lists and newline character

2008-07-28 Thread Gary Josack
Gary Herron wrote: Support Desk wrote: Hello all, I am using os.popen to get a list returned of vpopmail users, something like this x = os.popen('/home/vpopmail/bin/vuserinfo -n -D mydomain.com).readlines() x returns a list, of usernames, and I am trying to append the

Re: python lists and newline character

2008-07-28 Thread Gary Herron
Support Desk wrote: Hello all, I am using os.popen to get a list returned of vpopmail users, something like this x = os.popen('/home/vpopmail/bin/vuserinfo -n -D mydomain.com).readlines() x returns a list, of usernames, and I am trying to append the usernames with the do

Re: python lists and newline character

2008-07-28 Thread Stephen Johnson
domain.strip() Assuming domain is the string with the newline. -Steve Johnson On Jul 28, 2008, at 1:32 PM, Support Desk wrote: Hello all, I am using os.popen to get a list returned of vpopmail users, something like this x = os.popen('/home/vpopmail/bin/vuserinfo -n -D mydomai

python lists and newline character

2008-07-28 Thread Support Desk
Hello all, I am using os.popen to get a list returned of vpopmail users, something like this x = os.popen('/home/vpopmail/bin/vuserinfo -n -D mydomain.com).readlines() x returns a list, of usernames, and I am trying to append the usernames with the domain like so for line i

Re: Pattern Matching Over Python Lists

2008-06-22 Thread eliben
> Fair enough. To help you understand the method I used, I'll give you > this hint. It's true that regex on works on strings. However, is there > any way to convert arbitrarily complex data structures to string > representations? You don't need to be an experienced Python user to > answer to this ;

Re: Pattern Matching Over Python Lists

2008-06-22 Thread Chris
On Jun 19, 9:03 pm, John Machin <[EMAIL PROTECTED]> wrote: > On Jun 20, 10:45 am, Chris <[EMAIL PROTECTED]> wrote: > > > On Jun 17, 1:09 pm, [EMAIL PROTECTED] wrote: > > > > Kirk Strauser: > > > > > Hint: recursion. Your general algorithm will be something like: > > > > Another solution is to use

Re: Pattern Matching Over Python Lists

2008-06-20 Thread MRAB
On Jun 20, 1:45 am, Chris <[EMAIL PROTECTED]> wrote: > On Jun 17, 1:09 pm, [EMAIL PROTECTED] wrote: > > > Kirk Strauser: > > > > Hint: recursion.  Your general algorithm will be something like: > > > Another solution is to use a better (different) language, that has > > built-in pattern matching, o

Re: Pattern Matching Over Python Lists

2008-06-19 Thread Paddy
On Jun 20, 1:44 am, Chris <[EMAIL PROTECTED]> wrote: > Thanks for your help. Those weren't quite what I was looking for, but > I ended up figuring it out on my own. Turns out you can actually > search nested Python lists using simple regular expressions. Strange? How

Re: Pattern Matching Over Python Lists

2008-06-19 Thread John Machin
On Jun 20, 10:45 am, Chris <[EMAIL PROTECTED]> wrote: > On Jun 17, 1:09 pm, [EMAIL PROTECTED] wrote: > > > Kirk Strauser: > > > > Hint: recursion. Your general algorithm will be something like: > > > Another solution is to use a better (different) language, that has > > built-in pattern matching,

Re: Pattern Matching Over Python Lists

2008-06-19 Thread Chris
On Jun 17, 1:09 pm, [EMAIL PROTECTED] wrote: > Kirk Strauser: > > > Hint: recursion. Your general algorithm will be something like: > > Another solution is to use a better (different) language, that has > built-in pattern matching, or allows to create one. > > Bye, > bearophile Btw, Python's stdl

Re: Pattern Matching Over Python Lists

2008-06-19 Thread Chris
Thanks for your help. Those weren't quite what I was looking for, but I ended up figuring it out on my own. Turns out you can actually search nested Python lists using simple regular expressions. -- http://mail.python.org/mailman/listinfo/python-list

Re: Pattern Matching Over Python Lists

2008-06-17 Thread bearophileHUGS
Kirk Strauser: > Hint: recursion. Your general algorithm will be something like: Another solution is to use a better (different) language, that has built-in pattern matching, or allows to create one. Bye, bearophile -- http://mail.python.org/mailman/listinfo/python-list

Re: Pattern Matching Over Python Lists

2008-06-17 Thread Kirk Strauser
At 2008-06-17T05:55:52Z, Chris <[EMAIL PROTECTED]> writes: > Is anyone aware of any prior work done with searching or matching a > pattern over nested Python lists? I have this problem where I have a > list like: > > [1, 2, [1, 2, [1, 7], 9, 9], 10] > > and I'd l

Pattern Matching Over Python Lists

2008-06-16 Thread Chris
Is anyone aware of any prior work done with searching or matching a pattern over nested Python lists? I have this problem where I have a list like: [1, 2, [1, 2, [1, 7], 9, 9], 10] and I'd like to search for the pattern [1, 2, ANY] so that is returns: [1, 2, [1, 2, [6, 7], 9, 9], 10] [1,

Re: Is massive spam coming from me on python lists?

2008-04-21 Thread Kam-Hung Soh
On Mon, 21 Apr 2008 16:01:42 +1000, Brian Vanderburg II <[EMAIL PROTECTED]> wrote: I've recently gotten more than too many spam messages and all say Sender: [EMAIL PROTECTED] I'm wondering if my mail list registration is now being used to spam myself and others. If so, sorry, but I'm no

Re: Is massive spam coming from me on python lists?

2008-04-21 Thread Sjoerd Mullender
Torsten Bronger wrote: > Hallöchen! > > Sjoerd Mullender writes: > >> On 2008-04-21 08:01, Brian Vanderburg II wrote: >> >>> I've recently gotten more than too many spam messages and all say >>> Sender: [EMAIL PROTECTED] [...] >> That is just mailman (the mailing list software) keeping track of

Re: Is massive spam coming from me on python lists?

2008-04-21 Thread Torsten Bronger
Hallöchen! Sjoerd Mullender writes: > On 2008-04-21 08:01, Brian Vanderburg II wrote: > >> I've recently gotten more than too many spam messages and all say >> Sender: [EMAIL PROTECTED] [...] > > That is just mailman (the mailing list software) keeping track of > things. By the way, why does ma

Re: Is massive spam coming from me on python lists?

2008-04-21 Thread Mark Shroyer
In article <[EMAIL PROTECTED]>, Brian Vanderburg II <[EMAIL PROTECTED]> wrote: > I've recently gotten more than too many spam messages and all say > Sender: [EMAIL PROTECTED] I'm wondering > if my mail list registration is now being used to spam myself and > others. If so, sorry, but I'm not

Re: Is massive spam coming from me on python lists?

2008-04-21 Thread Sjoerd Mullender
On 2008-04-21 08:01, Brian Vanderburg II wrote: > I've recently gotten more than too many spam messages and all say > Sender: [EMAIL PROTECTED] I'm wondering > if my mail list registration is now being used to spam myself and > others. If so, sorry, but I'm not the one sending messages if othe

Re: Is massive spam coming from me on python lists?

2008-04-20 Thread Paul Scott
On Mon, 2008-04-21 at 02:01 -0400, Brian Vanderburg II wrote: > I've recently gotten more than too many spam messages and all say > Sender: [EMAIL PROTECTED] I'm wondering > if my mail list registration is now being used to spam myself and > others. If so, sorry, but I'm not the one sending m

Is massive spam coming from me on python lists?

2008-04-20 Thread Brian Vanderburg II
I've recently gotten more than too many spam messages and all say Sender: [EMAIL PROTECTED] I'm wondering if my mail list registration is now being used to spam myself and others. If so, sorry, but I'm not the one sending messages if other are getting them even though Sender seems to include