Python 两个列表合并

有两个列表,分别为:

1
2
names = ['Alice', 'Beth', 'Ceil']
numbers = ['2341', '9102', '3158']

生成一个字典:

book = {'Alice': '2341', 'Beth': '9102', 'Ceil': '3158'}

Read more

Python 按行切割文件

在遇到各种比较大的问题时候,行数过多导致打开处理会出问题,则需要切割,则可以用按行数切割的方法来处理。

代码如下:

Read more

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
Your browser is out-of-date!

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

×