Форум сайта python.su
from socket import *
s = socket(AF_INET6, SOCK_STREAM)
s.connect(('fe80::20c:29ff:fe1e:eb7e%4', 7777))
#!/usr/bin/env python
#coding:utf-8
import MySQLdb
db = MySQLdb.connect(host="localhost", db="dbname", user="stat", passwd="11112222")
c = db.cursor()
c.execute=('SELECT count(*) FROM ipacct LIMIT 1;')
db.commit()
result = c.fetchone()
c.close()
db.close()
C:\Python25\Scripts>django-admin.py
Traceback (most recent call last):
File "C:\Python25\Scripts\django-admin.py", line 2, in <module>
from django.core import management
File "C:\Python25\Lib\site-packages\django\core\management\__init__.py", line
10, in <module>
get_version = django.get_version
AttributeError: 'module' object has no attribute 'get_version'
try:
IG.save()
except django.db.IntegrityError, e:
...
form.errors['name'] = 'Already exists...!'
import random
import sys
class Gopnik(object):
def __init__(self, rayon, semki):
self.rayon = rayon
self.semki = semki
def ask_where(self):
print u"ты с какого района? ",
answer = sys.stdin.readline()
if not self.rayon in answer:
questions_list = [u'а ты вообще кто по жизни?', u'Ты Васю знаешь?', u'Ты чё попутал?']
return random.choice(questions_list)
class MyGrid(wx.grid.Grid): def DrawCellHighlight(self, dc, attr): print 1