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

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, md5
print "Content-type: text/html"
print""
print """<?xml version="1.0" encoding="utf-8" ?>
  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml">
  <head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <title>asdsadas</title></head><body>"""
form = cgi.FieldStorage()
if form.has_key('file'):
  fileitem = form['file']
  if not fileitem.file:
  print "Error: not a file upload.<P>"
  else:
   
  datas=[]
  while True:
  data = fileitem.file.read(1024)
  if not data:
  break
  datas.append(data)
  for d in datas:
  file(cgi.escape(fileitem.filename).decode("utf-8"),'wb').write(d)
else:


Ïà¹ØÎÊ´ð£º

¿´¿´Õâ¶ÎPython´úÂëÎÊÌâ³öÔÚÄÄ

ÕÕ×ÅÊéÉÏдµÄ£¬Ö´ÐÐʱ±¨´í£¨Python2.6£©
import wx
class InsertFrame(wx.Frame):
    def __init__(self,parent,id):
        wx.Frame.__init__(self,parent,id,'F ......

¡¶pythonÔ´ÂëÆÊÎö¡·£¬¼ì²é¼Ó·¨½á¹ûÊÇ·ñÒç³ö£¿

ÈçÌ⣬
¡¶pythonÔ´ÂëÆÊÎö¡·ÖеÚ32Ò³£¬
Óиö¼ì²é¼Ó·¨½á¹ûÊÇ·ñÒç³öµÄ´úÂ룬
´óÖÂÈçÏ£º
C/C++ code:
long a, b, x;
x = a + b;
//¼ì²é½á¹ûÊÇ·ñÒç³ö
if((x^a)>=0 || (x^b)>=0)
return OK; // ......

Ë­ÍÆ¼öÒ»±¾Ñ§Ï°PYTHONµÄÊ飬лл

Ë­ÍÆ¼öÒ»±¾Ñ§Ï°PYTHONµÄÊ飬лл
¡¶python¼òÃ÷½Ì³Ì¡·£¬¡¶pythonºËÐıà³Ì¡·

×÷Ϊϵͳ¹ÜÀí·½Ãæ£¬¡¶Python UNIXºÍLinuxϵͳ¹ÜÀíÖ¸ÄÏ¡·ÊDZ¾·Ç³£²»´íµÄÊé¡£
http://club.book.csdn.net/pic3/255142.jpg

ÒýÓÃ
×÷Î ......

c++ÖÐǶÈëpythonÄ£¿éÖ¸ÕëΪ¿Õ,Ϊʲô

#include <Python.h>
#include <string>
#include <vector>
#include <iostream>
using namespace std;
int main(int argc, char* argv[])
{
vector <string> ......

pythonÕýÔò±í´ïʽ ÈçºÎÈ¡³öÒÔÏÂ×Ö·û´® ¶àл

s='aaa111aaa,bbb222,333ccc,444ddd444,555eee666,fff777ggg'
ÓÃÕýÔò±í´ïʽȡ³ö ǰºó×ÖĸÏàͬµÄÊý¾Ý ½á¹ûÈçÏÂ:
111 ddd
лл~
Python code:

import re
s='aaa111aaa,bbb222,333ccc,444ddd444,555eee666,ff ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ