Re: [Tutor] how-to generate specific lines of text from two python lists

2017-06-21 Thread Peter Otten
Tahir Hafiz wrote: > Hi All, > > My python skills are limited but I have managed to generate a couple > of lists using python and the psycopg2 library by querying a postgress > table and it's columns. > I would like to use the two generated lists from the python script to > create a file called u

[Tutor] how-to generate specific lines of text from two python lists

2017-06-21 Thread Tahir Hafiz
Hi All, My python skills are limited but I have managed to generate a couple of lists using python and the psycopg2 library by querying a postgress table and it's columns. I would like to use the two generated lists from the python script to create a file called upgrade_email_addresses.sql (and th

Re: [Tutor] Class

2017-06-21 Thread Alan Gauld via Tutor
On 20/06/17 23:39, Rex Florian via Tutor wrote: > Can someone explain how Python achieves the vector addition of more than 2 > vectors > without some kind of looping? > > class Vector: >def __init__(self, a, b): >def __str__(): >def __add__(self,other): > return Vector(self.a +

[Tutor] Class

2017-06-21 Thread Rex Florian via Tutor
Hello, Below is a class I am using to comprehend how class works. The code came from tutorialspoint.com and executes correctly but I do not understand why it works. The original example defined just v1 and v2. I decided to experiment and instantiated v3. The executed the print statement yiel