Найти - Пользователи
Полная версия: windows // глючит питон
Начало » Python для новичков » windows // глючит питон
1
Megido
В консоли питона

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, почему так все происходит в этом мастдае?




py.user.next
Megido
#!C:\Python_32\python.exe
1) удали эту строку
2) почему у тебя питон 273 стоит в такой папке ?
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB