Not too many of us use the Amiga Standard Library (ASL). It is nice to know that Python is an integral part of Amiga Computer OS.
vegaseat
DaniWeb's Hypocrite
5,989 posts since Oct 2004
Reputation Points: 1,345
Solved Threads: 1,417
Right off the bat, I see a common mistake. Don't use 'file' as a variable name.
redyugi
Junior Poster in Training
80 posts since Jul 2009
Reputation Points: 15
Solved Threads: 30
BTW, with the advent of Python3 file is no longer a function name.
The regular Python distribution does not contain a module asl. This is specific to the Amiga OS.
My question is what do you mean with a dictionary?
In Python there is a container called dictionary that works with key:value pairs.
It would look something like this ...
word2number_dict = {
"zero": 0,
"one": 1,
"two": 2,
"three": 3,
"four": 4,
"five": 5,
"six": 6,
"seven": 7,
"eight": 8,
"nine": 9,
"ten": 10}
vegaseat
DaniWeb's Hypocrite
5,989 posts since Oct 2004
Reputation Points: 1,345
Solved Threads: 1,417
In regular Python 2.7 for Windows XP, this is working OK for me:
open('builtins.txt','w').write('\n'.join(dir(__builtins__)))
print open('builtins.txt').read()
pyTony
pyMod
5,359 posts since Apr 2010
Reputation Points: 782
Solved Threads: 852