自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(10)
  • 收藏
  • 关注

原创 shell 在Oracle用户下修改某配置文件,并让环境变量生效

一层EOF,一层!即可#!/bin/bashsu - oracle <<EOFcd /home/oraclecat>test2.tt<<!just a test2!EOF参考https://blog.csdn.net/iamlaosong/article/details/40509399

2018-07-03 17:13:25 1234 1

原创 安装jumpserver 前,python 依赖环境常见报错yum

1、安装python的时候出现如下的错误   no acceptable C compiler found in $PATHchecking for --enable-universalsdk... nochecking for --with-universal-archs... 32-bitchecking MACHDEP... linuxchecking for --without-gcc.....

2018-06-06 15:09:09 1522

转载 SQL Server 的xp_cmdshell和bcp使用

启用 xp_cmdshell 1: sp_configure 'show advanced options',1 2: reconfigure 3: GO 4: 5: sp_configure 'xp_cmdshell',1 6: reconfigure 7: go 8: BCP测试 1: 2: --建立文件夹 3: DECLARE @CmdLine ...

2018-04-13 15:36:45 2040

原创 SQL cast、round函数及numeric类型实例

CAST(cast(round(a.backup_size/1024/1024,2) as numeric(5,2)) AS VARCHAR)+'MB' as backupsize,round函数:用于把数值字段舍为指定位数round(a.backup_size/1024/1024,2)即把a.backup_size/1024/1024的结果,保留2位小数cast函数:用于将round返回值,转换...

2018-04-11 16:19:03 6671

转载 Python 中的random模块

转自:https://www.cnblogs.com/yd1227/archive/2011/03/18/1988015.htmlPython中的random模块用于生成随机数。下面介绍一下random模块中最常用的几个函数。random.randomrandom.random()用于生成一个0到1的随机符点数: 0 <= n < 1.0random.uniform  random.u...

2018-03-06 11:48:54 161

原创 随机生成200个8位验证码,并存入mysql数据库

生成200个8位的验证码# -*- coding: utf-8 -*-import mysql.connectorimport random,stringdef readkey(num,length): with open('C:/Users/Administrator/Desktop/randomnum.txt', 'w+') as fo:     for i in ra...

2018-03-05 15:57:25 1099

原创 python write()参数错误,导致报错TypeError: a bytes-like object is required, not ‘str‘

# -*- coding: utf-8 -*-import random,stringfilerad = open('C:/Users/Administrator/Desktop/randomnum.txt','wb')for i in range(200): chars = string.ascii_letters + string.digits list = [ ra...

2018-03-05 12:31:27 63988 1

原创 python list及string 互相转换

python的read和write方法的操作对象都是string。而操作二进制的时候会把string转换成list进行解析,解析后重新写入文件的时候,还得转换成string

2018-03-05 11:54:07 1519

原创 python 在图片添加数字,初学者容易出现的报错及解决办法

   题目:在图片右上角添加数字     # -*- coding: utf-8 -*-from PIL import Image,ImageDraw,ImageFontimport random#open a photoim = Image.open('C:/Users/Administrator/Desktop/cat.jpg')#获取图像尺寸w,h = im.sizewdr...

2018-03-03 17:27:47 805

原创 [python] 使用pythonwin保存文件时,遇到'latin-1' codec can't encode character 报错

使用pythonwin 有中文注释时,保存遇到如下报错在文件开头添加  # -*- coding: utf-8 -*-或者# -*- coding: mbcs -*-

2017-10-13 14:28:51 852

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除