摘要:
Linux中新建的普通用户一般不会分配给root权限,每次都su root也太麻烦,可以通过在/etc/sudoers文件中添加当前用户的方式,给当前用户赋予sudo命令的使用权限。 /etc/sudoers文件中配置的通用格式是: user host=(run_as) command 其中, us 阅读全文
摘要:
文件名和目录名在操作系统中都有最大长度的限制,而且不同系统中的最大长度不同。 这些限制在Linux系统下可以通过修改系统内核修改这个限制。 结论: 执行代码如下: Linux下执行结果为: $ python name_len_test.py Maximum length of file name i 阅读全文
摘要:
Python的装饰器的概念,一直有点微妙。之前在StackOverflow上看过一篇感觉说明的很清楚的介绍: *A decorator must accept a function as an argument 参考地址: http://stackoverflow.com/questions/739 阅读全文
摘要:
AttributeError: 'SparkConf' object has no attribute '_get_object_id' 初始化SparkContext时出现这种错误是因为把SparkConf对象放在了参数第一个的位置,由于pyspark命令行会默认创建一个SparkContext, 阅读全文
摘要:
在virtualenv环境下使用matplotlib绘图时遇到了这样的问题: >>> import matplotlib.pyplot as pltTraceback (most recent call last): File "<stdin>", line 1, in <module> ... i 阅读全文