上一页 1 ··· 25 26 27 28 29 30 31 32 33 ··· 35 下一页
# -*- coding: utf-8 -*-"""Created on Sun Nov 25 15:56:01 2012@author: l"""import sqlite3db = sqlite3.connect(r'c:\imageDB.db')#fp=open(r'c:\title.jpg','rb')#data=fp.read();#fp.close()cur=db.cursor()#cur.execute('insert into cet_t values(" Read More
posted @ 2012-11-25 22:30 godjob Views(813) Comments(0) Diggs(0)
import sqlite3def sqlite_basic(): # Connect to db conn = sqlite3.connect('test.db') # create cursor c = conn.cursor() # Create table c.execute(''' create table if not exists stocks (date text, trans text, symbol text, qty real, price real) ... Read More
posted @ 2012-11-25 22:15 godjob Views(2005) Comments(0) Diggs(0)
遍历存元组的列表进行操作一堆xy坐标,找出x,y的左上角与右下角[python] view plaincopyprint?max_t=reduce(lambdax,y:(max(x[0],y[0]),max(x[1],y[1])),l)p;min_t=reduce(lambdax,y:(min(x[0],y[0]),min(x[1],y[1])),l)用zipfile写压缩包[python] view plaincopyprint?f=zipfile.ZipFile("testzip.zip","w",zipfile.ZIP_DEFLATED)f.wri Read More
posted @ 2012-11-25 21:50 godjob Views(308) Comments(0) Diggs(0)
#include <stdio.h>#include <sqlite3.h>#include <stdlib.h>static sqlite3 *db=NULL;static sqlite3_stmt *stmt=NULL;FILE *fp;long filesize=0;char *fflie;int main(int argc, char *argv[]){ int rc,i,j; rc = sqlite3_open("dishes.db", &db); rc = sqlite3_prepare(db, "updat Read More
posted @ 2012-11-25 20:58 godjob Views(1319) Comments(0) Diggs(0)
python中对文件、文件夹的操作需要涉及到os模块和shutil模块。创建文件:1) os.mknod("test.txt") 创建空文件2)open("test.txt",w)直接打开一个文件,如果文件不存在则创建文件创建目录:os.mkdir("file")创建目录复制文件:shutil.copyfile("oldfile","newfile")oldfile和newfile都只能是文件shutil.copy("oldfile","newfile") Read More
posted @ 2012-11-25 00:16 godjob Views(350) Comments(0) Diggs(0)
掌握文本文件读写的方法了解二进制文件的读写方法C++文件流:fstream // 文件流ifstream // 输入文件流ofstream // 输出文件流//创建一个文本文件并写入信息//同向屏幕上输出信息一样将信息输出至文件#include<iomanip.h>#include<fstream.h>void main(){ ofstream f1("d:\\me.txt"); //打开文件用于写,若文件不存在就创建它 if(!f1)return; //打开文件失败则结束运行 f1<<setw(20)<<"姓名:& Read More
posted @ 2012-11-23 22:57 godjob Views(336) Comments(0) Diggs(0)
火狐firefox,包含了火狐浏览器的源代码,开发文档,火狐源代码使用等等https://developer.mozilla.org/en-US/linux/unix/freeBSD/openBSD 文档manpagehttp://nixdoc.net/ohloh code 找代码Welcome to Ohloh Code, the world’s largest, most comprehensive free code search engine! Koders has now merged with Ohloh to become your one-stop resou... Read More
posted @ 2012-11-06 16:57 godjob Views(598) Comments(0) Diggs(0)
FTP命令是Internet用户使用最频繁的命令之一,不论是在DOS还是UNIX操作系统下使用FTP,都会遇到大量的FTP内部命令。熟悉并灵活应用FTP的内部命令,可以大大方便使用者,并收到事半功倍之效。 FTP的命令行格式为:ftp-v-d-i-n-g[主机名],其中-v显示远程服务器的所有响应信息;-n限制ftp的自动登录,即不使用;.netrc文件;-d使用调试方式;-g取消全局文件名。ftp使用的内部命令如下(中括号表示可选项):1.![cmd[args]]:在本地机中执行交互shell,exit回到ftp环境,如:!ls*.zip.2.$macro-ame[args]:执行宏定义ma Read More
posted @ 2012-10-29 22:23 godjob Views(278) Comments(0) Diggs(0)
本文主要介绍了 OpenSCManager、CreateService、OpenService、ControlService、DeleteService、 RegisterServiceCtrlHandler、SetServiceStatus、StartServiceCtrlDispatcher等操 作服务程序的主要几个API的用法,具体的函数参数大家可以查阅MSDN。为什么要使用服务应该程序呢?服务程序就像系统的一些服务一样,能够自动地启动,并执行相应的操作;而且因为服务程序的在层次上和一般的应用程序不同,其 能够在系统启动时就自动地运行,而不像一般的应用程序那样一定要在登陆后才能运行,这些 Read More
posted @ 2012-10-27 23:27 godjob Views(590) Comments(0) Diggs(0)
最近在学网络编程,找到了国外一个开源的FTP服务器FileZilla server,可以研究研究源代码,当然开始时候应该要编译成功,下面给大家一个能够编译的版本,假设你已经在自己机子上安装了vs2010(也许vs2008也可以吧),下载下面的源代码,既然我们看的是开源软件源码,下载当然也是免费的,一起共享http://download.csdn.net/detail/hellosijian/4691680解压打开里面的工程,编译就可以,具体用法可以参看下面这篇文章,运行服务器后,可以直接在你的浏览器上输入 ftp:电脑IP便可进入 ,或者打开cmd命令行,输入ftp ip也可以进入http:/ Read More
posted @ 2012-10-27 12:04 godjob Views(1007) Comments(0) Diggs(1)
上一页 1 ··· 25 26 27 28 29 30 31 32 33 ··· 35 下一页