#!/usr/bin/env python3#file name: threadtest.py# -*- coding:utf8 -*-# -version:1.0-import threading, time, socketclass Server(): '''接收消息的服务器类''' def _...
分类:
编程语言 时间:
2015-05-14 13:54:30
阅读次数:
199
下载安装包 # wget http://www.python.org/ftp/python/3.3.4/Python-3.3.4.tgz解压 # tar -xzvf Python-3.3.4.tgz为新版本的python创建一个路径 # mkdir /usr/local/python3安装 ...
分类:
编程语言 时间:
2015-05-13 19:01:35
阅读次数:
140
MFC中CString是一个方便的字符串操作的类, 然而很多函数需要传递字符指针, 这就需要进行CString和普通字符串的转换。1、CString用作C字符串常量。直接使用强制类型转换即可, 如:[cpp]view plaincopyCStringstrSports(_T("HockeyisBes...
分类:
编程语言 时间:
2015-05-13 14:33:02
阅读次数:
145
hello.py#!/usr/local/bin/python3.4count=0while(count<9): print('the count is:',count) count=count+1;print('good bye!')运行:./hello.py
分类:
编程语言 时间:
2015-05-13 12:20:01
阅读次数:
131
Python通过调用tkinter库来实现图形化。Python中的窗口更加内容大小自动缩放。例1:创建一个简单的窗口:from tkinter import * #引入tkinter库root = Tk() #创建一个主窗口,Tk(className='aaa')定义一下参数值root....
分类:
编程语言 时间:
2015-05-13 00:43:09
阅读次数:
122
1. ary.splice(index,number,x1,x2,………xn)splice函数可以实现数组或者字符串的删除/添加/替换var a=[1,2,3,4,5,6];
var b=a.splice(1,2);
console.log(b);//b为返回的删除元素数组,b=[2,3]
console.log(a);//splice会之间对元素组a进行操作,这时a=[1,4,5,6]2. ary...
分类:
Web程序 时间:
2015-05-12 23:13:44
阅读次数:
316
vim hello.py#!/usr/local/bin/python3.4str=input('pls intput same message:');print('you had enterd the string:'+str);运行:完。
分类:
编程语言 时间:
2015-05-12 15:06:19
阅读次数:
130
1 #encoding:utf-8 2 import struct 3 4 myfile = open("D:\\Backup\\我的文档\\spider.sav","rb+") 5 6 myfile.seek(368,0) 7 myfile.write(struct.pack('I',100...
分类:
编程语言 时间:
2015-05-12 13:20:08
阅读次数:
215
题目: 编写一个函数reverse_string(char * string)(递归实现)
实现:将参数字符串中的字符反向排列。
要求:不能使用C函数库中的字符串操作函数。
思路分析:以ABCDEFGH为例,每次将字符串的首字符和尾字符进行交换。
1、将A与I交换,此时字符串变为IBCDEFGA,而递归的字符串变成了BCDEFG;
2、将B和G交换,此时字符串变成IGCDEFBA,而递归...
分类:
其他好文 时间:
2015-05-12 11:32:08
阅读次数:
162
mkdir -p /workcd /workgwet https://www.python.org/ftp/python/3.4.3/Python-3.4.3.tar.xztar -axf Python-3.4.3.tar.xzcd Python-3.4.3./configuremakemake i...
分类:
编程语言 时间:
2015-05-12 10:47:55
阅读次数:
121