11 2012 档案
摘要:学习linux不要死记硬背,更不要全部学会,够用就行,下面直接看例子,学习的最好方法就是看例子学习:$find ~ -name "*.txt" -print #在$HOME中查.txt文件并显示$find . -name "*.txt" -print$find . -name "[A-Z]*" -print #查以大写字母开头的文件$find /etc -name "host*" -print #查以host开头的文件$find . -name "[a-z][a-z][0–9][0–9].txt"
阅读全文
摘要:import sqlite3#10003[:1]{:2}{2}db = sqlite3.connect(r'c:\imageDB.db')cur=db.cursor();db.commit();try:cur.execute('insert into cet_t values(?,?)',('title2.jpg',sqlite3.Binary('123'),))except sqlite3.IntegrityError:import sysprint sys.exc_info()[0],sys.exc_info()[1]prin
阅读全文
摘要:# -*- 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("
阅读全文
摘要: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) ...
阅读全文
摘要:遍历存元组的列表进行操作一堆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
阅读全文
摘要:#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
阅读全文
摘要: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")
阅读全文
摘要:掌握文本文件读写的方法了解二进制文件的读写方法C++文件流:fstream // 文件流ifstream // 输入文件流ofstream // 输出文件流//创建一个文本文件并写入信息//同向屏幕上输出信息一样将信息输出至文件#include<iomanip.h>#include<fstream.h>void main(){ ofstream f1("d:\\me.txt"); //打开文件用于写,若文件不存在就创建它 if(!f1)return; //打开文件失败则结束运行 f1<<setw(20)<<"姓名:&
阅读全文
摘要:火狐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...
阅读全文