Hi,
I'm new to Python and am very impressed with it. Unfortunately I am not yet
at the stage where I can convert the GFA Basic code below into Python. Can
anyone help please? Any response appreciated and will certainly help me to
understand more about Python. BTW This is not a challenge to Py
Yes indeed. I didn't think of list comprehensions until after I sent the
response.
That syntax is still new to me -- I only wrote my first list comprehension
a month ago! It is a much more clear and Pythonic syntax.
I wish that answer had come to my mind first, but I've still got
map and lambda o
I will be out of the office starting 04/08/2002 and will not return until
04/10/2002.
___
ActivePython mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Tom Churm wrote:
> i've found & adapted the following simple python script that copies one text
> file to another text file. the script works o.k., but only when i enter the
> name of the text file (both original, and the name of the new text file)
> surrounded by "double quotes".
>
> i don't
I'm a newbi too, but I think I read that input is for integers and rawinput
is for strings...might help
Joe Youngquist
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Tom
Churm
Sent: Monday, April 08, 2002 10:57 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED
Input evaluates the input string that the user
enters, which you don't want here. Try using
raw_input.
mike
---
>From the docs:
input([prompt])
Equivalent to eval(raw_input(prompt)). Warning: This function is not safe
from user errors! It expects a valid Python expression as inpu
Bob,
I have add a bug for this here:
http://bugs.activestate.com/ActivePython/show_bug.cgi?id=19420
Thank you. We will look into this as soon as we can.
Sincerely,
Trent
[Bob Kline wrote]
> On Mon, 1 Apr 2002, David Ascher wrote:
>
> > - We've made some changes to the Python Package M
I will be out of the office starting 04/08/2002 and will not return until
04/10/2002.
___
ActivePython mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Noah Spurrier wrote:
> You want to use map and lamdda. This works on your list:
> map(lambda x: x.replace('\n',''), MyList)
Why not list comprehensions? Most places where map/filter and lambda are
used, a list comp is easier and clearer (and usually faster):
MyList = [x.replace('\n','') for x
hi,
i've found & adapted the following simple python script that copies one text
file to another text file. the script works o.k., but only when i enter the
name of the text file (both original, and the name of the new text file)
surrounded by "double quotes".
i don't understand why this is.
You want to use map and lamdda. This works on your list:
map(lambda x: x.replace('\n',''), MyList)
Also remember that Strings have their own replace method, so
if you don't really need to do a regular expression substitution
then String.replace() is faster.
I always thought lambda expression were
11 matches
Mail list logo