473,466 Members | 1,412 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Lambda as a variable, not a Python keyword

1 New Member
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

Andy
Mar 2 '11 #1
2 2282
bvdet
2,851 Recognized Expert Moderator Specialist
Python reserved words cannot be used as identifiers.
Mar 2 '11 #2
Rabbit
12,516 Recognized Expert Moderator MVP
Just rename the variable, use a find and replace.
Mar 2 '11 #3

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

Similar topics

14
by: David MacQuigg | last post by:
I am starting a new thread so we can avoid some of the non-productive argument following my earlier post "What is good about Prothon". At Mr. Hahn's request, I will avoid using the name "Prothon"...
0
by: redguardtoo | last post by:
http://www.d2ksoft.com It is easy to add your own keyword. online demo video(gif,flash, avi) available
9
by: ted holden | last post by:
I have a project for which being able to write xmlrpc server code in python would be vastly preferable to the second choice solution for a number of reasons. Unfortunately, pretty much everything...
76
by: Nick Coghlan | last post by:
GvR has commented that he want to get rid of the lambda keyword for Python 3.0. Getting rid of lambda seems like a worthy goal, but I'd prefer to see it dropped in favour of a different syntax,...
4
by: e | last post by:
Question: WHAT IS LAMBDA? I can't figure out what it does from any documentation i've found anywhere. i doubt i need it but i still want to know what the heck it is/does/fixes/whatever!
6
by: Hansan | last post by:
Hi all. I am working on a webpage where I use python and html. When I want to send one variable to a new script/page I use the following code: 0) print '''<input type=hidden name="eventid"...
3
by: Xah Lee | last post by:
i'm trying to lookup on the detail of language Python's “lambda” function feature. I've seen it before, but today i need to read about it again since i'm writing. I quickly went to the index...
26
by: brenocon | last post by:
Hi all -- Compared to the Python I know and love, Ruby isn't quite the same. However, it has at least one terrific feature: "blocks". Whereas in Python a "block" is just several lines of...
3
Xx r3negade
by: Xx r3negade | last post by:
Hi, I am trying to convert the following procedural function into a lambda function: def inc_e(e): if e < 10: e = e + 1 return inc_e(e) else: return e f =...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.