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

pythonÖеÄתÒåÎÊÌ⣬¸ßÊÖÖ¸µã¹þ

ÀýÈ磺
ss = "E:\ALL\20100201_NEW\script\lib\core\core"
strs = ss.replace("\\", "/")

print strs

Êä³ö£º
E:/ALL�0201_NEW/script/lib/core/core

Ëü½«"\2010" ±ä³É"�"

ÔÙÈ磺
ss = r"E:\ALL\20100201_NEW\script\lib\core\core"

ÕâÑùûÓÐÎÊÌ⣬µ«ÊÇÎÒÏÖÔÚ·¾¶ÊÇÒ»¸ö²»È·¶¨µÄ£¬Ò²¾ÍÊÇÒ»¸ö±äÁ¿¸ÃÈçºÎ×öÄØ£¿
ss = "E:\\ALL\\20100201_NEW\\script\\lib\\core\\core"


LZÏÈ¿´ÏÂĬÈϱàÂëÊÇʲô
Python code:

>>> import sys
>>> sys.getdefaultencoding()
'ascii'
>>> ss = "E:\ALL\20100201_NEW\script\lib\core\core"
>>> strs = ss.replace("\\", "/")
>>> strs
'E:/ALL\x8100201_NEW/script/lib/core/core'


Ôٲο¼Ò»ÏÂÕâ¸öÒ³ÃæÓ¦¸Ã»áÓаïÖú
http://www.woodpecker.org.cn/diveintopython/xml_processing/unicode.html

ÆÚ´ýÍêÃÀ½â´ð~

×÷Ϊ±äÁ¿ÊäÈëÊDz»ÐèҪתÒåµÄ¡£¡£¡£¡£¡£


Python code:
Python 2.6.1 (r261:67517, Dec 4 2008, 16:51:00) [MSC v.1500 32 bit (Intel)]
Type "help", "copyright", "credits" or "license" for more


Ïà¹ØÎÊ´ð£º

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 ......

python ͼÏñ¶à±ßÐÎÇиî

pythonµÄPIL¿â×Ô´øµÄ·½·¨Ö»ÄܽøÐоØÐεÄÇиÈç¹ûÎÒÓÐÁËÒ»¸ö¶à±ßÐθ÷¸ö¶¥µãµÄ×ø±ê£¬ÈçºÎ¶ÔÏÖÓеÄͼƬ°´ÕÕÕâ¸ö¶à±ßÐνøÐÐÇиîÄØ£¿
²»Ò»¶¨ÒªÓÃPIL¿â£¬ÈκÎÄÜʵÏÖÕâ¸ö¹¦Äܵķ½·¨¶¼ÐС£

ͼƬÇиîµÄjs²»ÊǺܶàÂð£¿
......

¶®pythonµÄjava¸ßÊÖÇë½Ì - Java / Java SE

ÇëÎʸßÊÖ£¬pythonÀïµÄpopenÀàËÆjavaÀïµÄÄĸöÀà»òÕß·½·¨ÄØ£¿£¿ÁíÍâjython¿ª·¢java¸ÃÈçºÎʹÓÃjythonÄØ£¿£¿
1.¿ÉÄܺÍjavaÀïµÄRuntime.getRuntime().exec£¨"ϵͳÃüÁî"£©; Æô¶¯½ø³Ì
2.eclipseÏÂÔØjython ²å¼ ......

¡¾ÇóÖú¡¿¹ØÓÚpythonÖÐ×Ö½ÚÊý×éת»»³É×Ö·û´®

ÓÉÓÚÊdzõѧ£¬ÔÚЩÇë½Ì´ó¼Ò¡£

Python code:

from urllib import request
import struct
class csdn:
def __init__(self):
print ('Hello,this is a init')
def getContent(self,url) ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ