[Tutor] Fwd: help

2012-04-30 Thread viral shah
I want to print below matrix. can any one suggest me the method for the same 1 2 3 4 5 6 7 8 9 Thanks -- Viral Shah IT Department, E-mail : shahviral...@gmail.com Mobile : (+91) 9722312220 -- Viral Shah IT Department, E-mail : shahvi

Re: [Tutor] Fwd: help

2012-04-30 Thread Alan Gauld
On 30/04/12 08:00, viral shah wrote: I want to print below matrix. can any one suggest me the method for the same 1 2 3 4 5 6 7 8 9 print ''' 1 2 3 4 5 6 7 8 9 ''' But I suspect yo

Re: [Tutor] Fwd: help

2012-04-30 Thread Mark Lawrence
On 30/04/2012 08:00, viral shah wrote: I want to print below matrix. can any one suggest me the method for the same 1 2 3 4 5 6 7 8 9 Thanks ___ Tutor maillist - Tutor@python.org To unsubscr

Re: [Tutor] Fwd: help

2012-04-30 Thread spawgi
What does your input look like? Please provide that information. Regards, - SWP On Mon, Apr 30, 2012 at 12:30 PM, viral shah wrote: > > > I want to print below matrix. > > can any one suggest me the method for the same > > 1 2 3 > 4 5 6 > 7 8

[Tutor] Python Variable Addition

2012-04-30 Thread viral shah
Hi I'm new in the learning of python I want to make simple code for two variable addition Please help me in the following code *x = 12 print x y =20 print y z = x+y print 'Addition of above two numbers are : ' + int.z * when I run this same I got an error message : *AttributeError: type object

Re: [Tutor] Python Variable Addition

2012-04-30 Thread Kapil Shukla कपिल शुक्‍ला
Viral You should be doing this "Addition of two numbers is" + str(x+y) + operator works on same datatypes and int being one of the built in objects in python does not have a method z U shld use str() or int() to do type conversion -Kapil कपिल शुक्‍ला -Original Message- From: viral s

Re: [Tutor] Python Variable Addition

2012-04-30 Thread Dave Angel
On 04/30/2012 05:50 AM, viral shah wrote: > Hi > > I'm new in the learning of python > > I want to make simple code for two variable addition > > Please help me in the following code > > *x = 12 > print x > y =20 > print y > z = x+y > print 'Addition of above two numbers are : ' + int.z > * > when

[Tutor] Imaplib Select Fails while connecting folder(**Labelname) of gmail

2012-04-30 Thread Anurag Maherchandani
I am using imaplib module for connecting to Gmail Imap, and i am getting the below mentioned error. I am using select command to connect Labelname is **LabelName I Get this Error: resp, data = self._imap.select("**LabelName") File "/usr/lib/python2.6/imaplib.py", line 642, in select

Re: [Tutor] Python Variable Addition

2012-04-30 Thread Alan Gauld
On 30/04/12 11:00, Kapil Shukla कपिल शुक्‍ला wrote: Viral You should be doing this "Addition of two numbers is" + str(x+y) There is no need for str() since print implicitly calls string to convert objects to string format. Also the addition is not needed since print takes a comma separated l

Re: [Tutor] Python Variable Addition

2012-04-30 Thread Mark Lawrence
On 30/04/2012 18:36, Alan Gauld wrote: On 30/04/12 11:00, Kapil Shukla कपिल शुक्‍ला wrote: Viral You should be doing this "Addition of two numbers is" + str(x+y) There is no need for str() since print implicitly calls string to convert objects to string format. Also the addition is not needed

Re: [Tutor] Python Variable Addition

2012-04-30 Thread Alan Gauld
On 30/04/12 19:27, Mark Lawrence wrote: print 'Addition of above two numbers are : ', z Except that you'll get two spaces after the colon :) OK thats true, Try this: print 'Addition of above two numbers are :', z for one. :-) But if the number of spaces is critical string formatting is be

[Tutor] question about listing variables defined since session started

2012-04-30 Thread Comer Duncan
Hi, I have a newbie type question. Say I have started a python (or ipython) session and have done some imports and have also defined some new variables since the session started. So, I have in my current namespace a bunch of things. Suppose I want to list just those variable names which have b

Re: [Tutor] question about listing variables defined since session started

2012-04-30 Thread Robert Sjoblom
On 30 April 2012 23:25, Comer Duncan wrote: > Hi, > > I have a newbie type question.  Say I have started a python (or > ipython) session and have done some imports and have also defined some > new variables since the session started.  So, I have in my current > namespace a bunch of things. Suppose

Re: [Tutor] Python Variable Addition

2012-04-30 Thread Mark Lawrence
On 30/04/2012 19:40, Alan Gauld wrote: On 30/04/12 19:27, Mark Lawrence wrote: print 'Addition of above two numbers are : ', z Except that you'll get two spaces after the colon :) OK thats true, Try this: print 'Addition of above two numbers are :', z for one. :-) But if the number of sp

Re: [Tutor] Python Variable Addition

2012-04-30 Thread Steven D'Aprano
Mark Lawrence wrote: On 30/04/2012 19:40, Alan Gauld wrote: But if the number of spaces is critical string formatting is better still. And better than string addition. True indeed, but which of the three versions of string formatting that I'm aware of? Any of them. -- Steven __

Re: [Tutor] Python Variable Addition

2012-04-30 Thread Mark Lawrence
On 01/05/2012 00:35, Steven D'Aprano wrote: Mark Lawrence wrote: On 30/04/2012 19:40, Alan Gauld wrote: But if the number of spaces is critical string formatting is better still. And better than string addition. True indeed, but which of the three versions of string formatting that I'm awa

Re: [Tutor] question about listing variables defined since session started

2012-04-30 Thread Alan Gauld
On 30/04/12 22:25, Comer Duncan wrote: I have a newbie type question. Say I have started a python (or ipython) session and have done some imports and have also defined some new variables since the session started. So, I have in my current namespace a bunch of things. Suppose I want to list ju

Re: [Tutor] question about listing variables defined since session started

2012-04-30 Thread Steven D'Aprano
Comer Duncan wrote: Hi, I have a newbie type question. Say I have started a python (or ipython) session and have done some imports and have also defined some new variables since the session started. So, I have in my current namespace a bunch of things. Suppose I want to list just those variab

Re: [Tutor] question about listing variables defined since session started

2012-04-30 Thread Robert Sjoblom
> What's "who and whos"? They're matlab functions: who lists the variables currently in the workspace. whos lists the current variables and their sizes and types. It also reports the totals for sizes. -- best regards, Robert S. ___ Tutor maillist - Tu

Re: [Tutor] question about listing variables defined since session started

2012-04-30 Thread Steven D'Aprano
Robert Sjoblom wrote: On 30 April 2012 23:25, Comer Duncan wrote: Hi, I have a newbie type question. Say I have started a python (or ipython) session and have done some imports and have also defined some new variables since the session started. So, I have in my current namespace a bunch of t

Re: [Tutor] Imaplib Select Fails while connecting folder(**Labelname) of gmail

2012-04-30 Thread Steven D'Aprano
Anurag Maherchandani wrote: I am using imaplib module for connecting to Gmail Imap, and i am getting the below mentioned error. I am using select command to connect Labelname is **LabelName I Get this Error: resp, data = self._imap.select("**LabelName") File "/usr/lib/python2.6/imaplib