Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

python µÄsort

ÓÐÕâôһ¸ö°æ±¾ºÅµÄlist
version = ['1.0.1', '1.0.2', '1.0.21', '1.2.9', '1.2.11']
ÎÒÔõôÑùÄܶ԰汾ºÅµÄ´óС½øÐÐÅÅÐò£¬»ñµÃ×î´óµÄ°æ±¾ºÅ(1.2.11)
max »òÕßsort¶¼ÊǶÔ×Ö·û´®½øÐÐÅÅÐò£¬²»ÊÇÎÒÒªµÄ½á¹û
´´½¨Ò»¸öVersionÀ࣬ÀàÌṩһ¸ö¿ÉÒԱȽϴóСµÄ·½·¨£¬»òÕߣ¬ÔÚÀàÖÐÖØÔرȽÏÔËËã·û¡£ÕâÑù£¬ÔÚÒ»°ãµÄÅÅÐòº¯ÊýÖоͿÉÒÔÕýÈ·±È½ÏVersionµÄ´óС¹ØϵÁË¡£

Ö»ÒªÅÅÐòº¯ÊýÀàËÆÓÚC++ÖеÄÄ£°åº¯Êý£¬ÄÇôÄã¾Í¿ÉÒÔʵÏÖ¶ÔVersionÀàµÄÅÅÐò£¬·ñÔò£¬ÐèÒª×Ô¼ºÐ´Ò»¸öÅÅÐòº¯Êý¡£

´´½¨À಻Êǹؼü£¬¹Ø¼üÊDZȽϴóСµÄ·½Ê½£¬fibbery ÄãÓÐʲô±È½ÏºÃµÄ·½·¨Â𣿠»¹ÊÇÓÃ.·Ö¸î¿ª£¬Ò»¶ÎÒ»¶ÎµÄ±È½Ï£¿

ÎÒÈÏΪ¿Ï¶¨Òª·Ö¸î¿ª£¬×÷ΪÕûÊýÀ´±È½Ï¡£Ö®ËùÒÔÎÒÌá³ö´´½¨Ò»¸öÀà³öÀ´ÊÇΪÁË´úÂ븴ÓúͽµµÍ¿Í»§´úÂ븴ÔӶȡ£
ÀýÈ磺
C/C++ code:
class CVersion
{
int m_Major;
int m_Minor;
int m_Revision;
int m_Build;
public:
CVersion(string vstr);
bool operator <(const CVersion & v);
};
CVersion v1("1.1.9");
CVersion v2("1.1.10");
v1<v2;//true


def max(a, b):
    a1 = [int(item) for item in a.split('.')]
    b1 = [int(item) for item in b.split('.')]

    tempA1 = 0
    tempB1 = 0
    for i in range(len(a1)):
        tempA1 += a1[i] * (10 ** i)
  &nb


Ïà¹ØÎÊ´ð£º

PythonÖеÄUnicodeÔÚDelphiÈçºÎ»¹Ô­³ÉGb2312£¿

ÒÑÖªPython ÖУº
s = unicode("²âÊÔ", "gb2312")
s = u'\u6d4b\u8bd5'
print s
²âÊÔ

ÔÚDelphiÀïÃæÈçºÎ½«\u6d4b\u8bd5ÕâÑùµÄ»¹Ô­³ÉGb2312µÄºº×ÖÄØ£¿
ÕÒµ½¸ö·½·¨
......

IIS 7 python 2.6 cgi ÎļþÉÏ´«ÎÊÌâ

ÎÒÿ´ÎÉÏ´«µÄÎļþ¶Áµ½µÄÊý¾Ý¶¼²»ÕýÈ·¡£2M µÄͼƬ¶ÁµÃ10¶àK ¡£¡£ÄÄλ´óÏÀ¿ÉÒÔ°ï°ïÎÒ°¡¡£
#!D:\ProgrammerTools\python26\python.exe
#encoding=utf-8
import cgitb
import os
cgitb.enable()
import cgi,urllib ......

¡¾ÇóÖú¡¿C++ÈçºÎ²¶»ñPythonÖеÄÒì³£

C++Öе÷ÓÃpythonº¯Êý£¬·¢ÏÖpythonº¯ÊýµÄÒì³£ÔÚC++ÖÐÎÞ·¨²¶»ñ¡£
µ÷Óú¯ÊýÈçÏ£¬Çë´óÏÀ½â»ó
unsigned long CPythonHelper::Execute(const std::string& mml_cmd,
  u ......

PythonÐÂÊÖ±¨µ½ ´ó¼ÒÍƼö¸öIDE

×î½üÒ»¸öÏîÄ¿ÂíÉϾÍÒªÓÃPython±àÁË ´ó¼ÒÍƼö¸öIDE¡£¡£¡£
1 Ãâ·Ñ¡£¡£¡£
2 Ìå»ý×îºÃСһµã
3 ¹¦ÄÜÇ¿´ó
£¨ÅÅÃû²»·ÖÏȺ󡣡£¡£·Ï»°¡£¡££©

emacs,×î´óµÄÓŵãÊÇÒòΪ·ÇͼÐνçÃ棬ÓÃSSHÔ¶³ÌµÇ¼Ҳ¿ÉÒÔʹÓá£ËùÒÔ¿ÉÒÔÓ ......

python²é¿´class²ÎÊý

Àà:
class Test:
  def __init__(self,num1,num2):
  print num1,num2
ÓÃʲôº¯ÊýÄܲ鿴 TestÀàÓÐÁ½¸ö²ÎÊý
ÄܲéÂð Ë­ÖªµÀ
ÓÃdir ºÍinfoÖÇÄܲ鿴ÊôÐԺͷ½·¨

лл................ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ