上一页 1 ··· 13 14 15 16 17 18 19 20 21 ··· 74 下一页
摘要: 如果使用Python2.5或更早版本,请打开文件,然后在重定向中使用file对象: log = open("c:\\goat.txt", "w") print >>log, "test" 如果使用Python2.6或2.7,可以使用print作为函数: from __future__ import 阅读全文
posted @ 2020-04-12 18:06 邱明成 阅读(2057) 评论(0) 推荐(0)
摘要: 一、multiprocessing 用法参考地址:multiprocessing用法首先解释一个误区:进程池的大小是每次同时执行的进程数,但是并不会影响主进程申请进程的数量。主进程申请多进程量不等于池子大小。 1、子进程无返回值 # -*- coding:utf-8 -*- from multipr 阅读全文
posted @ 2020-03-20 23:24 邱明成 阅读(3885) 评论(0) 推荐(0)
摘要: 介绍同步模式 左边是原来的,一般的rsync的cs架构(client & server)同步模式,数据源服务器上安装rsync server,由server统一控制可以传输的数据的内容,例如权限,目录,文件数等,发起传输的是rsync client,即看起来就是将数据从源服务器拉取到备份服务器。 右 阅读全文
posted @ 2020-03-15 19:55 邱明成 阅读(678) 评论(0) 推荐(0)
摘要: @ERROR: auth failed on module input rsync error: error starting client-server protocol (code 5) at main.c(1506) [Receiver=3.0.7] rsync出现这个问题,说明前期的rsyn 阅读全文
posted @ 2020-03-15 17:02 邱明成 阅读(7614) 评论(0) 推荐(0)
摘要: optparse模块主要用来为脚本传递命令参数,采用预先定义好的选项来解析命令行参数。首先需要引入optparser模块,然后执行初始化,实例化一个OptionParser对象(可以带参,也可以不带参数),再为命令行添加选项,示例: from optparse import OptionParser 阅读全文
posted @ 2020-03-15 13:37 邱明成 阅读(529) 评论(0) 推荐(0)
摘要: 在python的main函数中的变量默认为全局变量,而其他的def函数中的变量则默认为局部变量。 当然,局部变量会优先于全局变量,在执行formal_print(t_global)语句时便可看出。 测试代码如下: #!/usr/bin/env python#coding=utf-8#测试python 阅读全文
posted @ 2020-03-11 00:21 邱明成 阅读(3165) 评论(0) 推荐(0)
摘要: 提交大于100M的文件到LFSLFSGitHub限制单个文件大小:超过100M将限制上传。 采用LFS寄存。 windows下安装Git LFS client for github,命令窗口下: git lfs installgit lfs -h #查看是否安装成功#cd到github项目路径(工作 阅读全文
posted @ 2020-03-03 15:49 邱明成 阅读(2346) 评论(0) 推荐(0)
摘要: shell-init: error retrieving current directory: getcwd: cannot access parent directories: 没有那个文件或目录chdir: error retrieving current directory: getcwd: 阅读全文
posted @ 2020-02-17 15:04 邱明成 阅读(11932) 评论(0) 推荐(2)
摘要: Issue crontab -l command fails with the following error. # crontab -l You (user) are not allowed to access to (crontab) because of pam configuration. 阅读全文
posted @ 2020-02-16 18:49 邱明成 阅读(1542) 评论(0) 推荐(0)
摘要: SSL_CTX_set_default_passwd_cb[_userdata]() 这个函数比较简单,就是设置SSL要加载的证书的口令,如果不设置的话加载证书时会出提示符要求输入口令的,这样在程序中使用就比较麻烦,该函数就是预先将口令保存,在读证书时自动使用。 实现该功能的有两个函数SSL_CTX 阅读全文
posted @ 2020-02-12 15:13 邱明成 阅读(2567) 评论(0) 推荐(1)
上一页 1 ··· 13 14 15 16 17 18 19 20 21 ··· 74 下一页