Re: [Tutor] from string to variable name

2006-10-05 Thread wesley chun
On 10/5/06, frank h. <[EMAIL PROTECTED]> wrote: > hello, i have a string variable that contains a name that I want to use as > a variablename setattr() won't work because that's only for objects which have attributes. you're talking about creating a (global or local) variable. i will also reco

Re: [Tutor] Luke, thanks a lot , here is the perfect code (as per ur suggestion)

2006-10-05 Thread Kent Johnson
Asrarahmed Kadri wrote: > What is this??? I cannot understand a single character.. Explain this in > length. > > *list1 = [ [ locals()["_[1]"][i-1][j-1]+locals()["_[1]"][i-1][j] if > (j != > 0 and j != i) else 1 for j in range(i+1) ] for i in > range(num_of_lines) ] OK, I guess I

Re: [Tutor] Book(s) about linux

2006-10-05 Thread Alan Gauld
"Bernard Lebel" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Sorry to use this list for such an OT subject. But I want to get > hands > down with Linux, and am looking for a book or two on the subject. > > I'm looking for information about installation, configuration, > optimisat

[Tutor] from string to variable name

2006-10-05 Thread Jonathon Sisson
By "string variable that contains a name that I want to use as a variablename" do you mean something like this: myString = "rotationalSpeed" rotationalSpeed = 4500 ?? In Python a dictionary is an excellent solution to this problem. The only other way to accomplish this (to my knowledge) is in P

[Tutor] OT: Book(s) about linux

2006-10-05 Thread Jonathon Sisson
Hello Bernard... Just to give you a pointer about Linux: If you're new, Fedora and Ubuntu are both relatively easy to learn, but powerful (I've never used Ubuntu (or Debian, for that matter), but I hear that Ubuntu is a really great distro). Stay away from Slackware and Gentoo, at least until yo

Re: [Tutor] Luke, thanks a lot , here is the perfect code (as per ur suggestion)

2006-10-05 Thread Asrarahmed Kadri
On 10/5/06, Kent Johnson <[EMAIL PROTECTED]> wrote: Asrarahmed Kadri wrote:> #Implementation of Pascal Triangle>> num_of_lines = input("How many lines you want to display") >> list1 = []>> for i in range(num_of_lines):> flag = 0> tmp = []> for j in range(i+1):> if flag == 0 or

Re: [Tutor] CGKit

2006-10-05 Thread Carlos
Hi Kent, Thanks for the info, I will send a mail to the plug-in developer. I didnt mention this before, Im an architect and my master thesis semester is beginning now. Last semester I was introduced to what is somehow known as morphogenetic design, to programming and to python. From that seme

Re: [Tutor] What is a Python "project"?

2006-10-05 Thread Dick Moores
At 03:00 PM 10/3/2006, Brian van den Broek wrote: >I've never used Wing, but unless its `project' concept is radically >different than many other editors, it isn't about organizing the files >on disk. Rather, it is about organizing a group of files into a >collection the editor can open in one swel

Re: [Tutor] OT: Book(s) about linux

2006-10-05 Thread Python
On Thu, 2006-10-05 at 11:33 -0400, Bernard Lebel wrote: > Hello, > > Sorry to use this list for such an OT subject. But I want to get hands > down with Linux, and am looking for a book or two on the subject. > > I'm looking for information about installation, configuration, > optimisation, and ma

Re: [Tutor] OT: Book(s) about linux

2006-10-05 Thread Dave Kuhlman
On Thu, Oct 05, 2006 at 11:33:17AM -0400, Bernard Lebel wrote: > Hello, > > Sorry to use this list for such an OT subject. But I want to get hands > down with Linux, and am looking for a book or two on the subject. > > I'm looking for information about installation, configuration, > optimisation,

Re: [Tutor] [Fwd: Re: from string to variable name]

2006-10-05 Thread Kent Johnson
Python wrote: > On Thu, 2006-10-05 at 09:17 -0500, Luke Paireepinart wrote: > (actually from Frank) >>> I have a parameterized string template, I publish it using >>> >>> print mytemplate % locals() > Original post asked to create variable in local namespace from string. >> so I want to assign a

[Tutor] OT: Book(s) about linux

2006-10-05 Thread Bernard Lebel
Hello, Sorry to use this list for such an OT subject. But I want to get hands down with Linux, and am looking for a book or two on the subject. I'm looking for information about installation, configuration, optimisation, and management of the Linux OS. Thanks Bernard __

Re: [Tutor] Luke, thanks a lot , here is the perfect code (as per ur suggestion)

2006-10-05 Thread Kent Johnson
Asrarahmed Kadri wrote: > #Implementation of Pascal Triangle > > num_of_lines = input("How many lines you want to display") > > list1 = [] > > for i in range(num_of_lines): > flag = 0 > tmp = [] > for j in range(i+1): > if flag == 0 or j == i: > tmp.append(1)#

Re: [Tutor] [Fwd: Re: from string to variable name]

2006-10-05 Thread Python
On Thu, 2006-10-05 at 09:17 -0500, Luke Paireepinart wrote: (actually from Frank) > > I have a parameterized string template, I publish it using > > > > print mytemplate % locals() Original post asked to create variable in local namespace from string. > so I want to assign a value to a variable w

[Tutor] Luke, thanks a lot , here is the perfect code (as per ur suggestion)

2006-10-05 Thread Asrarahmed Kadri
#Implementation of Pascal Triangle num_of_lines = input("How many lines you want to display") list1 = [] for i in range(num_of_lines):    flag = 0    tmp = []    for j in range(i+1):    if flag == 0 or j == i:    tmp.append(1)    # for the first or teh last element of the line  

Re: [Tutor] CGKit

2006-10-05 Thread Kent Johnson
Carlos wrote: > Hi Kent, > > Probably I'm totally missing something, but... No, your analysis looks correct to me. Sorry, this goes beyond my ability to help you. Is there a Maya or CGKit mailing list where you can ask? The compiled plugin may be available from another source. Kent > > I thi

Re: [Tutor] Help me with two dimensional arrays in Python

2006-10-05 Thread Kent Johnson
Asrarahmed Kadri wrote: > Its something very close. > What I want is: > > 1 > 1 1 > 1 2 1 > 1 3 3 1 > 1 4 6 4 1 > > This can be done using arrays, right or is there any other way?? Is this a homework assignment? A list of lists seems like the appropriate way to represent this, especially sin

Re: [Tutor] Help me with two dimensional arrays in Python

2006-10-05 Thread Asrarahmed Kadri
Thank you so much. I am trying to implement. I hope I can do it.   A gentle note: This is not a homework question. I am learning python as a part of my Project work.   On 10/5/06, Luke Paireepinart <[EMAIL PROTECTED]> wrote: Asrarahmed Kadri wrote:> Its something very close.> What I want is:>> 1> 1

[Tutor] [Fwd: Re: from string to variable name]

2006-10-05 Thread Luke Paireepinart
OOPS, forwarding my reply to frank. I accidentally sent it straight to him. --- Begin Message --- frank h. wrote: why I am not using a dictionary: well I am lazy, I do not want to explicitly construct a dictionary :) You don't have to explicitly construct it. You can add stuff to it. If by exp

Re: [Tutor] CGKit

2006-10-05 Thread Carlos
Hi Kent, Probably I'm totally missing something, but... I think there is not a compiled plug-in, if you go here http://cgkit.sourceforge.net/#download you are going to see that : " The Maya Python package (i.e. the Maya plug in and the actual Python package) is a separate package that can be d

Re: [Tutor] module loading

2006-10-05 Thread Mike Hansen
> -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] > Sent: Thursday, October 05, 2006 12:06 AM > To: tutor@python.org > Subject: [Tutor] module loading > > Newbie BioGrad student here (again): > > First, thanks for the help on the

Re: [Tutor] Help me with two dimensional arrays in Python

2006-10-05 Thread Luke Paireepinart
Asrarahmed Kadri wrote: > Its something very close. > What I want is: > > 1 > 1 1 > 1 2 1 > 1 3 3 1 > 1 4 6 4 1 > > This can be done using arrays, right or is there any other way?? They're not arrays, they're lists! arrays imply contiguous memory blocks and single data types. Lists are neither

Re: [Tutor] from string to variable name

2006-10-05 Thread Luke Paireepinart
frank h. wrote: > hello, i have a string variable that contains a name that I want to > use as a variablename > putting aside questions of why I would like to do that - i this > possible at all? > > so I want to assign a value to a variable whos name is available only > as a string to me. > tha

[Tutor] from string to variable name

2006-10-05 Thread frank h.
hello, i have a string variable that  contains a name that I want to use as a variablenameputting aside questions of why I would like to do that - i this possible at all?so I want to assign a value to a variable whos name is available only as a string to me. that variable does not exist yet in the

Re: [Tutor] Help me with two dimensional arrays in Python

2006-10-05 Thread Asrarahmed Kadri
Its something very close. What I want is:   1 1 1 1 2 1 1 3 3 1 1 4 6 4 1   This can be done using arrays, right or is there any other way?? My logic in C is:   int arr[5][5]; for (i=0;i<5;i++) {    flag = 0;    for (j=0;j<=i;j++) {    if (flag == 0 || j == i)  // print 1 if the array element is th

[Tutor] module loading

2006-10-05 Thread halamillo
Newbie BioGrad student here (again): First, thanks for the help on the root node variable last time. It was most helpful! Now, I am trying to load a new module into MacPython, but after doing $ python setup.py install, or $ python setup.py build, then $ python setup.py the files on the module I

Re: [Tutor] How do I make a variable that refers to an object have thesame label as the object's name ?

2006-10-05 Thread Alan Gauld
> when creating a series of objects, where each object represents a > field from > a submitted html form, how do I make variables that reference the > objects be > the same as the names of the respective objects ? The usual solution for this is to use a dictionary keyed by object name. There is

[Tutor] How do I make a variable that refers to an object have the same label as the object's name ?

2006-10-05 Thread tpc247
question for the Python crowd:when creating a series of objects, where each object represents a field from a submitted html form, how do I make variables that reference the objects be the same as the names of the respective objects ? For example, I have a class called Datum:class Datum:    def __in