Pyhton遍历文件夹

这是一个常用的功能,可以有两种方法,os.walkos.listdir

文档是这么解释的:

os.listdir(path)

Return a list containing the names of the entries in the directory given by path. The list is in arbitrary order. It does not include the special entries ‘.’ and ‘..’ even if they are present in the directory.

Read more

Ubuntu 16.04LTS 搭建 Shadowsocks

只针对Ubuntu16以上的版本。

执行很简单,首先是三条命令

1
2
3
apt update
apt install python-pip
pip install shadowsocks
Read more

Android java.lang.OutOfMemoryError: GC overhead limit exceeded

​ 再用 Android Studio 编辑项目的时候,会出现如下错误。

1
java.lang.OutOfMemoryError: GC overhead limit exceeded

​ 根据 Sun 的描述:

1
"if too much time is being spent in garbage collection: if more than 98% of the total time is spent in garbage collection and less than 2% of the heap is recovered, an OutOfMemoryError will be thrown."

Read more

Hexo教程 error

​ MacBook在安装好 hexo 和 node 之后,还是会出现如下的错误。

Read more

Hexo添加文章自动打开编辑器

​ Hexo新建一篇文章的命令很简单hexo new arctical's title,然后在Hexo的根目录的source文件夹下的_posts目录下自动创建相应的md文件,之后打开该目录,找到Hexo自动生成的文件打开编辑即可。但是当文件比较多的时候,找一个新的文件是很麻烦的一件事。那么我们便可以通过 js 脚本自动打开相应的编辑器来省事。

Read more

Xshell配色方案

Xshell是Windows下很好用的一款SSH软件,但是性冷淡的配色终究还是有点枯燥,分享两个还可以的配色方案。

Read more

Python两个字典的合并

两个字典合并的,有几种方法

1
2
3
4
dict1={1:[1,11,111],2:[2,22,222]}
dict2={3:[3,33,333],4:[4,44,444]}
#得到如下的结果
{1:[1,11,111],2:[2,22,222],3:[3,33,333],4:[4,44,444]}
Read more

Pyhton的文件操作

​ 最近搞处理文件,各种命令搞的头晕眼花,此处做个合并,以便之后观察使用。

Read more

Linux提示Give root password for maintenance

由于非法重启或硬盘故障,会导致linux系统无法启动,无法进入操作系统。当你看到提示:give root password for maintenance(or type control-D to continue):的时候,你还有补救的机会。问题原因应该是/usr /home /boot分区磁盘检测出了问题。

Read more

Python创建目录

流程如下:

  1. 判断目录是否存在os.path.exists(path)
  2. 创建多层目录os.path.makedirs(path)
  3. 创建目录os.mkdir(path)
Read more
Your browser is out-of-date!

Update your browser to view this website correctly.&npsb;Update my browser now

×