有两个列表,分别为:
1 | names = ['Alice', 'Beth', 'Ceil'] |
生成一个字典:
book = {'Alice': '2341', 'Beth': '9102', 'Ceil': '3158'}
有两个列表,分别为:
1 | names = ['Alice', 'Beth', 'Ceil'] |
生成一个字典:
book = {'Alice': '2341', 'Beth': '9102', 'Ceil': '3158'}
在遇到各种比较大的问题时候,行数过多导致打开处理会出问题,则需要切割,则可以用按行数切割的方法来处理。
代码如下:
这是一个常用的功能,可以有两种方法,os.walk
和os.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.
Ubuntu 16.04LTS 搭建 Shadowsocks
只针对Ubuntu16以上的版本。
执行很简单,首先是三条命令
1 | apt update |
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."
MacBook在安装好 hexo 和 node 之后,还是会出现如下的错误。
Hexo新建一篇文章的命令很简单hexo new arctical's title
,然后在Hexo的根目录的source
文件夹下的_posts
目录下自动创建相应的md文件,之后打开该目录,找到Hexo自动生成的文件打开编辑即可。但是当文件比较多的时候,找一个新的文件是很麻烦的一件事。那么我们便可以通过 js 脚本自动打开相应的编辑器来省事。
Xshell是Windows下很好用的一款SSH软件,但是性冷淡的配色终究还是有点枯燥,分享两个还可以的配色方案。
两个字典合并的,有几种方法
1 | dict1={1:[1,11,111],2:[2,22,222]} |
最近搞处理文件,各种命令搞的头晕眼花,此处做个合并,以便之后观察使用。
Update your browser to view this website correctly.&npsb;Update my browser now