Re: Best way to inplace alter a list going into postgres

2016-05-30 Thread Sayth Renshaw
On Tuesday, 31 May 2016 15:58:40 UTC+10, Steven D'Aprano wrote: > On Tuesday 31 May 2016 14:27, Sayth Renshaw wrote: > > > > > Hi > > > > What is the best way to inplace alter a list going into a postgres database > > Is it relevant where it is going? > > What you do with the list after you a

Re: Best way to inplace alter a list going into postgres

2016-05-30 Thread Steven D'Aprano
On Tuesday 31 May 2016 14:27, Sayth Renshaw wrote: > > Hi > > What is the best way to inplace alter a list going into a postgres database Is it relevant where it is going? What you do with the list after you alter it is irrelevant -- perhaps you will insert it into an Oracle database, or a pl

Re: Best way to inplace alter a list going into postgres

2016-05-30 Thread Ben Finney
Sayth Renshaw writes: > Ah so I should create a function that processes and modifies in the > middle of the process between obtaining and committing. Separating the tasks: * Get the data from the database, into a form useful inside your program. (For a Python program manipulating records from

Re: Best way to inplace alter a list going into postgres

2016-05-30 Thread Sayth Renshaw
Ah so I should create a function that processes and modifies in the middle of the process between obtaining and committing. Or if I need to do this and more processing should I be using something like sqlalchemy or peewee http://docs.peewee-orm.com/en/latest/ ? Sayth -- https://mail.python.org

Re: Best way to inplace alter a list going into postgres

2016-05-30 Thread Ben Finney
Sayth Renshaw writes: > What is the best way to inplace alter a list going into a postgres > database using split but being sure that the order of items remains > correct. That's a trick question. The best way to modify fields of a record is not with a list. Instead, you should get the record i

Best way to inplace alter a list going into postgres

2016-05-30 Thread Sayth Renshaw
Hi What is the best way to inplace alter a list going into a postgres database using split but being sure that the order of items remains correct. I am using this list of ids to retrieve data from XML horseattrs = ('id', 'race_id', 'horse', 'number', 'finished', 'age', 'sex', 'bl

Re: Don't understand a probleme of module time not defined when calling a foo func

2016-05-30 Thread Matt Wheeler
On Mon, 30 May 2016, 21:08 Ni Va, wrote: > > _ > Output: > Traceback (most recent call last): > File "", line 1, in > File "", line 16, in PyExecReplace > File "", line 22, in > File "", line 11, in foo > NameError: global name 'time' is not defined > Based on your tracebac

Don't understand a probleme of module time not defined when calling a foo func

2016-05-30 Thread Ni Va
Hi Evereybody, New in python dev, I don't understand why I obtain a problem of time module import as below in my function foo meanwhile this module is visible from the main core code. Thank you by advance Best Regards Niva # -*- coding: utf-8 -*- import time import sys from timeout import *

Re: Recommendation for Object-Oriented systems to study

2016-05-30 Thread Terry Reedy
On 5/30/2016 11:57 AM, Ankush Thakur wrote: On Monday, May 30, 2016 at 12:00:01 AM UTC+5:30, Terry Reedy wrote: Read the source code of the doctest module in the standard library. Or pick a module with classes that interests you, with the caveat that some are old and crusty. I learned from

Re: re.search - Pattern matching review

2016-05-30 Thread Matt Wheeler
On 30 May 2016 at 10:03, Ganesh Pal wrote: > Thanks Matt for the reply and lovely analysis . I was trying to complicate > the simple task :( > > Here is how the code looks now , the whole idea was just to match the > pattern and return it > > > def get_block(block): > > cmd = "get_block_info

Re: python parsing suggestion

2016-05-30 Thread Lorenzo Sutton
Hi, On 30/05/2016 09:34, Ganesh Pal wrote: Hi , Trying to extract the '1,1,114688:8192' pattern form the below output. pdb>stdout: '3aae5d0-1: Parent Block for 1,1,19169280:8192 (block 1,1,114688:8192) --\n3aae5d0-1: magic 0xdeaff2fe mark_cookie 0x\ngpal-3aae5d0

import

2016-05-30 Thread luca72 via Python-list
Hello i'm not sure that is the right group but i try i use pyqt5 with eric i have two form in the first form i have add : from form_two import Form_two and for pass varible to second form i have add in the function def test(self) self.ft= Form_two() #so i can acces to Object in form_two se

Re: Recommendation for Object-Oriented systems to study

2016-05-30 Thread Ankush Thakur
On Monday, May 30, 2016 at 12:00:01 AM UTC+5:30, Terry Reedy wrote: > On 5/29/2016 1:49 PM, Michele Simionato wrote: > > On Sunday, May 29, 2016 at 4:42:17 PM UTC+2, Ankush Thakur wrote: > >> Hello, > >> > >> I'm a self-taught programmer who has managed to claw his way out of Python > >> basics an

Re: Recommendation for Object-Oriented systems to study

2016-05-30 Thread Ankush Thakur
On Monday, May 30, 2016 at 5:04:27 AM UTC+5:30, Gregory Ewing wrote: > Alan Evangelista wrote: > > > if the interest is learning OOP concepts (and not OOP in Python), IMHO > > Java is better. > > The problem with this is that if you're not careful you'll > end up learning a lot of cruft that is

Re: Recommendation for Object-Oriented systems to study

2016-05-30 Thread Ankush Thakur
Hi Joseph, Thanks a lot for your help! At the moment, though, I find the idea of studying the standard library more lucrative. :) See you around! ~~Ankush On Sunday, May 29, 2016 at 9:31:26 PM UTC+5:30, Joseph Lee wrote: > Hi, > Replies inline. > > -Original Message- > From: Python-li

Re: python parsing suggestion

2016-05-30 Thread Jason Friedman
> > Trying to extract the '1,1,114688:8192' pattern form the below output. > > pdb>stdout: > '3aae5d0-1: Parent Block for 1,1,19169280:8192 (block 1,1,114688:8192) > --\n3aae5d0-1: > magic 0xdeaff2fe mark_cookie > 0x\ngpal-3aae5d0-1: super.status > 3s

Re: re.search - Pattern matching review

2016-05-30 Thread Ganesh Pal
On Sun, May 29, 2016 at 10:32 PM, Matt Wheeler wrote: > > > This doesn't seem to exactly match your code below, i.e. your code is > attempting to construct a tuple from groups 1 through 4. To meet this > specification I could just `return re.search('(?<=\(block > )[^(]*(?=\))', stdout).group()` >

python parsing suggestion

2016-05-30 Thread Ganesh Pal
Hi , Trying to extract the '1,1,114688:8192' pattern form the below output. pdb>stdout: '3aae5d0-1: Parent Block for 1,1,19169280:8192 (block 1,1,114688:8192) --\n3aae5d0-1: magic 0xdeaff2fe mark_cookie 0x\ngpal-3aae5d0-1: super.status 3super.cookie