Python 2.7.3 (default, Apr 10 2012, 23:31:26) [MSC v.1500 32 bit (Intel)] on win
32
Type "help", "copyright", "credits" or "license" for more information.
>>> import bsddb
>>> db = bsddb.btopen('wordsBSD.db', 'c')
>>> for i in range(10): db['%d'%i] = '%d'% (i*i)
...
>>> db
{'1': '1', '0': '0', '3': '9', '2': '4', '5': '25', '4': '16', '7': '49', '6': '
36', '9': '81', '8': '64'}
>>>
просто запуская скрипт в виндовсе, либо в cmd
#!C:\Python_32\python.exe
import bsddb
db = bsddb.btopen('wordsBSD.db', 'c')
for i in range(10): db['%d'%i] = '%d'% (i*i)
db
Traceback (most recent call last):
File "bsddb.py", line 3, in <module>
import bsddb
File "C:\Users\megido\Desktop\bsddb.py", line 5, in <module>
db = bsddb.btopen('wordsBSD.db', 'c')
[b]AttributeError: 'module' object has no attribute 'btopen'[/b]
C:\Users\megido\Desktop>C:\Python27_32\python.exe
Python 2.7.3 (default, Apr 10 2012, 23:31:26) [MSC v.1500 32 bit (Intel)]
32
Type "help", "copyright", "credits" or "license" for more information.
фейл!!!!
питон стоит 1, почему так все происходит в этом мастдае?