²ÂÊý×Ö——Python°æ
ÖÕÓÚÍêÁ˸ßһʱһ¸öССµÄÔ¸Íû£¬Ð´Ò»¸ö²ÂÊý×ÖµÄСÓÎÏ·£¡
Ï×ÉÏÔ´´úÂ룡
Python code:
#! /usr/bin/env python
# -*- coding:gb2312 -*-
import random
class game:
def __init__(self):
self.nub = 5 #¿ØÖÆÉú³ÉµÄËæ»úÊýλÊý£¬Î»ÊýΪnub-1
self.number = 0 #³õʼ»¯Ëæ»úÊý
self.comparer = "" #³õʼ»¯ Ìáʾ
self.limit = 9 #¿ØÖÆÿ¾ÖÓÎÏ·»ú»á
def run(self): #³ÌÐò¿ªÊ¼
go = raw_input("ÇëÊäÈë(1)¿ªÊ¼ÓÎÏ·£º")
if int(go)==1:
self.main()
def main(self): #Ö÷³ÌÐò
self.getnumber()
a = "ÇëÊäÈë"+str(self.nub-1)+"λµÄÕûÊý:"
intstr = ""
count = 0
while intstr!="999999":
intstr = raw_input(a)
if (len(intstr) < (self.nub-1)) or (len(intstr)>(self.nub-1)):
print "ÓÎÏ·ÖØпªÊ¼£¬ÇëÊäÈë"+str(self.nub-1)+"λÕûÊý£¡"
count = 0
continue
if intstr == self.number:
print "Äã²Â¶ÔÁË£¡"
break
self.compare(intstr,self.number)
print "Äã²Â´íÁË£¬Ìáʾ£º" + self.comparer
count +=1
if
Ïà¹ØÎÊ´ð£º
±¾ÎÄÕª×Ô¡¶¿É°®µÄPython¡·¡°¹âÅ̹ÊÊ¡±CDay-1 ʵÓû¯ÖÐÎÄ¡£
[img]http://t.douban.com/mpic/s3901817.jpg[/img]
CDay-1 ʵÓû¯ÖÐÎÄÖÐÎÄ´¦Àí£¬Íê³É¹¦ÄܵÄʵÓû¯
ÄãÅöµ½99%µÄÎÊÌ⣬ÆäËûÈË֮ǰÒѾÓöµ½¹ýÁË£¬Ë ......
¸Õ½Ó´¥£¬¸Ð¾õ¹¦ÄܱȽÏÇ¿´ó£¬Ö÷ÒªÊÇÕ³ºÏÐԺ㬿ÉÒÔÓлú½áºÏÆäËûÓïÑÔ¡£µ«²»Ã÷°×ËüÖ÷ÒªÓ¦ÓÃÓÚʲôÁìÓò£¬Ö÷Òª×öÄÇ·½ÃæµÄ¶«¶«¡£¿ª·¢ERPϵͳÊÇ·ñ¿ÉÐУ¿
»ù±¾ÉÏʲô¶¼¿ÉÒÔ×ö
½ñÌìÈ¥¿´ÁËһϣ¬»ù±¾ÉÏʲô ......
ÒÑÖªPython ÖУº
s = unicode("²âÊÔ", "gb2312")
s = u'\u6d4b\u8bd5'
print s
²âÊÔ
ÔÚDelphiÀïÃæÈçºÎ½«\u6d4b\u8bd5ÕâÑùµÄ»¹Ô³ÉGb2312µÄºº×ÖÄØ£¿
ÕÒµ½¸ö·½·¨
......
ËÍƼöÒ»±¾Ñ§Ï°PYTHONµÄÊ飬лл
¡¶python¼òÃ÷½Ì³Ì¡·£¬¡¶pythonºËÐıà³Ì¡·
×÷Ϊϵͳ¹ÜÀí·½Ã棬¡¶Python UNIXºÍLinuxϵͳ¹ÜÀíÖ¸ÄÏ¡·ÊDZ¾·Ç³£²»´íµÄÊé¡£
http://club.book.csdn.net/pic3/255142.jpg
ÒýÓÃ
×÷Î ......
·¢ÏÖpython2.6
import httplib
conn=httplib.HTTPSConnection('x.x.x.x')
conn.request('','')
rd=conn.getresponse()
conn.close()
ÕâÑù½áÊøºó»á±ä³ÉCLOSE_WAIT״̬£¬ÎÒ ......