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
Ïà¹ØÎÊ´ð£º
ÎÒÿ´ÎÉÏ´«µÄÎļþ¶Áµ½µÄÊý¾Ý¶¼²»ÕýÈ·¡£2M µÄͼƬ¶ÁµÃ10¶àK ¡£¡£ÄÄλ´óÏÀ¿ÉÒÔ°ï°ïÎÒ°¡¡£
#!D:\ProgrammerTools\python26\python.exe
#encoding=utf-8
import cgitb
import os
cgitb.enable()
import cgi,urllib ......
pythonµÄPIL¿â×Ô´øµÄ·½·¨Ö»ÄܽøÐоØÐεÄÇиÈç¹ûÎÒÓÐÁËÒ»¸ö¶à±ßÐθ÷¸ö¶¥µãµÄ×ø±ê£¬ÈçºÎ¶ÔÏÖÓеÄͼƬ°´ÕÕÕâ¸ö¶à±ßÐνøÐÐÇиîÄØ£¿
²»Ò»¶¨ÒªÓÃPIL¿â£¬ÈκÎÄÜʵÏÖÕâ¸ö¹¦Äܵķ½·¨¶¼ÐС£
ͼƬÇиîµÄjs²»ÊǺܶàÂð£¿
......
ÇëÎʸßÊÖ£¬pythonÀïµÄpopenÀàËÆjavaÀïµÄÄĸöÀà»òÕß·½·¨ÄØ£¿£¿ÁíÍâjython¿ª·¢java¸ÃÈçºÎʹÓÃjythonÄØ£¿£¿
1.¿ÉÄܺÍjavaÀïµÄRuntime.getRuntime().exec£¨"ϵͳÃüÁî"£©; Æô¶¯½ø³Ì
2.eclipseÏÂÔØjython ²å¼ ......
ÓÉÓÚÊdzõѧ£¬ÔÚЩÇë½Ì´ó¼Ò¡£
Python code:
from urllib import request
import struct
class csdn:
def __init__(self):
print ('Hello,this is a init')
def getContent(self,url) ......