Re: [Tutor] noob question (Windows, Python 3.1)

2009-08-06 Thread Alan Gauld
"Che M" wrote C:\Windows> python some\path\to\myscript.py That way you will still see the error message after the program finishes. Or what about using IDLE? Good point, although IDLE can bring its own problems. But for this case IDLE would be a good choice. -- Alan Gauld Author o

Re: [Tutor] noob question (Windows, Python 3.1)

2009-08-06 Thread Che M
> Start a CMD window and run the python command by typing the command > at the DOS prompt. > > eg > > C:\Windows> python some\path\to\myscript.py > > > That way you will still see the error message after the > program finishes. Or what about using IDLE? _

Re: [Tutor] noob question (Windows, Python 3.1)

2009-08-06 Thread Alan Gauld
"Joshua Harper" wrote Ok, so I am trying to learn python, and I am reading many tutorial type If you are just learning Python downgrade from 3.1 to v2.6. Most tutorials are not up to 3.1 yet and there are many differences. v3.1 was a big change to the language. eg. The following code is for

Re: [Tutor] noob question (Windows, Python 3.1)

2009-08-06 Thread Dave Angel
Michael Connors wrote: 2009/8/6 Joshua Harper Ok, so I am trying to learn python, and I am reading many tutorial type things and I am kind of stuck with implementing some of the code... so for example the tutorial says "*To get the examples working properly, write the programs in a text fil

Re: [Tutor] noob question (Windows, Python 3.1)

2009-08-06 Thread Robert Berman
On Thu, 2009-08-06 at 03:44 -0400, Joshua Harper wrote: > Ok, so I am trying to learn python, and I am reading many tutorial > type things and I am kind of stuck with implementing some of the > code... so for example the tutorial says "To get the examples working > properly, write the programs i

Re: [Tutor] noob question (Windows, Python 3.1)

2009-08-06 Thread Michael Connors
2009/8/6 Joshua Harper > Ok, so I am trying to learn python, and I am reading many tutorial type > things and I am kind of stuck with implementing some of the code... so for > example the tutorial says "*To get the examples working properly, write > the programs in a text file and then run that w

[Tutor] noob question (Windows, Python 3.1)

2009-08-06 Thread Joshua Harper
Ok, so I am trying to learn python, and I am reading many tutorial type things and I am kind of stuck with implementing some of the code... so for example the tutorial says "*To get the examples working properly, write the programs in a text file and then run that with the interpreter*" Alright...s

Re: [Tutor] Noob question

2007-12-12 Thread Dick Moores
At 01:43 PM 12/11/2007, Dick Moores wrote: >Concatenating strings is still VERY slow in CPython 2.5.1 compared to >using join(), however. See . Code slightly modified and moved to Dick __

Re: [Tutor] Noob question

2007-12-11 Thread wesley chun
> > > This is fairly inefficient. Because strings in python are immutable > > > this approach causes a new string to be created every iteration. > > > >This is not true of CPython (the standard python.org release) since > >version 2.4: > >http://www.python.org/doc/2.4.4/whatsnew/node12.html#SECTIO

Re: [Tutor] Noob question

2007-12-11 Thread Dick Moores
At 04:19 AM 12/11/2007, Kent Johnson wrote: >Eric Brunson wrote: > > Hi Amit, > > > > This is fairly inefficient. Because strings in python are immutable > > this approach causes a new string to be created every iteration. > >This is not true of CPython (the standard python.org release) since >ver

Re: [Tutor] Noob question

2007-12-11 Thread Kent Johnson
Eric Brunson wrote: > Hi Amit, > > This is fairly inefficient. Because strings in python are immutable > this approach causes a new string to be created every iteration. This is not true of CPython (the standard python.org release) since version 2.4: http://www.python.org/doc/2.4.4/whatsnew/no

Re: [Tutor] Noob question

2007-12-10 Thread Amit Saxena
Hi Eric, Thanks for the information..since i m new to Python so didnt knew about this fact...thanks again for it, will keep it in mind while writing such a program. Amit On Dec 10, 2007 8:57 PM, Eric Brunson <[EMAIL PROTECTED]> wrote: > > Hi Amit, > > This is fairly ineffici

Re: [Tutor] Noob question

2007-12-10 Thread Eric Brunson
Hi Amit, This is fairly inefficient. Because strings in python are immutable this approach causes a new string to be created every iteration. While it may not be an issue with just 3 strings, it is much better to create your list and use "".join() to create the concatenation after the list

Re: [Tutor] Noob question

2007-12-10 Thread Amit Saxena
The simplest way i could think of: a=["apple","orange","banana"] b = "" for i in range(len(a)): b += a[i] print b Amit On Dec 10, 2007 6:48 AM, Alan Gauld <[EMAIL PROTECTED]> wrote: > "Eric Walstad" <[EMAIL PROTECTED]> wrote > > > You could also achieve the same result of concatenating a

Re: [Tutor] Noob question

2007-12-09 Thread Alan Gauld
"Eric Walstad" <[EMAIL PROTECTED]> wrote > You could also achieve the same result of concatenating a list of > strings by looping over the list items like so: > > b = '' > for fruit in a: >b += fruit > > print b And to add to the options you could use the formatting operator provided you k

Re: [Tutor] Noob question

2007-12-09 Thread Eric Walstad
Eric Brunson wrote: > quantrum75 wrote: >> Hi there, >> I am a newbie trying to actively learn python. >> My question is, >> Suppose I have a list >> a=["apple","orange","banana"] >> >> How do I convert this list into a string which is >> >> b="appleorangebanana" >> Sorry for my ignorance, > > No

Re: [Tutor] Noob question

2007-12-09 Thread Eric Brunson
quantrum75 wrote: > Hi there, > I am a newbie trying to actively learn python. > My question is, > Suppose I have a list > a=["apple","orange","banana"] > > How do I convert this list into a string which is > > b="appleorangebanana" > Sorry for my ignorance, No worries, every new language has its

[Tutor] Noob question

2007-12-09 Thread quantrum75
Hi there, I am a newbie trying to actively learn python. My question is, Suppose I have a list a=["apple","orange","banana"] How do I convert this list into a string which is b="appleorangebanana" Sorry for my ignorance, but I have been trying a "for" loop and trying the inbuilt str.join() metho