<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"><channel><title><![CDATA[PHPdesigner-PHP博客|PHP技术博客|PHP技术站|PHP资源|PHP研究]]></title><description><![CDATA[PHPdesigner-PHP博客,PHP技术博客,PHP技术站,factory mode,PHP技术,PHP,MySQL,linux,SPL库,测试,zend studio7.0]]></description><link><![CDATA[http://www.phpcq.com]]></link><language><![CDATA[zh-cn]]></language><docs><![CDATA[KANGYUNCHUAN.COM Document Center-cn]]></docs><generator><![CDATA[Rss Generator By KANGYUNCHUAN.COM]]></generator><item><title><![CDATA[本博客暂不更新日志!]]></title><link><![CDATA[http://www.phpcq.com/id/234.html]]></link><description><![CDATA[   由于博客重构中，暂时不再更新日志! 
  新版博客：采用Python的Django框架开发。。。
  

      
      ]]></description><author><![CDATA[KangYunChuan]]></author><pubDate><![CDATA[2010-08-19 15:23:36]]></pubDate></item><item><title><![CDATA[Python中socket的运用(构建客户端)]]></title><link><![CDATA[http://www.phpcq.com/id/233.html]]></link><description><![CDATA[#!/usr/bin/env python
#coding=UTF-8
#Python Socket client端的构建
#Author www.PHPdesigner.org Time:2010-07-23 13:35
#Application-Language:Python2.x
import socket

client = socket.socket()
server = socket.gethostname()
port = 1987
client.connect((server,port))

print client.recv(1024)

client.close()      ]]></description><author><![CDATA[KangYunChuan]]></author><pubDate><![CDATA[2010-07-23 14:05:15]]></pubDate></item><item><title><![CDATA[Python中socket的运用(构建服务器端)]]></title><link><![CDATA[http://www.phpcq.com/id/232.html]]></link><description><![CDATA[#!/usr/bin/env python
#coding=UTF-8
#使用Python SocketServer模块构建Socket-Server
#Author www.PHPdesigner.org Time:2010-07-23 13:30
#Application-Language:Python2.x

import os
from SocketServer import TCPServer,StreamRequestHandler

class MyHandler(StreamRequestHandler):
    def handle(self):
        addr = self.request.getpeername() #获取连接对端地址
        

        #print 'connectting server',addr
        #print data
        print &quot;Delete file!&quot;
        if os.path.exists('1.txt'):
            os.remove('1.txt')
            str = 'Delete ok!'
        else:
            str = 'Does not exist!'
        
        self.wfile.write(str)#向客户端发送数据

host = '' 
port = 1987  
server = TCPServer((host,port),MyHandler) #生成TCP服务器
server.serve_forever() #开始监听并处理连接
]]></description><author><![CDATA[KangYunChuan]]></author><pubDate><![CDATA[2010-07-23 14:04:45]]></pubDate></item><item><title><![CDATA[Python操作Mysql的简单类]]></title><link><![CDATA[http://www.phpcq.com/id/231.html]]></link><description><![CDATA[#!/usr/bin/env python
#coding=UTF-8
#MYSQL数据操作类 
#Author:www.phpdesigner.org Time:2010.7.21 Application-Language:Python2.x
import MySQLdb
import os,sys
class  Mysql:
    conn = '' #数据库连接对象
    cursor = '' #游标
    
    '''
    构造函数---对数据库的连接--字符集编码设置
    '''
    def __init__(self,host = 'localhost',user = 'root',
                 password = '123456',dbName = 'test',charset = 'utf8'):
        try:
            self.conn = MySQLdb.connect(host,user,password,dbName)
        except Exception,e:
            print e
            sys.exit()
        self.cursor = self.conn.cursor()
        self.query('SET NAMES %s' % charset)
        
    '''
    SQL执行方法
    '''
    def query(self,sql):
        return self.cursor.execute(sql)
        
    '''
    数据查询方法
    '''   
    def show(self):
         return self.cursor.fetchall()
    
    '''
    析构函数
    '''
    def __del__(self):
        self.cursor.close()
        self.conn.close()

    
if __name__ == '__main__':
    mysql = Mysql()
    mysql.query('SELECT * FROM user')
    data = mysql.show()
    for x in data:
        print x[1]      ]]></description><author><![CDATA[KangYunChuan]]></author><pubDate><![CDATA[2010-07-21 13:41:48]]></pubDate></item><item><title><![CDATA[利用手机SSH连接Linux服务器]]></title><link><![CDATA[http://www.phpcq.com/id/229.html]]></link><description><![CDATA[  
  无意间，在国外手机软件下载站，发现的一个利用手机远程连接Linux服务的软件，该软件很使用很方便，支持java的手机都可使用，但只能用移动的cmnet方式接入 


软件下载地址

http://www.phpdesigner.org/Download/ssh.zip



这是我用Moto e8操作时的截图：

                                 [img]src=&quot;/Download/e8_ssh.jpg&quot; width=&quot;450&quot; height=&quot;241&quot;[/img]  



      
      ]]></description><author><![CDATA[KangYunChuan]]></author><pubDate><![CDATA[2010-07-20 10:08:30]]></pubDate></item><item><title><![CDATA[wxPython多行文本框范例]]></title><link><![CDATA[http://www.phpcq.com/id/228.html]]></link><description><![CDATA[#!/usr/bin/env python
#-*- coding:utf-8 -*-
#作者:www.phpdesigner.org 
#多行文本框
import wx
class TextFrame(wx.Frame):
    def __init__(self):
        wx.Frame.__init__(self,None,-1,u\'多行文本框\',size = (250,150))
        panel = wx.Panel(self,-1)
        
        self.multiText = wx.TextCtrl(panel,-1,\'python is a good language\',
	pos = (10,10),size = (180,80),
                                style = wx.TE_MULTILINE | 
				wx.TE_CENTER | wx.TE_PROCESS_ENTER)
        
        self.multiText.SetBackgroundColour(\'red\')
        self. multiText.SetFocus()
        
        self.Bind(wx.EVT_TEXT_ENTER,self.onClick,self.multiText)
        
    def onClick(self,evt):
        wx.MessageBox(\'%s\'% (self.multiText.GetValue()),\'hot\')
        self.multiText.Clear()
        
if __name__ == \'__main__\':
    app = wx.PySimpleApp()
    frame = TextFrame()
    frame.Show()
    
    app.MainLoop()]]></description><author><![CDATA[KangYunChuan]]></author><pubDate><![CDATA[2010-07-13 11:27:45]]></pubDate></item></channel></rss>
