By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,898 Members | 1,162 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,898 IT Pros & Developers. It's quick & easy.

Lambda as a variable, not a Python keyword

P: 1
Apologies in advance for a potentially straightforward question.
I am recasting several shell scripts (for GRASS GIS functions) in Python (with which I am less familiar), but am running into problems as one input argument for a GRASS module that I wish to call is called 'lambda' which is a Python keyword. Is there something I can invoke to force the parsing of this as an ordinary, non-keyword variable?

For example, I would like to be able to define lambda=2 in a GRASS function call, but as part of a Python script.

many thanks

Mar 2 '11 #1
Share this Question
Share on Google+
2 Replies

Expert Mod 2.5K+
P: 2,851
Python reserved words cannot be used as identifiers.
Mar 2 '11 #2

Expert Mod 10K+
P: 12,383
Just rename the variable, use a find and replace.
Mar 2 '11 #3

Post your reply

Sign in to post your reply or Sign up for a free account.