本文均来自PythonCookbook,本博文励志将Cookbook中的string部位,文件,面向对象编程部分完成,本系列博文陆续还会介绍flask框架,每篇博文都以一个个小例子展示。#-*-coding:utf-8-*-
‘‘‘
文件相关的操作:
read()
open()
两个参数:
第一个:文件路径
第二个:打开文件的模式
常..
                            
                            
                                分类:
编程语言   时间:
2014-05-03 02:00:18   
                                阅读次数:
417
                             
                    
                        
                            
                            
                                sed‘s/^/\//g‘4行首增加指定字符提取网页中的播放地址:#!/bin/bash
printf"enteryourdir:"
readdir
echo"$dirisxx"
cd$dir
echo`pwd`
forfilein`ls.`
do
if[-d$file];then
echo$file
cd$file
echo`pwd`
tree`pwd`|grepplay|sed‘s/.*//g‘>11
tree`pwd`|grepplay|sed‘s/.*//g..
                            
                            
                                分类:
其他好文   时间:
2014-05-03 00:53:15   
                                阅读次数:
336
                             
                    
                        
                            
                            
                                Instructionshereare not great.First shut down 
ST2.Make sure you use absolute paths for symlink:e.g.$ curl -kL 
http://xrl.us/pythonbrewinstall | bash$ ...
                            
                            
                                分类:
其他好文   时间:
2014-05-02 11:01:23   
                                阅读次数:
382
                             
                    
                        
                            
                            
                                出现下列错误:
mlogc.c:32:23: error: curl/curl.h: No such file or directory
mlogc.c:1091: error: expected ‘)’ before ‘*’ token
mlogc.c: In function ‘logc_init’:
     出错原因:缺少libcurl-dev or libcurl-devel
...
                            
                            
                                分类:
其他好文   时间:
2014-05-02 10:50:35   
                                阅读次数:
371
                             
                    
                        
                            
                            
                                HTTP1.1请求头:消息头 
Accept:text/html,image/*告诉服务器,客户机支持的数据类型Accept-Charset:ISO-8859-1告诉服务器,客户机采用的编码 
Accept-EnCoding:gzip,compress告诉服务器,客户机支持的数据压缩格式Accept.....
                            
                            
                                分类:
其他好文   时间:
2014-05-02 08:46:58   
                                阅读次数:
248
                             
                    
                        
                            
                            
                                转自:http://www.cnblogs.com/Matrix54/archive/2012/05/01/2478158.html一. 
获取当前系统时间和日期并格式化输出: 1 import java.util.Date; 2 import java.text.SimpleDateFormat; 
...
                            
                            
                                分类:
编程语言   时间:
2014-05-02 08:36:13   
                                阅读次数:
811
                             
                    
                        
                            
                            
                                Java代码 
importjava.io.File;importjava.io.FileNotFoundException;importjava.io.FileOutputStream;importjava.io.FileWriter;importjava.io.IOException;import...
                            
                            
                                分类:
编程语言   时间:
2014-05-02 06:13:08   
                                阅读次数:
477
                             
                    
                        
                            
                            
                                调试了好久,在MFC内居然不能够解析“Mat”总是显示"Mat"未定义,修改include、lib、依赖库,不断地修改:#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "cv.h"还是不能显示,最后想起来是需要:using namespace cv;
using names...
                            
                            
                                分类:
其他好文   时间:
2014-05-02 04:55:10   
                                阅读次数:
271
                             
                    
                        
                            
                            
                                usingSystem;
usingSystem.Collections.Generic;
usingSystem.IO;
usingSystem.Linq;
usingSystem.Text;
usingSystem.Threading.Tasks;
namespace读文件案例
{
classProgram
{
staticvoidMain(string[]args)
{
Console.WriteLine("请输入文件名");
stringfileName=Console.Read..
                            
                            
                                分类:
其他好文   时间:
2014-05-02 04:00:58   
                                阅读次数:
289
                             
                    
                        
                            
                            
                                $sudoyuminstallvim-enhanced<snipped>Transactioncheckerror:file/usr/share/man/man1/vim.1.gzfrominstallofvim-common-2:7.4.179-1.fc20.x86_64conflictswithfilefrompackagevim-minimal-2:7.4.027-2.fc20.x86_64报错,于是我又更新了一下vi试试$sudoyumupdatevim-min..
                            
                            
                                分类:
其他好文   时间:
2014-05-02 02:55:55   
                                阅读次数:
285