Re: [Tutor] Problem with little program

2010-03-17 Thread C M Caine
> Whilst I agree with the general principle to use raw_input, I don't > see how we can say that it is the problem here. Indeed so far as > I can tell we don't even know what the problem here is other than > that the OP is trying to call the function he has defined in > another file. > > > -- > Alan

Re: [Tutor] Problem with little program

2010-03-14 Thread Andre Engels
On Sat, Mar 13, 2010 at 7:56 PM, Marco Rompré wrote: > Hello I have a little problem, I am trying to define a function ligneCar(n, > ca) that would print n times the caracters ca. > For now I have the user entering a short sentence corresponding to ca. > Here is my code: > def ligneCar(n,ca): >   

Re: [Tutor] Problem with little program

2010-03-13 Thread Alan Gauld
"C M Caine" wrote That's an easy mistake to make. Simply use raw_input instead of input. The former will always return a string, the latter treats whatever you enter as executable python code. Whilst I agree with the general principle to use raw_input, I don't see how we can say that it is t

Re: [Tutor] Problem with little program

2010-03-13 Thread C M Caine
That's an easy mistake to make. Simply use raw_input instead of input. The former will always return a string, the latter treats whatever you enter as executable python code. You almost never want to use input. raw_input is safer. On 13 March 2010 18:56, Marco Rompré wrote: > > Hello I have a li

Re: [Tutor] Problem with little program

2010-03-13 Thread Alan Gauld
"Marco Rompré" wrote def ligneCar(n,ca): c=0 while c The bottom two lines are not part of the function, they will be executed when you import the file - is that really what you wantr? then in another python file I want to recall my function ligne_Car but it is not working. So show