I have no problem creating Python apps that create COM objects to work with Access
database, but
right now I have to run an external application to process the data in my Access
tables.
I want to be able to call Python FROM Access and not call Access from Python.
I would like to be able to cli
One way to do this is to simply create two dictionaries at the same time.
Each dictionary is the mirror of each other.
dict1={'aa':1, 'bb':2]
dict2={1:'aa', 2:'bb']
Not very elegant, but it's simple. This assumes that your dictionary is one-to-one.
For example, this dictionary wou
The old "function order definition" problem nails a newbie every time.
It's worth a note that this is why you always see this idiom in Python:
def fun1():
print 'Function 1'
def main ():
fun1 ()
fun2 ()
def fun2():
print 'Function 2'
if __name__ == '__main__' :
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
and lambda on the brain.
Thanks,
Noah
- Original Message -
From: "Jeff Shannon" <[EMAIL PROTECTED]>
To: "activepython list" <[EMAIL PROTECTED]>
Sent: Monday, April 08, 2002 10:22 AM
Subject: Re: How to remove a newline character
>
> Noah Spurrier w