python实现文件上传功能

服务器端

#coding=utf-8

import socket
from socket import *

HOST=''
PORT=8888

f_name = 'coco2dxcplus_copy.jpg'


class sock(object):
    # 把一些固定的语句放入init中
    def __init__(self):
        print '服务器启动.....'
        # self.server_soc =socket(AF_INET, SOCK_STREAM)
        # self.server_soc.bind((HOST, PORT))
        # self.server_soc.listen(10)
        # self.f_name = 'coco2dxcplus_copy.jpg'
        # print ('服务器启动')
        # while True:
        #     self.conn=self.server_soc.accept()[0]
        #     buffer=[]
        #     while True:
        

你可能感兴趣的:(python实现文件上传功能)